Won't install on Mac OS #19

Closed
cammonro opened this Issue Aug 17, 2011 · 11 comments

Comments

Projects
None yet
2 participants

I can't seem to successfully install any version of Math::GSL on the Mac. (Mac OS 10.6.8)

After installing Swig I get the following errors:

Building Math-GSL
Building wrappers for GSL 1.11
/opt/local/include/gsl/gsl_combination.h:71: Error: Syntax error in input(1).
error : No such file or directory while building ( -I/opt/local/include ) xs/Combination_wrap.1.11.c in pm/Math/GSL from 'swig/Combination.i' at inc/GSLBuilder.pm line 185.

Owner

leto commented Aug 20, 2011

Have you tried installing it from CPAN? Also, what does gsl-config --prefix and gsl-config --version say?

Hi Leto,

Thanks for the follow up. Yes I have tried installing directly from CPAN but with no success either. Here is the message I get from CPAN:

Building Math-GSL
i686-apple-darwin10-gcc-4.2.1: -bundle not allowed with -dynamiclib
error building blib/arch/auto/Math/GSL/BLAS/BLAS.bundle file from 'xs/BLAS_wrap.o' at inc/GSLBuilder.pm line 132.
LETO/Math-GSL-0.25.tar.gz
./Build -- NOT OK
Running Build test
Can't test without successful make
Running Build install
Make had returned bad status, install seems impossible
Failed during this command:
LETO/Math-GSL-0.25.tar.gz : make NO

Here is the output of gsl-config

$ gsl-config --version
1.11.90
$ gsl-config --prefix
/opt/local

Please let me know if any other information would be useful to help you troubleshoot.

Best,
Eric

On Aug 20, 2011, at 12:13 PM, leto wrote:

Have you tried installing it from CPAN? Also, what does gsl-config --prefix and gsl-config --version say?

Reply to this email directly or view it on GitHub:
#19 (comment)

Owner

leto commented Aug 22, 2011

The bug about -bundle was fixed here: 298e0db which has not yet been released (due to some other issues that we are working on) .

One hacky way to get you a working Math::GSL before the next one is released to CPAN is:

Download https://github.com/leto/math--gsl/commit/298e0db9514778be4eefbfc16e77dd23d24c8cf0.diff

Apply that to the 0.25 tarball , and then let me know what happens :)

The original error about /opt/local/include still baffles me. Does that directory exist? Does it have GSL headers in it? Do you have multiple versions of GSL installed ? Sometimes, when you have a system-wide GSL (perhaps from a package manager) and another hand-installed one, they will be installed in different paths, and then depending on shell variables different GSL's will be detected, and badness will ensue.

Good luck and let me know what happens.

Thanks for the patch. I applied the patch but am getting a new error right now when I attempt to build:

$ ./Build
Building Math-GSL
xs/BSpline_wrap.c: In function ‘_wrap_gsl_bspline_greville_abscissa’:
xs/BSpline_wrap.c:2905: warning: implicit declaration of function ‘gsl_bspline_greville_abscissa’
Undefined symbols:
"_gsl_bspline_greville_abscissa", referenced from:
__wrap_gsl_bspline_greville_abscissa in BSpline_wrap.o
(maybe you meant: __wrap_gsl_bspline_greville_abscissa)
ld: symbol(s) not found
collect2: ld returned 1 exit status
error building blib/arch/auto/Math/GSL/BSpline/BSpline.bundle file from 'xs/BSpline_wrap.o' at inc/GSLBuilder.pm line 132.

Does this yield any clues?

The directory /opt/local/include/gsl is definitely there along with all the GSL header files. I installed GSL via MacPorts - not sure if that makes a difference. I tried with both gsl and gsl-devel but not simultaneously (install is mutually exclusive).

-Eric

On Aug 22, 2011, at 11:59 AM, leto wrote:

The bug about -bundle was fixed here: 298e0db which has not yet been released (due to some other issues that we are working on) .

One hacky way to get you a working Math::GSL before the next one is released to CPAN is:

Download https://github.com/leto/math--gsl/commit/298e0db9514778be4eefbfc16e77dd23d24c8cf0.diff

