AFD-Illinois / ipole

Polarized covariant radiative transport code
16 stars 12 forks source link

Mac support #29

Closed bprather closed 4 years ago

bprather commented 4 years ago

Fixes #28, and handles compiling with 'brew' version of clang for OpenMP support but is otherwise minimally invasive/dependent.

Instructions+makefile work for me, and now one additional user, on macOS with brew.

Continues to work on personal Linux, Illinois BH machines, and Stampede. If I can get a few additional confirmations that it hasn't broken any machines I think we should merge this soon, as current state on Mac is pretty broken.

gnwong commented 4 years ago

Does this branch force-assume that llvm/clang is the compiler? Doing the completely naive thing on my machine fails on the first compile step with

/.../bin/h5cc: line 318: /usr/local/opt/llvm/bin/clang: No such file or directory
bprather commented 4 years ago

Yes. This was required to avoid using Apple's version of clang on machines where it is still installed, without changing the user's PATH or similar games.

gnwong commented 4 years ago

Could this be modified to also support gcc on mac/osx? That is, don't force the user to brew install llvm in those cases where they have a gcc installation that works for them?

bprather commented 4 years ago

I don't think GCC autodetection and fallback is a good idea, as Apple aliases 'gcc' to their version of clang, which doesn't include OpenMP. I have no idea how to detect whether the user has a "good" GCC or not. As for customization, you can always add a hostname.make to machines/ with the contents export HDF5_CC = gcc export HDF5_CLINKER = gcc And HDF5 will use gcc from your PATH