manodeep / Corrfunc

⚡️⚡️⚡️Blazing fast correlation functions on the CPU.
https://corrfunc.readthedocs.io
MIT License
163 stars 50 forks source link

ld: library not found for -liomp5 when installing #272

Closed ziarriall closed 1 year ago

ziarriall commented 2 years ago

I try to install Corrfunc on macos Big sur. With all dependencies installed, after git clone and make install, I get the following error:

MacBook-Pro:Corrfunc $ make install
mkdir -p lib
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C theory install
Enabling OpenMP with clang.

-------COMPILE SETTINGS------------
     MAKE        = ["/Applications/Xcode.app/Contents/Developer/usr/bin/make"]
     CC      = ["clang-omp"]
     OPT         = ["-DPERIODIC -DENABLE_MIN_SEP_OPT  -DCOPY_PARTICLES  -DUSE_OMP"]
     CFLAGS      = [" -DVERSION=\"2.4.0\" -DUSE_UNICODE -std=c99 -m64 -g -Wsign-compare -Wall -Wextra -Wshadow -Wunused -fPIC -D_POSIX_SOURCE=200809L -D_GNU_SOURCE -D_DARWIN_C_SOURCE -O3  -fopenmp -funroll-loops -march=native -fno-strict-aliasing -Wformat=2  -Wpacked  -Wnested-externs -Wpointer-arith  -Wredundant-decls  -Wfloat-equal -Wcast-qual -Wcast-align -Wmissing-declarations -Wmissing-prototypes  -Wnested-externs -Wstrict-prototypes   -Wno-unused-local-typedefs "]
     CLINK       = [" -liomp5 -lm"]
     PYTHON      = ["python"]
     GSL_CFLAGS  = ["-I/usr/local/Cellar/gsl/2.7.1/include"]
     GSL_LINK    = ["-L/usr/local/Cellar/gsl/2.7.1/lib -lgsl -lgslcblas -Xlinker -rpath -Xlinker /usr/local/Cellar/gsl/2.7.1/lib"]
     PYTHON_CFLAGS   = ["-isystem/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -isystem /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/"]
-------END OF COMPILE SETTINGS------------

clang-omp  -DVERSION=\"2.4.0\" -DUSE_UNICODE -std=c99 -m64 -g -Wsign-compare -Wall -Wextra -Wshadow -Wunused -fPIC -D_POSIX_SOURCE=200809L -D_GNU_SOURCE -D_DARWIN_C_SOURCE -O3  -fopenmp -funroll-loops -march=native -fno-strict-aliasing -Wformat=2  -Wpacked  -Wnested-externs -Wpointer-arith  -Wredundant-decls  -Wfloat-equal -Wcast-qual -Wcast-align -Wmissing-declarations -Wmissing-prototypes  -Wnested-externs -Wstrict-prototypes   -Wno-unused-local-typedefs  logbins.c  -liomp5 -lm -o logbins
ld: library not found for -liomp5
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [logbins] Error 1
make: *** [install] Error 2

I guess the problem is the library should be libomp5, instead of liomp5? But I couldn't find where to change it so couldn't confirm this. Any comment would be very helpful.

lgarrison commented 2 years ago

@manodeep I'll leave this to you as I'm pretty useless at Mac!

@ziarriall I've lightly edited your comment for formatting

manodeep commented 2 years ago

Ohh crap - totally missed this one!

@ziarriall Did you manage to find a work-around?

manodeep commented 2 years ago

I have not encountered clang-omp in quite a few years now - but these are the two relevant lines that would need to be commented out/changed

ziarriall commented 2 years ago

Sorry for the late reply. I changed the line 267 to -Lmypathtolib -lomp, now it works. Thanks a lot.

manodeep commented 1 year ago

Looks like this was resolved