ld: library not found for -liomp5 when installing
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.
@manodeep I'll leave this to you as I'm pretty useless at Mac!
@ziarriall I've lightly edited your comment for formatting
Ohh crap - totally missed this one!
@ziarriall Did you manage to find a work-around?
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
Sorry for the late reply. I changed the line 267 to -Lmypathtolib -lomp, now it works. Thanks a lot.
Looks like this was resolved