Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^4: Math::GSL::SparseMatrix is broken if installed on latest 5.32.1.1 "Strawberry Perl PDL edition", whom to report this issue to?

by Anonymous Monk
on Nov 09, 2022 at 10:54 UTC ( [id://11148063]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Math::GSL::SparseMatrix is broken if installed on latest 5.32.1.1 "Strawberry Perl PDL edition", whom to report this issue to?
in thread Math::GSL::SparseMatrix is broken if installed on latest 5.32.1.1 "Strawberry Perl PDL edition", whom to report this issue to?

I did as you suggested, now output line is

2.7.1 share

However my test script still fails as "1 1 1", and Math::GSL::gsl_version still says "2.6".

Same result with freshly unpacked "PDL edition SP 5.32.1.1", then env. variable set, then Alien::GSL and Math::GSL installed cleanly.

For now I'll continue with non-PDL SP and just install PDL if needed. I think long habit of choosing "PDL edition" as default is from time past, when PDL installation process had issues, it isn't the case in 2022. Thanks everyone for help.

  • Comment on Re^4: Math::GSL::SparseMatrix is broken if installed on latest 5.32.1.1 "Strawberry Perl PDL edition", whom to report this issue to?
  • Select or Download Code

Replies are listed 'Best First'.
Re^5: Math::GSL::SparseMatrix is broken if installed on latest 5.32.1.1 "Strawberry Perl PDL edition", whom to report this issue to?
by syphilis (Archbishop) on Nov 09, 2022 at 11:50 UTC
    Updated:

    However my test script still fails as "1 1 1", and Math::GSL::gsl_version still says "2.6".

    That will be because your Math::GSL was built against the static GSL libs that shipped with the "PDL edition".
    Once Math::GSL has been built against those static libs, it will continue to reference the behaviour provided by that library.
    In addition to installing the gsl-2.7.1 shared library, you will then need to rebuild (and re-install) Math::GSL against that gsl-2.7.1 shared library before you will see the correct bahaviour,

    I think long habit of choosing "PDL edition" as default is from time past, when PDL installation process had issues, it isn't the case in 2022

    I'm pretty sure the problem is with the version of the static GSL libs that ship with the "PDL edition" (in c/lib).
    It used to be the case that there were parts of Math::GSL functionality that required shared gsl libs, not static libs - though I think the problem your facing is probably just that there's a bug in version 2.6.
    I don't know if that reliance on a shared gsl library is still present with Math::GSL. IIRC, it was not something that could be fixed trivially, so perhaps it's still an issue.

    In any case, I agree that the best and easiest solution is to use the non-PDL edition if you wish to also use Math::GSL, assuming that works for you.
    It didn't actually work for me. Running cpanm -i Alien::GSL seemed to go fine, but cpanm -i Math::GSL croaked with:
    Running Build.PL Checking for GSL using gsl-config 'gsl-config' is not recognized as an internal or external command, operable program or batch file. 'gsl-config' is not recognized as an internal or external command, operable program or batch file. 'gsl-config' is not recognized as an internal or external command, operable program or batch file. 'gsl-config' is not recognized as an internal or external command, operable program or batch file.
    I probably just need to set some environment variable(s) appropriately, but these days I quickly lose interest in messing about when Module::Build and "Alien" libraries are involved.

    Cheers,
    Rob

      gsl-config is a bourne shell script so does not work under windows. It seems Strawberry Perl distributes a simple batch script that does the same task (gsl-config.bat), which is why Math::GSL builds against it.

      The build script for Math::GSL also looks for a pkg-config file but the alien's pkgconf dir needs to be in $ENV{PKG_CONFIG_PATH}.

      I assume this is all because the Math::GSL build script pre-dates the Alien ecosystem. It hand rolls much of the functionality the alien provides to find cflags, lib dirs and the like. Currently it just appends the Alien's bin dir to $ENV{PATH} when it is a share install (which also means the Alien will be ignored if there is another GSL install earlier in the path), and does not update $ENV{PKG_CONFIG_PATH} on Windows. Ideally it could be updated to use Alien::GSL directly.

      After adding the Alien::GSL pkgconfig dir to $ENV{PKG_CONFIG_PATH} the Build.PL script still uses the gsl-config.bat script first. Moving that out of the way and rerunning seems to work, except it then warns:

      Unsupported GSL version!!! : 2.7.1 at Build.PL line 85.

      So it looks like Math::GSL is not yet set up to work with GSL 2.7, or perhaps it is too conservative in the versions it permits. The list of currently supported versions is here, and I do see a number of 2.7 related issues on the GitHub issue tracker.

      This is about as far as I can get at the moment. I would suggest the OP file a bug report on the github issue tracker.

      assuming that works for you

      ouch... Shame on me to check this too late, but my test case (2) (i.e. install Math::GSL on non-PDL 5.32 SP) only "works" because there was 5.26 PDL-SP "installed" (i.e. system PATH modified) long time ago on test computer. Now I ran portableshell.bat with different portable perls, which just push their paths onto system PATH. Alien::GSL->version says 2.7.1 (shared), but Math::GSL::gsl_version says 2.3 i.e. it finds static lib from PDL-SP 5.26. If I fix the PATH, then installing Math::GSL fails for me, too.

      I think I'll write to Math::GSL queue. Looking at tester report, there's 1.07 Alien::GSL mentioned, but also 2.6 GSL, not 2.7. Which suggests they use "PDL edition"? Something is definitely messed up.

        If I fix the PATH, then installing Math::GSL fails for me, too

        If I set PKG_CONFIG_PATH env var to the location of the gsl.pc file:
        set PKG_CONFIG_PATH=D:\sp\_64\sp-5.32.1\perl\site\lib\auto\share\dist\ +Alien-GSL\lib\pkgconfig
        then I get a little bit further but it still fails because Build.PL inc/Ver2Func.pm doesn't cater for the possibility that the gsl library is at a version greater than 2.7. The build terminated with:
        .... Asking PkgConfig with ENV{PKG_CONFIG_PATH}=D:\sp\_64\sp-5.32.1\perl\si +te\lib\auto\share\dist\Alien-GSL\lib\pkgconfig:/usr/pkgconfig:/usr/li +b/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/pkgconfig:/usr/libdat +a/pkgconfig:/usr/local/libdata/pkgconfig:/opt/pkgconfig Checking if gcc supports "-Wall"...yes Checking if gcc supports "-Wno-sometimes-uninitialized"...yes Checking if gcc supports "-Wno-unused-function"...yes Checking if gcc supports "-Wno-unused-value"...yes Checking if gcc supports "-Wno-unused-function"...yes Checking if gcc supports "-Wno-unused-variable"...yes Checking if gcc supports "-Wno-gnu"...yes Checking if gcc supports "-g"...Unsupported GSL version!!! : 2.7.1 at +Build.PL line 85. yes -> N/A -> FAIL Configure failed for Math-GSL-0.43. See D:\sp\_64\sp-5.32.1\da +ta\.cpanm\work\1668033142.8832\build.log for details.
        So I changed the "2.7" => { to "2.7.1" => { in inc/Ver2Func.pm, installed the missing build prerequisites (Test::Class, Test::Most and Test::Taint) using cpanm, and built the damn thing manually by running perl Build.PL, perl Build test and perl build install.
        There were a few test failures:
        Test Summary Report ------------------- t\00-load.t (Wstat: 65280 Tests: 1 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t\Histogram.t (Wstat: 768 Tests: 43 Failed: 0) Non-zero exit status: 3 Parse errors: Bad plan. You planned 74 tests but ran 43. t\Histogram2D.t (Wstat: 768 Tests: 52 Failed: 0) Non-zero exit status: 3 Parse errors: Bad plan. You planned 89 tests but ran 52. t\Matrix.t (Wstat: 0 Tests: 290 Failed: 0) TODO passed: 235, 237-238 t\MatrixComplex.t (Wstat: 768 Tests: 28 Failed: 0) Non-zero exit status: 3 Parse errors: Bad plan. You planned 38 tests but ran 28. t\Multilarge.t (Wstat: 768 Tests: 2 Failed: 0) Non-zero exit status: 3 Parse errors: No plan found in TAP output t\Multiroots.t (Wstat: 768 Tests: 2 Failed: 0) Non-zero exit status: 3 Parse errors: Bad plan. You planned 11 tests but ran 2. t\Permutation.t (Wstat: 768 Tests: 11 Failed: 0) Non-zero exit status: 3 Parse errors: Bad plan. You planned 85 tests but ran 11. t\SF.t (Wstat: 768 Tests: 2 Failed: 0) Non-zero exit status: 3 Parse errors: No plan found in TAP output t\Vector.t (Wstat: 768 Tests: 29 Failed: 0) Non-zero exit status: 3 Parse errors: Bad plan. You planned 143 tests but ran 29. Files=58, Tests=2791, 42 wallclock secs ( 0.17 usr + 0.05 sys = 0.22 + CPU) Result: FAIL Failed 9/58 test programs. 0/2791 subtests failed.
        I note that Alien built and installed static libs (libgsl.a & libgslcblas.a) rather than the dll I was expecting. I don't know if that caused any problems. Running the following script:
        use strict; use warnings; use feature 'say'; use Alien::GSL; use Math::GSL; use Math::GSL::SparseMatrix ':all'; say join ' ', Alien::GSL->version, Alien::GSL->install_type; say Math::GSL::gsl_version(); my $m = gsl_spmatrix_alloc( 1, 1 ); die if gsl_spmatrix_set( $m, 0, 0, 1 ); say gsl_spmatrix_nnz( $m ); die if gsl_spmatrix_set( $m, 123 + 1 << 32, 0, 1 ); say gsl_spmatrix_nnz( $m ); die if gsl_spmatrix_set( $m, 456 + 1 << 32, 0, 1 ); say gsl_spmatrix_nnz( $m );
        produced:
        D:\s\Math-GSL-0.43>perl \pscrpt\math-gsl\try.pl 2.7.1 share 2.7 1 1 1
        Admittedly, my hack to inc/Ver2Func.pm was perhaps unrealistically hopeful ;-)
        The gsl-2.7.1 that Alien installed is definitely the only gsl library on this machine.

        I think I'll write to Math::GSL queue.

        Yes, I think that's an appropriate thing to do.
        Good luck with it.

        Cheers,
        Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11148063]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-23 18:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found