GNU Scientific Library¶
- home page: https://www.gnu.org/software/gsl/
- manual: https://www.gnu.org/software/gsl/doc/html/index.html
Install¶
-
Get the download URL for the file
gsl-latest.tar.gzby visiting the website: https://www.gnu.org/software/gsl/Use that download URL via the terminal (e.g., using one possible URL):
This will dowload the filewget https://mirrors.ibiblio.org/gnu/gsl/gsl-latest.tar.gz -O gsl-latest.tar.gzgsl-latest.tar.gz. -
Extract the contents, in the terminal run:
This will extract into a new folder, for instance it istar -xzf gsl-latest.tar.gzgsl-2.8, which contains the version number you've dowloaded.Change the directory in your terminal:
cd gsl-2.8(possibly adjust the version number). -
How to compile and install GSL, is written in the text file
INSTALL. It needs three steps that are very common: "configure" → "make" → "make install".We will modify one thing because we cannot write files in directories that require root access. So, we want to specify another directory for GSL to be installed. The
INSTALLdocument tells us how:You can specify an installation prefix other than
/usr/localby givingconfigurethe option--prefix=PREFIX, wherePREFIXmust be an absolute file name.That's why we run in the terminal:
This will eventually put the GSL files into your home directory (./configure --prefix=$HOME/build/gsl-2.8$HOMEis a variable with your home directory) inside the folderbuild/gsl-2.8(it's ok if you choose another directory, too).After configure finished running, we compile (it takes a few minutes):
(make will end with:makemake[1]: Leaving directory '/home/jrudi/code/gsl-2.8')After compiling with make is finished, we install:
This last step will simply copy all the files that GSL needs into the directory that we told it to use, namely withmake install--prefix=...