Apply that to the 0.25 tarball , and then let me know what happens :)

The original error about /opt/local/include still baffles me. Does that directory exist? Does it have GSL headers in it? Do you have multiple versions of GSL installed ? Sometimes, when you have a system-wide GSL (perhaps from a package manager) and another hand-installed one, they will be installed in different paths, and then depending on shell variables different GSL's will be detected, and badness will ensue.

Good luck and let me know what happens.

Reply to this email directly or view it on GitHub:
#19 (comment)

Owner

leto commented Aug 22, 2011

Interesting. There is logic in Math::GSL to detect if you have a GSL >= 1.9, which is when bsplines were added, but perhaps it is wrong or there are more details to work out. I am not sure if I have ever tried Math::GSL against 1.11.90, and perhaps this bspline function was added in later. It gets to be a real mess figuring out exactly which functions were available is different GSL versions. Recent commits (not included in 0.25) by @tadam make the situation much better by building a bunch of different version-specific bindings and choosing between them when we compile. Those might alleviate this issue.

Is there any way you can install a more recent version of GSL? I currently develop against 1.14, so that has a much better chance of working. 1.15, the latest, should work well too.

Owner

leto commented Aug 22, 2011

Also, can you verify that gsl-config --version matches the version in /opt/local/include/gsl/gsl_version.h ?

Well I went and compiled GSL from source (latest version 1.15) after uninstalling the MacPorts GSL libs. That was successful.

Installing Math::GSL is still a no-go.

CPAN refused to recognize the GSL lib even despite me setting the $PKG_CONFIG_PATH variable:

$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
$ echo $PKG_CONFIG_PATH
:/usr/local/lib/pkgconfig

$ sudo cpan install Math::GSL
CPAN: File::HomeDir loaded ok (v0.97)
CPAN: Storable loaded ok (v2.20)
Going to read '/Users/eric/.cpan/Metadata'
Database was generated on Mon, 22 Aug 2011 01:33:37 GMT
Running install for module 'Math::GSL'
Running make for L/LE/LETO/Math-GSL-0.25.tar.gz
CPAN: Digest::SHA loaded ok (v5.47)
CPAN: Compress::Zlib loaded ok (v2.02)
Checksum for /Users/eric/.cpan/sources/authors/id/L/LE/LETO/Math-GSL-0.25.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.52)
… blah blah blah ...

CPAN.pm: Going to build L/LE/LETO/Math-GSL-0.25.tar.gz

