fgvieira/ngsF

Problem with gsl during installation

Closed this issue · 6 comments

Hello, I have a problem with gsl as a dependency of ngsF.
I work with conda 4.12.0 in a dedicated environment.
The installation of ngsF warned that the gsl.pc and gsl/gsl_rng.h files are not found:
In the ngsF directory:

make
make -C htslib bgzip
make[1]: Entering directory '/mnt/shared/home/usr/ngsF/htslib'
cc -c -Wall -O3  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bgzip.c -o bgzip.o
cc -c -Wall -O3  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bgzf.c -o bgzf.o
bgzf.c: In function ‘bgzf_close’:
bgzf.c:630:8: warning: variable ‘count’ set but not used [-Wunused-but-set-variable]
    int count, block_length = deflate_block(fp, 0);
        ^~~~~
cc -c -Wall -O3  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. knetfile.c -o knetfile.o
cc -Wall -O3  -o bgzip bgzf.o bgzip.o knetfile.o -lz
make[1]: Leaving directory '/mnt/shared/home/usr/ngsF/htslib'
Package gsl was not found in the pkg-config search path.
Perhaps you should add the directory containing `gsl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gsl' found
g++ -O3 -Wall -I -I/mnt/shared/home/usr/ngsF/htslib  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE  -c parse_args.cpp
Package gsl was not found in the pkg-config search path.
Perhaps you should add the directory containing `gsl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gsl' found
g++ -O3 -Wall -I -I/mnt/shared/home/usr/ngsF/htslib  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE  -c read_data.cpp
read_data.cpp:1:10: fatal error: gsl/gsl_rng.h: No such file or directory
 #include <gsl/gsl_rng.h>
          ^~~~~~~~~~~~~~~

Therefore I have re-installed gsl with conda, and the installed version is 2.28.
conda install -c conda-forge gsl

I have checked as well the presence of gl/gsl_rng.h
/mnt/shared/scratch/usr/apps/conda/pkgs/gsl-2.7-he838d99_0/include/gsl/gsl_rng.h

But the same issue happen again.
Have you seen this issue before?

ngsF makefile tries to find gsl in your system through:

ngsF/Makefile

Line 18 in b327c14

LIB = $(shell pkg-config --libs gsl) -lz -lpthread $(HTS_LIBDIR)

I have never tried compiling ngsF with a gsl conda installation but, looking a bit around, someone suggested also installing:

conda install pkg-config

Can you give it a try?

Thanks for the quick answer!
I have run the command below, and got the familiar "Your installed version is: 2.28"
But I got the same error message than listed above.

I have however repaired the path of pkg config:

PKG_CONFIG_PATH='/mnt/shared/scratch/usr/apps/conda/lib/pkgconfig

However the make test is failed, without any specific error message:

make
make -C htslib bgzip
make[1]: Entering directory '/mnt/shared/home/usr/ngsF/htslib'
make[1]: 'bgzip' is up to date.
make[1]: Leaving directory '/mnt/shared/home/usr/ngsF/htslib'

make test
ngsF: test(s) failed!

Great!
The tests only really work if you install it through ngsTools.

make
make -C htslib bgzip
make[1]: Entering directory '/mnt/shared/scratch/usr/folder/scripts/ngsF/htslib'
make[1]: 'bgzip' is up to date.
make[1]: Leaving directory '/mnt/shared/scratch/usr/folder/scripts/ngsF/htslib'
/mnt/shared/scratch/usr/apps/conda/bin/x86_64-conda-linux-gnu-c++ -O3 -Wall -I -I/mnt/shared/scratch/usr/folder/scripts/ngsF/htslib -I/mnt/shared/scratch/usr/apps/conda/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE  -c read_data.cpp
/mnt/shared/scratch/usr/apps/conda/bin/x86_64-conda-linux-gnu-c++ -O3 -Wall -I -I/mnt/shared/scratch/usr/folder/scripts/ngsF/htslib -I/mnt/shared/scratch/usr/apps/conda/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE  -c EM.cpp
/mnt/shared/scratch/usr/apps/conda/bin/x86_64-conda-linux-gnu-c++ -O3 -Wall -I -I/mnt/shared/scratch/usr/folder/scripts/ngsF/htslib -I/mnt/shared/scratch/usr/apps/conda/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE  -c shared.cpp
/mnt/shared/scratch/usr/apps/conda/bin/x86_64-conda-linux-gnu-c++ -O3 -Wall -I -I/mnt/shared/scratch/usr/folder/scripts/ngsF/htslib -I/mnt/shared/scratch/usr/apps/conda/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE  ngsF.cpp parse_args.o read_data.o EM.o shared.o -L/mnt/shared/scratch/usr/apps/conda/lib -lgsl -lgslcblas -lm -lcblas -lm -lz -lpthread /mnt/shared/scratch/usr/folder/scripts/ngsF/htslib/bgzf.o /mnt/shared/scratch/usr/folder/scripts/ngsF/htslib/knetfile.o -o ngsF
/mnt/shared/scratch/usr/apps/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: parse_args.o: relocation R_X86_64_32 against `.data' can not be used when making a PIE object; recompile with -fPIE
/mnt/shared/scratch/usr/apps/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /mnt/shared/scratch/usr/folder/scripts/ngsF/htslib/bgzf.o: relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/mnt/shared/scratch/usr/apps/conda/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /mnt/shared/scratch/usr/folder/scripts/ngsF/htslib/knetfile.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:40: ngsF] Error 1

Apologizes for the multiple post, but problems persist during the installation of ngsF.
Have you seen this error previously?

I have never seen this error. But can you try replacing the line:

ngsF/Makefile

Line 18 in b327c14

LIB = $(shell pkg-config --libs gsl) -lz -lpthread $(HTS_LIBDIR)

with

LIB = $(shell pkg-config --libs gsl) -lz -lpthread $(HTS_LIBDIR) -fPIE

Thanks for the answer! After changing the path in the Makefile, the make command seems to work. But ngsF still send error message:

# Make in the ngsF directory:
make
make -C htslib bgzip
make[1]: Entering directory '/mnt/shared/scratch/usr/file/scripts/ngsF/htslib'
make[1]: 'bgzip' is up to date.
make[1]: Leaving directory '/mnt/shared/scratch/usr/file/scripts/ngsF/htslib

# Trying to start ngsF in the ngsF directory:
./ngsF
./ngsF: error while loading shared libraries: libgsl.so.25: cannot open shared object file: No such file or directory

I have reinstalled the gsl package and the problem persist.
I don't think ngsF is the problem here, I might have to solve conflicts between gsl versions installed in my system.
marbl/MashMap#39
I will try to solve this problem on my side. Thank you for your help!