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

Because the package Math::GSL has not been updated for using gsl-2.

Thus, I installed gsl-1 in addition and I compile Math:GSL. Now, I have my own perl applications which use gsl and Math:GSL, I am trying to have only gsl-1 used.

Hence, in my Makefile.PL, I set:

LIBS => ["-lm -L$ENV{GSL_LIB} -lgsl"],

When I make perl Makefile.PL, a Makefile is generated with:

EXTRALIBS = -L/usr/local/gsl-1/lib -lgsl LDLOADLIBS = -lm -L/usr/local/gsl-1/lib -lgsl LD_RUN_PATH = /usr/local/gsl-1/lib

I though it was OK, but when I run make, a new Makefile is generated without the LIBS correct, ie.:

EXTRALIBS = -lgsl LDLOADLIBS = -lm -lgsl LD_RUN_PATH = /usr/lib

Why such a behavior ?

How can I control it ?

Thank

Patrick Dupre

Replies are listed 'Best First'.
Re: library management in XS
by kcott (Archbishop) on Aug 06, 2016 at 12:23 UTC

    G'day Patrick,

    I suspect that the '-', in '/usr/local/gsl-1/lib', may be the cause of the problem. It's a special character in many places, and may be interpreted as such elsewhere.

    [See how EXTRALIBS and LDLOADLIBS are missing the -L/usr/local/gsl-1/lib part, but otherwise follow your assignments. LD_RUN_PATH, with perhaps no effective assignment, might have retained its previous value or been assigned a default, i.e. /usr/lib.]

    Some things to try: escape the dash; quote the path; create a symlink.

    — Ken

Re: library management in XS
by Laurent_R (Canon) on Aug 05, 2016 at 16:51 UTC

      This does not really help because

      exec 'env', $^X, $0, @ARGV ;

      does not work on my machine

      Patrick Dupre
Re: library management in XS ( Math::GSL )
by Anonymous Monk on Aug 05, 2016 at 17:24 UTC

    Math::GSL doesn't use a Makefile.PL

    What are you talking about?

      I am talking about my own applications using both Math:GSL and gsl

      Patrick Dupre

        Ok,

        Regular ExtUtils::MakeMaker will not edit/update/modify the generated Makefile when you run "make"

        If this is what happens then its a bug, either in MakeMaker or your Makefile.PL

        I suggest you try that again with the very latest version of ExtUtils::MakeMaker,

        and post some code, maybe a minimal example like SOso-0.01.patch.txt