Checking for GSL..Package gsl was not found in the pkg-config search path.
Perhaps you should add the directory containing `gsl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gsl' found
at Build.PL line 108
*** can not find package gsl
*** check that it is properly installed and available in PKG_CONFIG_PATH
at Build.PL line 108
Warning: No success on command[/usr/local/bin/perl Build.PL ]
LETO/Math-GSL-0.25.tar.gz
/usr/local/bin/perl Build.PL -- NOT OK
Running Build test
Make had some problems, won't test
Running Build install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites

When I tried building from source the configure script recognized GSL:

$ perl Build.PL
Checking for GSL..Found GSL version 1.15…

But does not build:

$ ./Build
Building Math-GSL
xs/Multiroots_wrap.c: In function ‘_wrap_gsl_multiroot_fdjacobian’:
xs/Multiroots_wrap.c:2339: warning: assignment from incompatible pointer type
xs/Multiroots_wrap.c: In function ‘_wrap_gsl_multiroot_fsolver_function_set’:
xs/Multiroots_wrap.c:2902: warning: assignment from incompatible pointer type
xs/Multiroots_wrap.c: In function ‘_wrap_gsl_multiroot_fsolver_set’:
xs/Multiroots_wrap.c:3337: warning: assignment from incompatible pointer type
xs/Roots_wrap.c:3213:23: warning: character constant too long for its type
xs/Roots_wrap.c: In function ‘_wrap_gsl_root_fdfsolver_fdf_set’:
xs/Roots_wrap.c:3213: warning: passing argument 2 of ‘fprintf’ makes pointer from integer without a cast
xs/Roots_wrap.c:3213: warning: format not a string literal and no format arguments
xs/Roots_wrap.c:3214: warning: ‘return’ with a value, in function returning void
xs/Roots_wrap.c:3776:23: warning: character constant too long for its type
xs/Roots_wrap.c: In function ‘_wrap_gsl_root_fdfsolver_set’:
xs/Roots_wrap.c:3776: warning: passing argument 2 of ‘fprintf’ makes pointer from integer without a cast
xs/Roots_wrap.c:3776: warning: format not a string literal and no format arguments
xs/Roots_wrap.c:3777: warning: ‘return’ with a value, in function returning void

I did compare versions in the header files and they do match with gsl-config --version.

Do you think I'm doing something wrong here with the installation?

On Aug 22, 2011, at 1:38 PM, leto wrote:

Interesting. There is logic in Math::GSL to detect if you have a GSL >= 1.9, which is when bsplines were added, but perhaps it is wrong or there are more details to work out. I am not sure if I have ever tried Math::GSL against 1.11.90, and perhaps this bspline function was added in later. It gets to be a real mess figuring out exactly which functions were available is different GSL versions. Recent commits (not included in 0.25) by @tadam make the situation much better by building a bunch of different version-specific bindings and choosing between them when we compile. Those might alleviate this issue.

Is there any way you can install a more recent version of GSL? I currently develop against 1.14, so that has a much better chance of working. 1.15, the latest, should work well too.

Reply to this email directly or view it on GitHub:
#19 (comment)

Owner

leto commented Aug 22, 2011

The issue, i think, is that you are setting PKG_CONFIG_PATH as your
user, but then sudo'ing to root. You could set up the variable for
root, but I highly suggest spending a few minutes learning and
installing local::lib. But whatever floats your boat.

On Mon, Aug 22, 2011 at 1:14 PM, cammonro
reply@reply.github.com
wrote:

Well I went and compiled GSL from source (latest version 1.15) after uninstalling the MacPorts GSL libs. That was successful.

Installing Math::GSL is still a no-go.

CPAN refused to recognize the GSL lib even despite me setting the $PKG_CONFIG_PATH variable:

$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
$ echo $PKG_CONFIG_PATH
:/usr/local/lib/pkgconfig

$ sudo cpan install Math::GSL
CPAN: File::HomeDir loaded ok (v0.97)
CPAN: Storable loaded ok (v2.20)
Going to read '/Users/eric/.cpan/Metadata'
 Database was generated on Mon, 22 Aug 2011 01:33:37 GMT
Running install for module 'Math::GSL'
Running make for L/LE/LETO/Math-GSL-0.25.tar.gz
CPAN: Digest::SHA loaded ok (v5.47)
CPAN: Compress::Zlib loaded ok (v2.02)
Checksum for /Users/eric/.cpan/sources/authors/id/L/LE/LETO/Math-GSL-0.25.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.52)
… blah blah blah ...

 CPAN.pm: Going to build L/LE/LETO/Math-GSL-0.25.tar.gz

Checking for GSL..Package gsl was not found in the pkg-config search path.
Perhaps you should add the directory containing `gsl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gsl' found
 at Build.PL line 108
*** can not find package gsl
*** check that it is properly installed and available in PKG_CONFIG_PATH
 at Build.PL line 108
Warning: No success on command[/usr/local/bin/perl Build.PL ]
 LETO/Math-GSL-0.25.tar.gz
 /usr/local/bin/perl Build.PL  -- NOT OK
Running Build test
 Make had some problems, won't test
Running Build install
 Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites

When I tried building from source the configure script recognized GSL:

$ perl Build.PL
Checking for GSL..Found GSL version 1.15…

But does not build:

