Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: John Crow
RE: rb-gsl on Leopard [ reply ]  
2008-11-25 02:15
As a data point, I've had luck with a variant of Rok's & Dave's solution. I downloaded gsl and installed it with --prefix=/usr/local. That went just fine.

I grabbed rb-gsl-1.10.3, untarred it, the cd'd into the new directory. First I ran "ruby setup.rb config" which created the makefile ext/Makefile. I edited two lines in the makefile; ended up looking like this:

DLDFLAGS = -L.
LDSHARED = $(CC) -pipe -bundle -undefined dynamic_lookup

This took care of the arch=ppc craziness. After this, I finished the sequence:

$ ruby setup.rb setup
$ sudo ruby setup.rb install

Life was good. If you get this far, dive down into the examples directory, pick one and check it out. Since the configuration step found my include and lib directories under /usr/local, things went well.


By: Christopher Small
RE: rb-gsl working on Leopard (10.5.2) [ reply ]  
2008-06-08 07:37
Haha! I should have poked around a bit longer before I asked for help again - turns out, the directory I needed to cd to in your step 2 was

opt/local/var/macports/sources/rsync.macports.org/ release/ports/math/gsl

I just had to do some snooping around to find it - curious that it was in a different place, but I went through the rest of the instructions and everything seems to have gone fine. I haven't tried using it yet, but all looks well.

Thanks!

-Chris

By: Rok Sribar
RE: rb-gsl working on Leopard (10.5.2) [ reply ]  
2008-06-07 09:12
Chris,

BTW, /etc is a directory inside the root directory, also denoted with /

As for the installation ... well, the steps I've mentioned in my earlier email worked for me and for David.

If you're new to this stuff and if you've failed with installation attempts so far, you may be better off starting with a clean install.

Good luck!

Rok

By: Christopher Small
RE: rb-gsl working on Leopard (10.5.2) [ reply ]  
2008-06-07 03:50
Hi there,

Rok,

I'm a little uncertain as to what the "/etc/profile" location is - I imagine that by "etc" you mean 'fill in the appropriate path', but I'm not sure. I also figured (for some reason - not sure exactly) that the profile directory would be in my ~ dir, but that is not the case. What I was able to do was install the macports using the installer, and alter my .bash_login file so that it reads

[code]
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:$PATH"
export DYLD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/ruby/site_ruby/1.8/universal-darwin8.0/:/opt/local/lib
export MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man:/opt/local/share/man
[/code]

as per a combination of your suggestion and David Bean's (via an email). I then ran

[code]
source .bash_login
[/code]

from my ~ dir and it seems to have loaded the vars judging by what I get by running [code] env [/code]. However, I have an issues - When I run the first line in your step 2, I get "no such file or directory" from the terminal (The only "opt" directories I could find were in / and a subversion directory - I ran from the former). Can anyone tell why this isn't working for me?

One thing I should mention (I don't know if it makes any difference) is that I rolled my own ruby/rails in my /usr/local/src directory as per hivelogic's suggestion. Could this be affecting my results, and is it likely to down the road?

Thanks for all the help!

Chris

By: David Bean
RE: rb-gsl working on Leopard (10.5.2) [ reply ]  
2008-06-07 01:13
Rok,

Yep - I'm all good. Macports was the trick...I just couldn't get things to work by building each part myself. Thanks!

By: Rok Sribar
RE: rb-gsl working on Leopard (10.5.2) [ reply ]  
2008-06-07 00:48
Christopher,

I've added the following PATH variable to the file "/etc/profile" based in part on info at http://guide.macports.org/#installing.shell

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/opt/local/sbin
export MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man:/opt/local/share/man

I hope that helps.

Rok

PS.
David Bean ... is your install of rb-gsl working?

By: Christopher Small
RE: rb-gsl working on Leopard (10.5.2) [ reply ]  
2008-06-06 01:39
Can anyone help me out with Rok's step 1.1? I'm a newbie and have no idea how or where you would add macports to my "PATH variable", nor am I sure what "PATH variable" is in this context. Is this a Ruby thing or a system thing?

Thanks for your time.

By: David Bean
RE: rb-gsl working on Leopard (10.5.2) [ reply ]  
2008-06-03 20:29
whoops - one other step:

I also had to tell dyld where to look for the new libraries:

DYLD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/ruby/site_ruby/1.8/universal-darwin8.0/:/opt/local/lib

By: David Bean
RE: rb-gsl working on Leopard (10.5.2) [ reply ]  
2008-06-03 19:58
All,

I've had the same problems that many have mentioned here, and I just got past 'em. For what it's worth, here's what I had to do:

1. I took Rok's advice and installed MacPorts.
2. I used MacPorts to install gsl, plotutils, and rb-gsl...in that order.
3. After that, I'd get a linking error:

dyld: NSLinkModule() error
dyld: Symbol not found: _gsl_linalg_hessenberg_decomp
Referenced from: /usr/local/lib/ruby/site_ruby/1.8/universal-darwin8.0/rb_gsl.bundle
Expected in: flat namespace

Trace/BPT trap

I had an older libgsl sitting in /usr/local/lib, probably from one of my earlier attempts at building things myself. But, MacPorts had put the new lib in /opt/local/lib. I deleted libgsl.* from /usr/local/lib, and now everything works just dandy.

Whew.

By: Rok Sribar
RE: rb-gsl working on Leopard (10.5.2) [ reply ]  
2008-03-15 23:43
I've made rb-gsl work on Leopard (10.5.2) using Apple's distribution of ruby and Macports.

Step 1) Install Macports release 1.6.0 from (http://www.macports.org/)

Step 1.1) Added Macports path to your PATH variable, with source ~/.profile ... where, the content of .profile is:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH

