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

openmp flag in OSX #32

Open
alainjwst opened this issue Jun 6, 2019 · 3 comments
Open

openmp flag in OSX #32

alainjwst opened this issue Jun 6, 2019 · 3 comments

Comments

@alainjwst
Copy link

We had trouble with batman-package-2.4.6 with OpenMP flag on OSX 10.12 with clang
(on such OSX, gcc is a link to clang, without OpenMP operational ... we do have to deactivate openmp flag. Furthermore, on OSX & clang, the OpenMP flag is -fgomp)

I just add a line after the line 65

parallel_args = ['-fopenmp', '-std=c99'] if has_openmp else ['-std=c99']
diff -i setup.py_ref setup.py
65a66
> parallel_args = ['-std=c99']

and then succeed to go to the end

@bhilbert4
Copy link

@lkreidberg I've had a couple of people now who have not been able to install batman (as a dependency of Mirage on their machines running Mac OSX 10.14. Removing -fopenmp from setup.py seems to have solved the problem in at least one case (See the Mirage issue above). I'm not really familiar with OpenMP at all. Does this make sense as a general solution?

@alainjwst
Copy link
Author

for me, it would be much better to activate OpenMP since most modern CPUs are multi-core :)

the problem is options is C compilers on OSX are a mess, options are changing, and you need to have a full LLVM to have OpenMP in Clang in recent OSX (eg 10.14). Documentation is unclear or missleading. One of my students, making regression on OSX and C compilers (gcc & clang) on a large code, spend weeks to realize the horrible details & differences between options and effective (or not) activations of OpenMP on OSX 10.12, 10.13 then 10.14. A mess. Often, solutions on Web site are just for a given version of a give compiler & OSX version. Take care.

My solution above should be more general. (need a recent Cmake). But not garantee on last OSX.

@lkreidberg
Copy link
Owner

Thanks for raising this issue Bryan, and for your comment Alain. Yeah, Alain is right - OpenMP is a huge hassle on OSX! If you don't need parallel processing capability it's fine to just remove the -fopenmp flag. If you do want to run the code in parallel, here are some instructions for installing LLVM: https://stackoverflow.com/questions/43555410/enable-openmp-support-in-clang-in-mac-os-x-sierra-mojave. Good luck, hope that helps!

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

3 participants