Bug #1354

Gammalib build fails with latest clang because -fopenmp is passed incorrectly

Added by Deil Christoph about 10 years ago. Updated about 10 years ago.

Status:RejectedStart date:10/31/2014
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

0%

Category:-
Target version:00-09-00
Duration:

Description

I’ve updated to OS X 10.10 (Yosemite) a week ago and now am using the latest clang compiler:

$ clang --version
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0

Now for a fresh Gammalib repo checkout the build fails like this:

/usr/bin/clang++ -bundle -undefined dynamic_lookup -Wl,-headerpad_max_install_names build/temp.macosx-10.10-x86_64-3.4/gammalib/app_wrap.o -L../src/.libs -L/opt/local/lib -L../src/.libs -L/usr/local/gamma/lib -L/opt/local/lib -lgamma -lcfitsio -lreadline -lncurses -o build/lib.macosx-10.10-x86_64-3.4/gammalib/_app.so -fopenmp
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Full log here: https://gist.github.com/cdeil/2324784e70a36cdfaf46#file-gistfile1-txt-L1456

I think previously clang ignored `-fopenmp`, but now that it will get OpenMP support soon, it actually gives an error when passed `-fopenmp` incorrectly.

Jürgen, can you fix the build system to detect if OpenMP is available and not pass `-fopenmp` in this case?


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen about 10 years ago

There is something strange on your system. When gammalib compiles the C++ code, it uses g++. As you see from the top of the configuration step, it find g++ and hence enables OpenMP support, and this seems to work fine.

The problem occurs when it comes to the Python compilation, which is not controlled by gammalib but by distutils. Your Python is apparently compiled using clang, and here no OpenMP support is possible. However, as gammalib was compiled before with OpenMP support, it now tries to do the same for the Python compilation, and this fails.

It is in any case not possible to link an OpenMP library to a non-OpenMP library, hence there is no fix to this except for:
  • assuring that you use the same compiler for Python and gammalib
  • using the --disable-openmp open in the gammalib configuration

#2 Updated by Knödlseder Jürgen about 10 years ago

  • Status changed from New to Rejected

Rejected as this is a Mac OS X configuration problem.

Also available in: Atom PDF