Step 2) Install GSL with the following sequence:
# % cd opt/local/var/sources/rsync.macports.org/ release/ports/math/gsl
# % sudo port install gsl
# Password:

3) Installed GNU plotutils with the following sequence:
# % cd opt/local/var/sources/rsync.macports.org/ release/ports/graphics/plotutils
# % sudo port install plotutils
# Password:

Step 4) Download rb-gsl from: http://rb-gsl.rubyforge.org/
and copy rb-gsl-x.xx.x folder to:
/Library/Ruby/Gems/1.8/gems/

Step 5) Install rb-gsl by following instructions at http://rb-gsl.rubyforge.org/ or
# % cd /Library/Ruby/Gems/1.8/gems/rb-gsl-1.10.3/
# % ruby setup.rb config
# % ruby setup.rb setup
# % sudo ruby setup.rb install
# Password:

-- DONE --

Notes:
a) Ports are written well and download all the necessary dependencies.
b) My ruby installation was as is from Apple's distribution with few additional added and updated gems.

Good luck!

By: Rok Sribar
rb-gsl on Leopard [ reply ]  
2008-03-13 06:42
Has any one figured out how to make rb-gsl work on Leopard?

I installed MacPorts today and was able to install for example rb-zip, but not rb-gsl.

This is what I get:

%% sudo port install rb-gsl

