Corrfunc icon indicating copy to clipboard operation
Corrfunc copied to clipboard

ld: library not found for -liomp5 when installing

Open ziarriall opened this issue 3 years ago • 4 comments

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.

ziarriall avatar Feb 03 '22 21:02 ziarriall

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

@ziarriall I've lightly edited your comment for formatting

lgarrison avatar Feb 03 '22 21:02 lgarrison

Ohh crap - totally missed this one!

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

manodeep avatar Apr 07 '22 05:04 manodeep

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

manodeep avatar Apr 07 '22 05:04 manodeep

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

ziarriall avatar May 31 '22 10:05 ziarriall

Looks like this was resolved

manodeep avatar Sep 30 '22 06:09 manodeep