Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Feature request) Porting to OS X #6

Open
wfbradley opened this issue Aug 11, 2015 · 2 comments
Open

(Feature request) Porting to OS X #6

wfbradley opened this issue Aug 11, 2015 · 2 comments

Comments

@wfbradley
Copy link

Dear Sebastian,

I was interested in running this code on my Mac (running OS X 10.9.5). The only compilation issue was that on Macs, the native C compiler is clang (gcc redirects to it), and clang handles function inlining a little differently than gcc. For a description of the issue, see: http://clang.llvm.org/compatibility.html#inline

Anyway, the fix here is to delete "inline" from (most of) the inlined functions. There are two static inline functions in util.c that can remain:
static inline int meshgraph_add_vertex_neighbor(meshgraph_t *g, int i, int vertex, int edge)
static inline int meshgraph_add_edge_neighbor(meshgraph_t *g, int i, int vertex, int face)

With this change, everything compiles.

I wanted to ask you if you would consider making an option for automatically dropping the inlining (I guess through make install?) when compiling on a Mac; it would be great if people like me could use this code out-of-the-box.

Thanks,
Bill

@SebastianRiedel
Copy link
Owner

Hi Bill,

I have a tight schedule at work at the moment, so I can't fix this in the near future. Also, I don't have a Mac platform available to test it. However, you are more then welcome to provide a pull request.

I guess it could be as easy as 1) detecting the Mac platform in the Makefile, 2) add a -D OSX flag to the CCFLAGS (compile flags) in case we're on a Mac and 3) switch the inline functions to a non-inline version if the define is set via #ifdef-s (that's what you did manually now, right?).

Best,
Sebastian

@wfbradley
Copy link
Author

Dear Sebastian,

Sure, I'll try to clean up my code and send you a pull request. (After I learn how to make a pull request :) ).

Bill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants