Download the tar file:
sudo apt-get install make
cd $HOME
mkdir -p gsl
cd gsl
wget http://gnuftp.uib.no/gsl/gsl-latest.tar.gz
tar zxvf gsl-latest.tar.gz
rm gsl-latest.tar.gz
cd gsl-2.5 # <-- change 2.5 to the directory name you got after extracting
./configure
make
sudo make install
make clean
Now libgsl
has been 'installed' in /usr/local/lib
, and you can
compile a test program test.c
using:
gcc -Wall -I/usr/local/include -c test.c
gcc -L/usr/local/lib test.o -lgsl -lgslcblas -lm
To run the executable a.out
, remember to set the LD_LIBRARY_PATH
environment variable in your shell startup files,
or specify it on the command line:
$ LD_LIBRARY_PATH=/usr/local/lib a.out