$ g++ -Wall XXX.cpp -o main -lgsl -lgslcblas -lm
$ ./main
included "-lgsl -lgslcblas -lm" in the compiler arguments.
See Makefile
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
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.