leto / math--gsl

Perl interface to the GNU Scientific Library
http://leto.net/code/Math-GSL
33 stars 25 forks source link

`Alien::GSL` does not work out of the box: Can't exec "gsl-config": No such file or directory at Build.PL line 296 #212

Open hakonhagland opened 4 years ago

hakonhagland commented 4 years ago

I tried to install Math::GSL from a docker container with no preinstalled libgsl.so, and I got the following error:

$ cpanm -v Math::GSL
[...] 
Checking for GSL using gsl-config
Can't exec "gsl-config": No such file or directory at Build.PL line 296.

***
*** Can't find GSL with gsl-config.
*** Trying with PkgConfig.

Asking PkgConfig with ENV{PKG_CONFIG_PATH}=/usr/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/pkgconfig:/usr/libdata/pkgconfig:/usr/local/libdata/pkgconfig:/opt/pkgconfig

***
*** PkgConfig failed with error message: Can't find gsl.pc in any of /usr/local/lib/x86_64-linux-gnu/pkgconfig /usr/local/lib/pkgconfig /usr/local/share/pkgconfig /usr/lib/x86_64-linux-gnu/pkgconfig /usr/lib/pkgconfig /usr/share/pkgconfig
use the PKG_CONFIG_PATH environment variable, or
specify extra search paths via 'search_paths'

*** Probably you need to install GSL?
***  On Debian/Ubuntu you can use:
***      sudo apt-get install libgsl0-dev
***  On Mac you can use homebrew (http://brew.sh/):
***      brew install gsl
***  On Fedora/CentOS/RedHat/openSUSE you can use
***      sudo yum install gsl-devel
*** Or get GSL at http://www.gnu.org/software/gsl

Before this output happend, cpanm had already installed Alien::GSL which installed libgsl.so to (I was using perlbrew):

/home/hakond/perl5/perlbrew/perls/perl-5.30.0/lib/site_perl/5.30.0/auto/share/dist/Alien-GSL/lib/

shouldn't that be enough for Build.PL to find gsl-config at

/home/hakond/perl5/perlbrew/perls/perl-5.30.0/lib/site_perl/5.30.0/auto/share/dist/Alien-GSL/bin/

?? I can fix the problem manually by setting PKG_CONFIG_PATH explicitly:

PKG_CONFIG_PATH=/home/hakond/perl5/perlbrew/perls/perl-5.30.0/lib/site_perl/5.30.0/auto/share/dist/Alien-GSL/lib/pkgconfig cpanm Math::GSL

but I think the user should not have to figure this out by himself. Instead he should only have to type the usual command cpanm Math::GSL in it will just work. Any ideas?

leto commented 4 years ago

@hakonhagland Alien::GSL has not been tested extensively, any improvements you have for it are much appreciated