bmorris3 / kelp

Photometric phase curves of exoplanets
https://kelp.readthedocs.io/en/latest/
7 stars 2 forks source link

Stubborn compilation issue on Mac OS X #1

Closed bmorris3 closed 4 years ago

bmorris3 commented 4 years ago

I've had a persistent error running the successfully-built shared library fast*.so, which reads something like:

ImportError: dlopen(...cpython-36m-darwin.so, 2): Symbol not found: _GOMP_parallel
  Expected in: flat namespace

This error seems to occur when the version of gcc currently pointed at by the CC environment variable doesn't support OpenMP, which happened for me on OS X Mojave, but not El Capitan. It can be extremely confusing to find the working version and get setup.py to point towards the correct version.

bmorris3 commented 4 years ago

The solution I found was to:

  1. Remove the CC environment variable from my ~/.bash_profile
  2. Reinstall/update llvm with conda upgrade llvm
  3. Open a new terminal, and recompile the code with python setup.py ...
  4. prepend the compiler and linker arguments with -Xpreprocessor
  5. Success 🎉