SifuSteve has asked for the wisdom of the Perl Monks concerning the following question:

Looking for insight into the following: I've been trying to install the Math:GSL package on openSuse Tumbleweed and run into an "Unsupported GSL version" during the build. Specifically

stevenc@suseLinux:~/.cpan/build/Math-GSL-0.44-0> perl Build.PL Checking for GSL using gsl-config Found GSL 2.8 (via gsl-config) installed in /usr Checking if cc supports "-Wall"...yes Checking if cc supports "-Wno-sometimes-uninitialized"...yes Checking if cc supports "-Wno-unused-function"...yes Checking if cc supports "-Wno-unused-value"...yes Checking if cc supports "-Wno-unused-function"...yes Checking if cc supports "-Wno-unused-variable"...yes Checking if cc supports "-Wno-gnu"...yes Checking if cc supports "-g"...yes Unsupported GSL version!!! : 2.8 at Build.PL line 85.

I have the gsl-devel library installed, and gsl-config verifies the ver 2.8 GSL install

S | Name | Summary + | Type ---+----------------------------+------------------------------------- +----------------------------+-------- | gsl | GNU Scientific Library + | package i+ | gsl-devel | Development files for the GNU Scient +ific Library | package | gsl-doc | Documentation for the GNU Scientific + Library | package | gsl-examples | Examples for the GNU Scientific Libr +ary | package | gsl-gnu-hpc | Dependency package for gsl_2_8_0-gnu +-hpc | package | gsl-gnu-hpc-devel | Dependency package for gsl_2_8_0-gnu +-hpc-devel | package | gsl-gnu-hpc-doc | Dependency package for gsl_2_8_0-gnu +-hpc-doc | package | gsl_2_8_0-gnu-hpc | GNU Scientific Library + | package | gsl_2_8_0-gnu-hpc-devel | Development files for the GNU Scient +ific Library | package | gsl_2_8_0-gnu-hpc-doc | Documentation for the GNU Scientific + Library | package | gsl_2_8_0-gnu-hpc-examples | Examples for the GNU Scientific Libr +ary | package | gsl_2_8_0-gnu-hpc-module | Module files for gsl_2_8_0-gnu-hpc + | package | libgsl-gnu-hpc | Dependency package for libgsl_2_8_0- +gnu-hpc | package i | libgsl28 | GNU Scientific Library + | package | libgsl_2_8_0-gnu-hpc | GNU Scientific Library + | package | libgslcblas-gnu-hpc | Dependency package for libgslcblas_2 +_8_0-gnu-hpc | package i | libgslcblas0 | A standard C language APIs for BLAS +from GNU Scientific Library | package | libgslcblas_2_8_0-gnu-hpc | A standard C language APIs for BLAS +from GNU Scientific Library | package | ms-gsl-devel | Development files for ms-gsl + | package | octave-forge-gsl | Octave bindings to the GNU Scientifi +c Library | package | python310-dogslow | A Django middleware that logs traceb +acks of slow requests | package | python311-dogslow | A Django middleware that logs traceb +acks of slow requests | package | python312-dogslow | A Django middleware that logs traceb +acks of slow requests | package

Not sure where to go from here. Been looking on line and through code and haven't found a solid solution to this yet. Advice is greatly appreciated here.

Replies are listed 'Best First'.
Re: Math::GSL Install Fail
by swl (Prior) on Jun 29, 2024 at 23:03 UTC

    I think Math:::GSL only supports up to GSL 2.7.x at the moment. Are you able to install that version?

Re: Math::GSL Install Fail
by etj (Priest) on Jun 30, 2024 at 11:11 UTC
    Have you tried editing the Build.PL to also be happy with 2.8 (or just delete the check) and seeing if the whole thing still works?

    If it does, you could open an issue on the Math::GSL repo saying that worked, and I expect it will get updated.

