smithlabcode / piranha

Piranha is a peak-caller for CLIP- and RIP-seq data
17 stars 16 forks source link

Make all fails with error: No such file or directory #include <gsl/gsl_rng.h> #12

Open Samashoon opened 4 years ago

Samashoon commented 4 years ago

Hi,

I try to install Piranha 1.2.1 but "make all" step gives the following error:

... g++ -Wall -fPIC -fmessage-length=50 -O3 -c -o ../common/NegativeBinomial.o ../common/NegativeBinomial.cpp -I/draco/u/samas/piranha/piranha-1.2.1/src/smithlab_cpp -I../common/ ../common/NegativeBinomial.cpp:44:25: fatal error: gsl/gsl_rng.h : No such file or directory

include <gsl/gsl_rng.h>

                     ^

compilation terminated. Makefile:55: recipe for target '../common/NegativeBinomial.o' failed make[2]: [../common/NegativeBinomial.o] Error 1 make[2]: Leaving directory '/draco/u/samas/piranha/piranha-1.2.1/src/progs' Makefile:27: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/draco/u/samas/piranha/piranha-1.2.1/src' Makefile:27: recipe for target 'all' failed

./configure doesn't give any error and config.log looks ok to me. I passed include and lib directories to ./configure via CPPFLAGS and LDFLAGS . I used different versions of gcc and gsl. I passed include directory to "make all" as well. "gsl/gsl_rng.h" file is present in include directory I don't know why it can't be found.

Could you please help me to solve the problem? I would really like to use Piranha over other peak calling tools.

Thanks, Sama

Samashoon commented 4 years ago

Issue solved. I explain here what I did, in the case that someone else has the same problem while installing (it took me really long to solve it as I am not a programmer!).

Piranha Makefile code is written in a way that cannot link to nonstandard include and lib directories even when passed by the LDFLAGS and CPPFLAGS. So if you have headers and libraries in nonstandard directories you will have the same issue.

I solved the problem of linking include directory by making a symlink for path/to/directory/include/gsl/ inside the common folder (../src/common).

Makefile could not link to the lib folder too(error= /usr/bin/ld: cannot find -lgsl). I figured out that LDFLAGS were not passed to the processor (Makefile.in located in /src/progs/ has to be modified). To fix it, I modified Makefile.in. which is located in /src/progs/. I typed -L/path/to/directory/gsl/lib/ before $(LIBS). You may also pass LDFLAGS to the processor in Makefile.in. To make the "Make test" work you should do the same for the Makefile.in located in src/test as well. This file needs more modifications.

I hope the developers can fix the issue in the code. -Sama