PerlAlien / Alien-GSL

This module is meant to ease the install of the Gnu Scientific Library (GSL). It also provides version checking and build flags via the gsl-config utility.
https://metacpan.org/pod/Alien::GSL
6 stars 3 forks source link

Option to build shared libraries with Alien::GSL (static libraries does not work with Math::GSL) #17

Open hakonhagland opened 3 years ago

hakonhagland commented 3 years ago

Unfortunately Math::GSL cannot use a static libgsl.a, see https://github.com/leto/math--gsl/issues/225 and this bug report. This is because Math::GSL is building more than one XS module, and each module depends on libgsl.a and libgsl.a maintains static variables. These static variables will get duplicated when linking statically with libgsl.a and cause undefined behavior when the XS modules are combined in a Perl script.

I think this is only a problem for Math::GSL so I wonder if we should provide an option to Alien::GSL to build a shared library (libgsl.so) when doing a shared install? For example something like: use Alien::GSL qw(:shared) would force building a shared library?

What do you think?

hakonhagland commented 5 months ago

Unfortunately Math::GSL cannot use a static libgsl.a

I discovered that @sisyphus has reported the same issue 16 years ago, see: https://rt.cpan.org/Ticket/Display.html?id=38574