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


In reply to Re: Math::GSL Install Fail by bliako
in thread Math::GSL Install Fail by SifuSteve

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.