Valid
        XHTML 1.1! Valid CSS!
Created 2006-07-05 Modified 2009-04-12
Chelton Evans

GLS -GNU Scientific Library home

Intro
Install

Intro

GSL-GNU Scientific Library   Reference Manual

Compiling in C++

$ g++ -Wall XXX.cpp -o main -lgsl -lgslcblas -lm
$ ./main

included "-lgsl -lgslcblas -lm" in the compiler arguments.

ex000.cpp   ex001.cpp  

See Makefile

Minimizing

Algorithms with derivatives
minimizing vector function f(X) when d/dX f(X) is known. f(X) returns a real number, d/dX f(X) returns a vector.

Algorithms without derivatives

Install

Downloaded gsl-1.14.tar.gz
$ gunzip gsl-1.14.tar.gz
$ tar -xf gsl-1.14.tar
cd gsl-1.14

# ./configure
# make
# make install

Default puts the libraries in /usr/local/lib

[Past version problems intalling on linux box, current version worked]

I had a few problems with the install, namely that it did not copy the object files to /usr/lib .

I did the usual thing.

Here are my notes on the fix.

Rebuilt the library with
  ./configure --disable-shared

The problems persisted.
[zero@localhost gsl]$ gcc -Wall ex000.cpp -o main -lgsl -lgslcblas -lm
/tmp/cc6P8NXu.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

Inside /gsl-1.7/

cd ./.libs/
cp libgsl.so.0.8.0 /usr/lib/
cp libgsl.lai /usr/lib/
pushd /usr/lib
ln -s libgsl.lai libgsl.la
ln -s libgsl.so.0.8.0 libgsl.so

Inside /gsl-1.7/
cd cblas/.libs
cp libgslcblas.a /usr/lib/
cp libgslcblas.so.0.0.0 /usr/lib/
cp ../libgslcbas.la /usr/lib/
ln -s libgslcblas.so.0.0.0 libgslcbas.so
ln -s libgslcblas.so.0.0.0 libgslcbas.so.0

g++ -Wall ex001.cpp -o main -lgsl -lgslcblas -lm

Finally compiled and ran.