$ ./Build
Building Math-GSL
xs/Multiroots_wrap.c: In function ‘_wrap_gsl_multiroot_fdjacobian’:
xs/Multiroots_wrap.c:2339: warning: assignment from incompatible pointer type
xs/Multiroots_wrap.c: In function ‘_wrap_gsl_multiroot_fsolver_function_set’:
xs/Multiroots_wrap.c:2902: warning: assignment from incompatible pointer type
xs/Multiroots_wrap.c: In function ‘_wrap_gsl_multiroot_fsolver_set’:
xs/Multiroots_wrap.c:3337: warning: assignment from incompatible pointer type
xs/Roots_wrap.c:3213:23: warning: character constant too long for its type
xs/Roots_wrap.c: In function ‘_wrap_gsl_root_fdfsolver_fdf_set’:
xs/Roots_wrap.c:3213: warning: passing argument 2 of ‘fprintf’ makes pointer from integer without a cast
xs/Roots_wrap.c:3213: warning: format not a string literal and no format arguments
xs/Roots_wrap.c:3214: warning: ‘return’ with a value, in function returning void
xs/Roots_wrap.c:3776:23: warning: character constant too long for its type
xs/Roots_wrap.c: In function ‘_wrap_gsl_root_fdfsolver_set’:
xs/Roots_wrap.c:3776: warning: passing argument 2 of ‘fprintf’ makes pointer from integer without a cast
xs/Roots_wrap.c:3776: warning: format not a string literal and no format arguments
xs/Roots_wrap.c:3777: warning: ‘return’ with a value, in function returning void

I did compare versions in the header files and they do match with gsl-config --version.

Do you think I'm doing something wrong here with the installation?

On Aug 22, 2011, at 1:38 PM, leto wrote:

Interesting. There is logic in Math::GSL to detect if you have a GSL >= 1.9, which is when bsplines were added, but perhaps it is wrong or there are more details to work out. I am not sure if I have ever tried Math::GSL against 1.11.90, and perhaps this bspline function was added in later. It gets to be a real mess figuring out exactly which functions were available is different GSL versions. Recent commits (not included in 0.25) by @tadam make the situation much better by building a bunch of different version-specific bindings and choosing between them when we compile. Those might alleviate this issue.

Is there any way you can install a more recent version of GSL? I currently develop against 1.14, so that has a much better chance of working. 1.15, the latest, should work well too.

Reply to this email directly or view it on GitHub:
#19 (comment)

Reply to this email directly or view it on GitHub:
#19 (comment)

Jonathan "Duke" Leto jonathan@leto.net
Leto Labs LLC
209.691.DUKE // http://labs.leto.net
NOTE: Personal email is only checked twice a day at 10am/2pm PST,
please call/text for time-sensitive matters.

I thought that might be the case but when I su into root I can see the variable via 'env'.

Thanks for the tip. I will look into local::lib although I've never run into this issue before.

However, any feedback on why the build from source outside of CPAN would fail as well?

Thanks again for your help.

On Aug 22, 2011, at 4:22 PM, leto wrote:

The issue, i think, is that you are setting PKG_CONFIG_PATH as your
user, but then sudo'ing to root. You could set up the variable for
root, but I highly suggest spending a few minutes learning and
installing local::lib. But whatever floats your boat.

On Mon, Aug 22, 2011 at 1:14 PM, cammonro
reply@reply.github.com
wrote:

Well I went and compiled GSL from source (latest version 1.15) after uninstalling the MacPorts GSL libs. That was successful.

Installing Math::GSL is still a no-go.

CPAN refused to recognize the GSL lib even despite me setting the $PKG_CONFIG_PATH variable:

$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
$ echo $PKG_CONFIG_PATH
:/usr/local/lib/pkgconfig

$ sudo cpan install Math::GSL
CPAN: File::HomeDir loaded ok (v0.97)
CPAN: Storable loaded ok (v2.20)
Going to read '/Users/eric/.cpan/Metadata'
Database was generated on Mon, 22 Aug 2011 01:33:37 GMT
Running install for module 'Math::GSL'
Running make for L/LE/LETO/Math-GSL-0.25.tar.gz
CPAN: Digest::SHA loaded ok (v5.47)
CPAN: Compress::Zlib loaded ok (v2.02)
Checksum for /Users/eric/.cpan/sources/authors/id/L/LE/LETO/Math-GSL-0.25.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.52)
… blah blah blah ...

CPAN.pm: Going to build L/LE/LETO/Math-GSL-0.25.tar.gz

