Compilation issue: libBibWig.a not found
Closed this issue · 4 comments
I'm getting this error, even though libBigWig.a is definitely in my library path:
evrong01-i27-02 WiggleTools$ export LIBDIR=/usr/local/lib
$ l /usr/local/lib/libBigWig.a
lrwxr-xr-x 1 evrong01 admin 41B Dec 27 21:08 /usr/local/lib/libBigWig.a -> ../Cellar/libbigwig/0.4.4/lib/libBigWig.a
$ l /usr/local/Cellar/libbigwig/0.4.4/lib/libBigWig.a
-rwxr-x--- 1 evrong01 NYUMC\Domain Users 57K May 14 2019 /usr/local/Cellar/libbigwig/0.4.4/lib/libBigWig.a
evrong01-i27-02 WiggleTools$ make
cd src; make -e
mkdir -p /usr/local/lib
ar rcs /usr/local/lib/libwiggletools.a *.o
mkdir -p ../bin
cc -g -Wall -O3 -std=gnu99 -L/usr/local/lib -L../../libBigWig -L../../htslib wiggletools.c -lwiggletools -l:libBigWig.a -lcurl -l:libhts.a -lgsl -lgslcblas -lz -lpthread -lm -llzma -lbz2 -o ../bin/wiggletools
ld: warning: directory not found for option '-L../../libBigWig'
ld: warning: directory not found for option '-L../../htslib'
ld: library not found for -l:libBigWig.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../bin/wiggletools] Error 1
make: *** [Wiggletools] Error 2
It seems almost impossible to compile wiggletools on Mac OS, due to issues with library linking. Can you please have it updated on brew?
I think it has to do with this issue: https://discourse.brew.sh/t/cmake-linking-not-working-since-mojave/3790/8
Note: I made sure the library paths are correct, the libraries are in the right place, but clang still gives this error on Mac OS Catalina. I tried manually changing library paths, copying the libraries into the Xcode library paths, changing isysroot in cc, gcc, installing homebrew gcc, plus a few other things. Catalina broke compilations for some reason. So compiling on Mac OS requires real expertise that few people have, hence the need for brew or conda.
Thanks.
Hello @gevro ,
This probably has to do with the way the MacOS clang compiler does not handle static libraries like GCC did. I have now fixed this on master.
Could you please try brew install wiggletools --HEAD
before I go on to update the Brew formula?
Cheers,
Daniel
Yup, works! Thanks.
Ace, thanks for confirming.