Re: Math::GSL Install Fail
by bliako (Abbot) on Jul 01, 2024 at 16:46 UTC

    Oh, perhaps modify the LDFLAGS to link by specifying the specific library version, for example, -lgsl26 (instead of -lgsl which links to the libgsl.so which is usually a (file)link to libgsl.XX.so. Just make sure when you install the gsl26 devel+libraries, there is a file libgsl26.so somewhere. So, don't change the (file)link libgsl.so to point to libgsl26.so but change the LDFLAGS in the Makefile.PL to link to -lgsl26. I think that would be a good solution.

    Alternatively, and I am not sure if this is a good advice, perhaps you can statically link to the GSL library during building the XS part of the distribution. This can be achieved by replacing (in the LDFLAGS) the dynamic link call (-lgsl, whatever it is) with the full path to the static library, e.g. /x/y/z/gsl2.6.a, as if you would do with an object file you wanted linked.

    Avoid changing the LD_LIBRARY_PATH because then you will need to keep it modified during running your app too (and not only during compilation). And for all users ... a mess.

    And a side point, make sure that the include path points to the GSL2.6 include files and not the current GSL include files. E.g. with #include <gsl/xyz.h> and -I/usr/include in the CFLAGS will probably include the files of the newest GSL distribution! Not what you want. So, you will need to check the CFLAGS for -I paths. While lib files have their version in the name, include dirs may not. If you installed a different devel version, it could have overwritten the include files of the current distribution. Perhaps your older version should be installed in /usr/local, then your CFLAGS should have -I/usr/local -I/usr/include (i.e. the local should preceed the standard include path). And here make sure you are including the right files! (or perhaps Makefile.PL will tell you so).

    bw, bliako

Re: Math::GSL Install Fail
by SifuSteve (Novice) on Jun 30, 2024 at 15:41 UTC

    Thank you for the replies and suggestions.

    I am fairly new to this, and just getting the idea of how to track these problems down and fix them.
    After finding, and digging through the git pages and code I believe up to version 2.6 GSL is supported.

    https://github.com/leto/math--gsl/blob/master/developer/wiki/Upgrade.md
    https://github.com/leto/math--gsl/blob/master/inc/Ver2Func.pm

    I have downloaded a 2.6 GSL version from the GNU ftp site supporting GSL, and have been working on compiling/installing etc.
    Commenting out the version check is a great idea I hadn't thought of. May not use it, but will keep the idea for future debugging problems.
    Assuming the 2.6 build goes okay, all I am left with figuring out is how to specify using the previous 2.6 GSL version for the build, and my scripts.

Re: Math::GSL Install Fail
by SifuSteve (Novice) on Jul 01, 2024 at 03:05 UTC

    I've managed to solve the last issue by setting the "LD_LIBRARY_PATH" to the directory containing the GSL 2.6 version, and recompiling.
    To be specific:

    export LD_LIBRARY_PATH=/home/stevenc/GSL2.6/lib64
    cpan look Math::GSL
    ./build
    ./build test
    ./build install

    stevenc@suselinux:~/.cpan/build/Math-GSL-0.44-0> ./Build test Processing 2.6 XS files, GSL 2.6 (via gsl-config) at /home/stevenc/GSL +2.6 Compiler = cc (SUSE Linux) 13.3.0 Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There i +s NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR +POSE. ccflags = -fPIC -I/home/stevenc/GSL2.6/include -D_REENTRANT -D +_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-stro +ng -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wno-sometimes-un +initialized -Wno-unused-function -Wno-unused-value -Wno-unused-functi +on -Wno-unused-variable -Wno-gnu -g -fPIC -fno-omit-frame-pointer -I/ +home/stevenc/GSL2.6/include ldflags = -shared -L/home/stevenc/GSL2.6/lib64 -lgsl -lgslcbla +s -lm -fPIC -fno-omit-frame-pointer PERL5LIB = /home/stevenc/perl5/lib/perl5:/home/stevenc/perl5/li +b/perl5 LD_LIBRARY_PATH = /home/stevenc/GSL2.6/lib64/ t/00-load.t ........ 1/? # Testing Math::GSL 0.44 with GSL 2.6 on x86_ +64-linux-thread-multi, Perl (/usr/bin/perl) 5.038002 t/00-load.t ........ ok t/BLAS.t ........... ok t/BSpline.t ........ ok t/CBLAS.t .......... ok t/CDF.t ............ ok t/Chebyshev.t ...... ok t/Combination.t .... ok t/Complex.t ........ ok t/Const.t .......... ok t/DHT.t ............ ok t/Deriv.t .......... ok t/Diff.t ........... ok t/Eigen.t .......... ok t/Errno.t .......... ok t/FFT.t ............ ok t/Fit.t ............ ok t/GSL.t ............ 1/? # # Elements start differing at index 2, delta = 9.99999998363421e +-08 # $x->[2] = 3.0010001 # $y->[2] = 3.0010002 # # Elements start differing at index 2, delta = 0.000999999999999 +89 # $x->[2] = 3 # $y->[2] = 3.001 t/GSL.t ............ ok t/Heapsort.t ....... ok t/Histogram.t ...... ok t/Histogram2D.t .... ok t/IEEEUtils.t ...... ok t/Integration.t .... ok t/Interp.t ......... ok t/Linalg.t ......... ok t/Machine.t ........ ok t/Matrix.t ......... 1/? # # Elements start differing at index 1, delta = 1 # $x->[1] = 3 # $y->[1] = 2 t/Matrix.t ......... ok t/MatrixComplex.t .. 1/38 # # Elements start differing at index 1, delta = 1 # $x->[1] = 3 # $y->[1] = 4 # # Elements start differing at index 1, delta = 1 # $x->[1] = 3 # $y->[1] = 2 t/MatrixComplex.t .. ok t/Min.t ............ ok t/Monte.t .......... ok t/Multifit.t ....... ok t/Multilarge.t ..... ok t/Multimin.t ....... ok t/Multiroots.t ..... ok t/Multiset.t ....... ok t/NTuple.t ......... 1/11 This is the end at t/NTuple.t line 14. t/NTuple.t ......... ok t/ODEIV.t .......... ok t/ODEIV_evolve.t ... ok t/Permutation.t .... ok t/Poly.t ........... ok t/PowInt.t ......... ok t/QRNG.t ........... ok t/RNG.t ............ ok t/Randist.t ........ ok t/Roots.t .......... ok t/Rstat.t .......... ok t/SF.t ............. 1/? # GSL version=2.6 t/SF.t ............. ok t/Siman.t .......... ok t/Sort.t ........... ok t/SparseMatrix.t ... ok t/Spline.t ......... ok t/Statistics.t ..... ok t/Sum.t ............ ok t/Sys.t ............ ok t/Vector.t ......... 1/143 # # Elements start differing at index 0, delta = 9 # $x->[0] = 1 # $y->[0] = 10 # # Elements start differing at index 0, delta = 9 # $x->[0] = 1 # $y->[0] = 10 t/Vector.t ......... ok t/VectorComplex.t .. ok t/Wavelet.t ........ ok t/Wavelet2D.t ...... ok t/ver2func.t ....... # Testing Math::GSL with GSL 1.16.1 on x86_64-lin +ux-thread-multi, Perl (/usr/bin/perl) 5.038002 t/ver2func.t ....... ok All tests successful. Files=58, Tests=4193, 8 wallclock secs ( 0.42 usr 0.10 sys + 7.04 c +usr 0.71 csys = 8.27 CPU) Result: PASS

    I hope this can help someone else

Re: Math::GSL Install Fail
by etj (Priest) on Jul 01, 2024 at 12:49 UTC
    Belatedly, an alternative way to get computation with GSL (and though I haven't tried it, I assume also will work with 2.8): try PDL, which comes with a GSL interface.
Re: Math::GSL Install Fail
by swl (Prior) on Jul 04, 2024 at 00:18 UTC

    Math-GSL version 0.45 has been uploaded to CPAN. The Changes file on CPAN seems not to have been updated but the github version lists support for GSL 2.8.

    (Update: Edited cpan link to include version. And then again a day later since the updated link was not working. )

Re: Math::GSL Install Fail
by SifuSteve (Novice) on Jul 01, 2024 at 00:48 UTC

    So I have managed to successfully install GSL 2.6 and have the Math::GSL install recognize it.
    However something has gone wrong, as Math::GSL will not pass the build test.
    I'm getting what seems to be a familiar "cannot open shared object file" error message.
    The .so files are there, but there seems to be a missing pointer to them.
    My suspicion is a missing "LD_LIBRARY_PATH during compile time, but I have no idea what to do about it.
    Below are some of the compile time flags, and an example of a the main error message.

    ccflags = -fPIC -I/home/stevenc/GSL2.6/include -D_REENTRANT -D +_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-stro +ng -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wno-sometimes-un +initialized -Wno-unused-function -Wno-unused-value -Wno-unused-functi +on -Wno-unused-variable -Wno-gnu -g -fPIC -fno-omit-frame-pointer -I/ +home/stevenc/GSL2.6/include ldflags = -shared -L/home/stevenc/GSL2.6/lib64 -lgsl -lgslcbla +s -lm -fPIC -fno-omit-frame-pointer PERL5LIB = /home/stevenc/perl5/lib/perl5:/home/stevenc/perl5/li +b/perl5 LD_LIBRARY_PATH =

    /Chebyshev.t ...... Can't load '/home/stevenc/.cpan/build/Math-GSL-0.4 +4-0/blib/arch/auto/Math/GSL/Chebyshev/Chebyshev.so' for module Math:: +GSL::Chebyshev: libgsl.so.25: cannot open shared object file: No such + file or directory at /usr/lib/perl5/5.38.2/x86_64-linux-thread-multi +/DynaLoader.pm line 206. at /home/stevenc/.cpan/build/Math-GSL-0.44-0/blib/lib/Math/GSL/Chebys +hev.pm line 11. Compilation failed in require at t/Chebyshev.t line 5. BEGIN failed--compilation aborted at t/Chebyshev.t line 5. t/Chebyshev.t ...... Dubious, test returned 2 (wstat 512, 0x200)

    Please advise.....