---> Building rb-gsl with target setup
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-gsl/work/rb-gsl-1.6.3" && /opt/local/bin/ruby -rvendor-specific setup.rb setup " returned error 1
Command output: make
/usr/bin/gcc-4.0 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin9.2.0 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-gsl/work/rb-gsl-1.6.3/ext -DHAVE_ROUND -I/opt/local/lib/ruby/site_ruby/1.8/i686-darwin9.2.0 -I/opt/local/include -fno-common -I../include -I/opt/local/include -c min.c
min.c:128: error: static declaration of 'gsl_min_fminimizer_x_minimum' follows non-static declaration
/opt/local/include/gsl/gsl_min.h:79: error: previous declaration of 'gsl_min_fminimizer_x_minimum' was here
min.c: In function 'gsl_min_fminimizer_x_minimum':
min.c:130: error: 'struct <anonymous>' has no member named 'minimum'
min.c: At top level:
min.c:134: error: static declaration of 'gsl_min_fminimizer_f_minimum' follows non-static declaration
/opt/local/include/gsl/gsl_min.h:82: error: previous declaration of 'gsl_min_fminimizer_f_minimum' was here
min.c:139: error: static declaration of 'gsl_min_fminimizer_f_lower' follows non-static declaration
/opt/local/include/gsl/gsl_min.h:83: error: previous declaration of 'gsl_min_fminimizer_f_lower' was here
min.c:144: error: static declaration of 'gsl_min_fminimizer_f_upper' follows non-static declaration
/opt/local/include/gsl/gsl_min.h:84: error: previous declaration of 'gsl_min_fminimizer_f_upper' was here
make: *** [min.o] Error 1
setup.rb:535:in `command': 'system make ' failed (RuntimeError)
from setup.rb:543:in `make'
from setup.rb:1156:in `setup_dir_ext'
from setup.rb:1321:in `__send__'
from setup.rb:1321:in `traverse'
from setup.rb:1338:in `dive_into'
from setup.rb:1319:in `traverse'
from setup.rb:1313:in `exec_task_traverse'
from setup.rb:1308:in `each'
from setup.rb:1308:in `exec_task_traverse'
from setup.rb:1123:in `exec_setup'
from setup.rb:883:in `exec_setup'
from setup.rb:710:in `__send__'
from setup.rb:710:in `invoke'
from setup.rb:674:in `invoke'
from setup.rb:1352

Error: Status 1 encountered during processing.

By: Matt Foster
RE: Building on OS X Leopard [ reply ]  
2008-02-03 13:46
Did you manage to get anywhere with this? I'm having the same problems described below.

Cheers,

Matt

By: Chase Southard
RE: Building on OS X Leopard [ reply ]  
2007-12-12 15:09
Never mind. GSL compiled fine. Still no luck, however, with rb-gsl.

By: Chase Southard
RE: Building on OS X Leopard [ reply ]  
2007-12-05 21:04
I'd like to get GSL and rb-gsl running, but I have yet to compile GSL. Any suggestions for what options and flags to set for the compliation of GSL itself from GNU source on an Intel C2D Mac running Leopard?

Thanks.

By: Paolo Bosetti
RE: Building on OS X Leopard [ reply ]  
2007-12-05 14:13
As a quickfix, I'm doing like that: I use a rb-gsl.bundle compiled as a universal binary under OS X 10.4 copied as-is on Leopard. It works fine with the GSL library as compiled under Leopard from MacPorts.


By: Joel Dudley
RE: Building on OS X Leopard [ reply ]  
2007-12-05 14:08
Has anyone figured this one out? Not being able to use rb-gsl in Leopard is killing me. I'm running a Linux Virtual Machine inside OS X to continue my work, but it's quite annoying. Even if I remove the references to i386 (which is counter-intuitive since I'm on an intel Mac), I get the following:

Undefined symbol:
"_na_change_type", referenced from:

I'm using the latest versions of rb-gsl and GSL. GSL itself compiled without a hitch, and I'm using the source from GNU, not from MacPorts.

By: Paolo Bosetti
RE: Building on OS X Leopard [ reply ]  
2007-11-14 15:32
If I remove the "-arch i386" flag it compiles and links successfully, providing a "rb_gsl.bundle" library. Anyway, since I'm on a i386 architecture, it is useless for me.
Of course I've already tried to remove the "-arch ppc" flag instead, but in this case it does not link.
It is strange, because before the Leopard upgrade I was able to compile rb-gsl as smooth as silk...
Any suggestion?
Thanks!

By: Yoshiki Tsunesada
RE: Building on OS X Leopard [ reply ]  
2007-11-14 12:08
How about editting ext/Makefile to remove "-arch i386" before setup?

By: Paolo Bosetti
Building on OS X Leopard [ reply ]  
2007-11-14 11:59
Hi,
is there someone that could build rb-gsl under Leopard?
I'm using the latest gsl library (1.10) and the latest rb-gsl (1.10.2), using the system C compiler on a MacBook Pro (Intel).
The ruby setup.rb setup fails during the linking phase, and complaining about wrong architectures and missing symbols:

gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I/Users/isil/src/rb-gsl-1.10.2/ext -DHAVE_NARRAY_H -I/Library/Ruby/Site/1.8/universal-darwin9.0 -fno-common -Wall -I../include -I/opt/local/include -c vector_int.c
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I/Users/isil/src/rb-gsl-1.10.2/ext -DHAVE_NARRAY_H -I/Library/Ruby/Site/1.8/universal-darwin9.0 -fno-common -Wall -I../include -I/opt/local/include -c wavelet.c
cc -arch ppc -arch i386 -pipe -bundle -o rb_gsl.bundle array.o array_complex.o blas.o blas1.o blas2.o blas3.o block.o bspline.o bundle.o cdf.o cheb.o combination.o common.o complex.o const.o const_additional.o cqp.o deriv.o dht.o diff.o dirac.o eigen.o error.o fcmp.o fft.o fit.o fresnel.o function.o graph.o gsl.o gsl_narray.o histogram.o histogram2d.o histogram3d.o histogram3d_source.o histogram_find.o histogram_oper.o ieee.o integration.o interp.o jacobi.o linalg.o linalg_complex.o math.o matrix.o matrix_complex.o matrix_double.o matrix_int.o min.o monte.o multifit.o multimin.o multimin_fsdf.o multiroots.o ndlinear.o ntuple.o odeiv.o ool.o oper_complex_source.o permutation.o poly.o poly2.o qrng.o randist.o rational.o rng.o root.o sf.o sf_airy.o sf_bessel.o sf_clausen.o sf_coulomb.o sf_coupling.o sf_dawson.o sf_debye.o sf_dilog.o sf_elementary.o sf_ellint.o sf_elljac.o sf_erfc.o sf_exp.o sf_expint.o sf_fermi_dirac.o sf_gamma.o sf_gegenbauer.o sf_hyperg.o sf_laguerre.o sf_lambert.o sf_legendre.o sf_log.o sf_mathieu.o sf_power.o sf_psi.o sf_synchrotron.o sf_transport.o sf_trigonometric.o sf_zeta.o signal.o siman.o sort.o spline.o stats.o sum.o tamu_anova.o tensor.o vector.o vector_complex.o vector_double.o vector_int.o wavelet.o -L"." -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L"/Library/Ruby/Site/1.8/universal-darwin9.0" -L. -arch ppc -arch i386 -L/opt/local/lib -lgsl -lcblas -latlas -lm -lruby -latlas -lcblas -lpthread -ldl -lm
ld: warning in array.o, file is not of required architecture
ld: warning in array_complex.o, file is not of required architecture
ld: warning in blas.o, file is not of required architecture
ld: warning in blas1.o, file is not of required architecture
ld: warning in blas2.o, file is not of required architecture
ld: warning in blas3.o, file is not of required architecture
ld: warning in block.o, file is not of required architecture
ld: warning in bspline.o, file is not of required architecture
ld: warning in bundle.o, file is not of required architecture
ld: warning in cdf.o, file is not of required architecture
ld: warning in cheb.o, file is not of required architecture
ld: warning in combination.o, file is not of required architecture
ld: warning in common.o, file is not of required architecture
ld: warning in complex.o, file is not of required architecture
ld: warning in const.o, file is not of required architecture
ld: warning in const_additional.o, file is not of required architecture
ld: warning in cqp.o, file is not of required architecture
ld: warning in deriv.o, file is not of required architecture
ld: warning in dht.o, file is not of required architecture
ld: warning in diff.o, file is not of required architecture
ld: warning in dirac.o, file is not of required architecture
ld: warning in eigen.o, file is not of required architecture
ld: warning in error.o, file is not of required architecture
ld: warning in fcmp.o, file is not of required architecture
ld: warning in fft.o, file is not of required architecture
ld: warning in fit.o, file is not of required architecture
ld: warning in fresnel.o, file is not of required architecture
ld: warning in function.o, file is not of required architecture
ld: warning in graph.o, file is not of required architecture
ld: warning in gsl.o, file is not of required architecture
ld: warning in gsl_narray.o, file is not of required architecture
ld: warning in histogram.o, file is not of required architecture
ld: warning in histogram2d.o, file is not of required architecture
ld: warning in histogram3d.o, file is not of required architecture
ld: warning in histogram3d_source.o, file is not of required architecture
ld: warning in histogram_find.o, file is not of required architecture
ld: warning in histogram_oper.o, file is not of required architecture
ld: warning in ieee.o, file is not of required architecture
ld: warning in integration.o, file is not of required architecture
ld: warning in interp.o, file is not of required architecture
ld: warning in jacobi.o, file is not of required architecture
ld: warning in linalg.o, file is not of required architecture
ld: warning in linalg_complex.o, file is not of required architecture
ld: warning in math.o, file is not of required architecture
ld: warning in matrix.o, file is not of required architecture
ld: warning in matrix_complex.o, file is not of required architecture
ld: warning in matrix_double.o, file is not of required architecture
ld: warning in matrix_int.o, file is not of required architecture
ld: warning in min.o, file is not of required architecture
ld: warning in monte.o, file is not of required architecture
ld: warning in multifit.o, file is not of required architecture
ld: warning in multimin.o, file is not of required architecture
ld: warning in multimin_fsdf.o, file is not of required architecture
ld: warning in multiroots.o, file is not of required architecture
ld: warning in ndlinear.o, file is not of required architecture
ld: warning in ntuple.o, file is not of required architecture
ld: warning in odeiv.o, file is not of required architecture
ld: warning in ool.o, file is not of required architecture
ld: warning in oper_complex_source.o, file is not of required architecture
ld: warning in permutation.o, file is not of required architecture
ld: warning in poly.o, file is not of required architecture
ld: warning in poly2.o, file is not of required architecture
ld: warning in qrng.o, file is not of required architecture
ld: warning in randist.o, file is not of required architecture
ld: warning in rational.o, file is not of required architecture
ld: warning in rng.o, file is not of required architecture
ld: warning in root.o, file is not of required architecture
ld: warning in sf.o, file is not of required architecture
ld: warning in sf_airy.o, file is not of required architecture
ld: warning in sf_bessel.o, file is not of required architecture
ld: warning in sf_clausen.o, file is not of required architecture
ld: warning in sf_coulomb.o, file is not of required architecture
ld: warning in sf_coupling.o, file is not of required architecture
ld: warning in sf_dawson.o, file is not of required architecture
ld: warning in sf_debye.o, file is not of required architecture
ld: warning in sf_dilog.o, file is not of required architecture
ld: warning in sf_elementary.o, file is not of required architecture
ld: warning in sf_ellint.o, file is not of required architecture
ld: warning in sf_elljac.o, file is not of required architecture
ld: warning in sf_erfc.o, file is not of required architecture
ld: warning in sf_exp.o, file is not of required architecture
ld: warning in sf_expint.o, file is not of required architecture
ld: warning in sf_fermi_dirac.o, file is not of required architecture
ld: warning in sf_gamma.o, file is not of required architecture
ld: warning in sf_gegenbauer.o, file is not of required architecture
ld: warning in sf_hyperg.o, file is not of required architecture
ld: warning in sf_laguerre.o, file is not of required architecture
ld: warning in sf_lambert.o, file is not of required architecture
ld: warning in sf_legendre.o, file is not of required architecture
ld: warning in sf_log.o, file is not of required architecture
ld: warning in sf_mathieu.o, file is not of required architecture
ld: warning in sf_power.o, file is not of required architecture
ld: warning in sf_psi.o, file is not of required architecture
ld: warning in sf_synchrotron.o, file is not of required architecture
ld: warning in sf_transport.o, file is not of required architecture
ld: warning in sf_trigonometric.o, file is not of required architecture
ld: warning in sf_zeta.o, file is not of required architecture
ld: warning in signal.o, file is not of required architecture
ld: warning in siman.o, file is not of required architecture
ld: warning in sort.o, file is not of required architecture
ld: warning in spline.o, file is not of required architecture
ld: warning in stats.o, file is not of required architecture
ld: warning in sum.o, file is not of required architecture
ld: warning in tamu_anova.o, file is not of required architecture
ld: warning in tensor.o, file is not of required architecture
ld: warning in vector.o, file is not of required architecture
ld: warning in vector_complex.o, file is not of required architecture
ld: warning in vector_double.o, file is not of required architecture
ld: warning in vector_int.o, file is not of required architecture
ld: warning in wavelet.o, file is not of required architecture
ld: warning in /opt/local/lib/libgsl.dylib, file is not of required architecture
Undefined symbols for architecture i386:
"_na_change_type", referenced from:
_get_vector_ptr in array.o
_carray_set_from_narray in array.o
_make_cvector_from_narray in array.o
_get_ptr_double3 in common.o
_rb_gsl_nary_eval1 in common.o
_na_to_gv in gsl_narray.o
_na_to_gv_view in gsl_narray.o
_na_to_gv_int in gsl_narray.o
_na_to_gv_int_view in gsl_narray.o
_na_to_gm in gsl_narray.o
_na_to_gm_view in gsl_narray.o
_na_to_gm_int in gsl_narray.o
_na_to_gm_int_view in gsl_narray.o