Checking for GSL..Package gsl was not found in the pkg-config search path.
Perhaps you should add the directory containing `gsl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gsl' found
at Build.PL line 108
*** can not find package gsl
*** check that it is properly installed and available in PKG_CONFIG_PATH
at Build.PL line 108
Warning: No success on command[/usr/local/bin/perl Build.PL ]
LETO/Math-GSL-0.25.tar.gz
/usr/local/bin/perl Build.PL -- NOT OK
Running Build test
Make had some problems, won't test
Running Build install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites

When I tried building from source the configure script recognized GSL:

$ perl Build.PL
Checking for GSL..Found GSL version 1.15…

But does not build:

$ ./Build
Building Math-GSL
xs/Multiroots_wrap.c: In function ‘_wrap_gsl_multiroot_fdjacobian’:
xs/Multiroots_wrap.c:2339: warning: assignment from incompatible pointer type
xs/Multiroots_wrap.c: In function ‘_wrap_gsl_multiroot_fsolver_function_set’:
xs/Multiroots_wrap.c:2902: warning: assignment from incompatible pointer type
xs/Multiroots_wrap.c: In function ‘_wrap_gsl_multiroot_fsolver_set’:
xs/Multiroots_wrap.c:3337: warning: assignment from incompatible pointer type
xs/Roots_wrap.c:3213:23: warning: character constant too long for its type
xs/Roots_wrap.c: In function ‘_wrap_gsl_root_fdfsolver_fdf_set’:
xs/Roots_wrap.c:3213: warning: passing argument 2 of ‘fprintf’ makes pointer from integer without a cast
xs/Roots_wrap.c:3213: warning: format not a string literal and no format arguments
xs/Roots_wrap.c:3214: warning: ‘return’ with a value, in function returning void
xs/Roots_wrap.c:3776:23: warning: character constant too long for its type
xs/Roots_wrap.c: In function ‘_wrap_gsl_root_fdfsolver_set’:
xs/Roots_wrap.c:3776: warning: passing argument 2 of ‘fprintf’ makes pointer from integer without a cast
xs/Roots_wrap.c:3776: warning: format not a string literal and no format arguments
xs/Roots_wrap.c:3777: warning: ‘return’ with a value, in function returning void

I did compare versions in the header files and they do match with gsl-config --version.

Do you think I'm doing something wrong here with the installation?

On Aug 22, 2011, at 1:38 PM, leto wrote:

Interesting. There is logic in Math::GSL to detect if you have a GSL >= 1.9, which is when bsplines were added, but perhaps it is wrong or there are more details to work out. I am not sure if I have ever tried Math::GSL against 1.11.90, and perhaps this bspline function was added in later. It gets to be a real mess figuring out exactly which functions were available is different GSL versions. Recent commits (not included in 0.25) by @tadam make the situation much better by building a bunch of different version-specific bindings and choosing between them when we compile. Those might alleviate this issue.

Is there any way you can install a more recent version of GSL? I currently develop against 1.14, so that has a much better chance of working. 1.15, the latest, should work well too.

Reply to this email directly or view it on GitHub:
#19 (comment)

Reply to this email directly or view it on GitHub:
#19 (comment)

Jonathan "Duke" Leto jonathan@leto.net
Leto Labs LLC
209.691.DUKE // http://labs.leto.net
NOTE: Personal email is only checked twice a day at 10am/2pm PST,
please call/text for time-sensitive matters.

Reply to this email directly or view it on GitHub:
#19 (comment)

Owner

leto commented Sep 17, 2011

I just uploaded Math::GSL 0.26 to CPAN. Please try that and open up a new issue if that doesn't work for you.

@leto leto closed this Sep 17, 2011

Hi Jonathan,

Sorry for just getting back to you. I tried the new version 0.26 and it
installed without a hitch. Thanks for this update!

Much obliged.

Best regards,
Eric

On Sat, Sep 17, 2011 at 1:05 PM, Jonathan Duke Leto <
reply@reply.github.com>wrote:

I just uploaded Math::GSL 0.26 to CPAN. Please try that and open up a new
issue if that doesn't work for you.

Reply to this email directly or view it on GitHub:
#19 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment