Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail to find libgsl #2325

Closed
caylamason opened this issue Nov 27, 2024 · 3 comments
Closed

fail to find libgsl #2325

caylamason opened this issue Nov 27, 2024 · 3 comments

Comments

@caylamason
Copy link

Hello,

I am trying to install bcftools with libgsl enabled on a Linux server (I cannot use sudo apt-get or yum to install anything) and it cannot seem to find my installation of gsl. I have both bcftools-1.21 and gsl-2.8 installed in my home directory; the latter compiled as expected. When I run the configure command in the bcftools directory, I get the following error:

(base) [___@___ bcftools-1.21]$ ./configure --enable-libgsl --enable-perl-filters
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for C compiler warning flags... -Wall
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking location of HTSlib source tree... ../htslib-1.21-19
checking shared library type... plain .so
checking for library containing dlopen... none required
checking if the compiler accepts -rdynamic... yes
checking for zlib.h... yes
checking for inflate in -lz... yes
checking for gsl/gsl_version.h... no
configure: error: libgsl development files not found
`The bcftools polysomy command uses routines from the GNU Scientific library` `<https://www.gnu.org/software/gsl/>. Building BCFtools with libgsl enabled` `requires libgsl development files to be installed on the build machine; you` `may need to ensure a package such as libgsl0-dev (on Debian or Ubuntu linux)` `or gsl-devel (on RPM-based Linux distributions) is installed.`
Either configure with --disable-libgsl or resolve this error to build bcftools.

How can I indicate in the configure command where to find libgsl?

Thanks much,
Cayla

@pd3
Copy link
Member

pd3 commented Dec 3, 2024

You'll probably need to install gsl-devel, as mentioned in the documentation

sudo apt-get install autoconf automake make gcc perl zlib1g-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev libssl-dev libperl-dev libgsl0-dev

@jmarshall
Copy link
Member

jmarshall commented Dec 3, 2024

As the OP noted, she cannot install system packages herself — though usually the best approach for large libraries like GSL is to find the system administrator who can and get them to do it!

Failing that, you can tell configure where your own libgsl installation is in the usual configure way:

./configure --enable-libgsl --enable-perl-filters CPPFLAGS=-I$HOME/installed-libgsl/include LDFLAGS=-L$HOME/installed-libgsl/lib

assuming you have run ./configure --prefix=$HOME/installed-libgsl; … ; make install when building GSL to install your own libgsl. If $HOME/gsl-2.8 is merely a source directory, you may need to run make install or adjust those paths.

You may also need to set LD_LIBRARY_PATH appropriately when running bcftools so that it can find libgsl.so.0 if it has been linked to your shared library.

@caylamason
Copy link
Author

thanks @jmarshall that was exactly what I needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants