GSL (GNU Scientific Library) as one of the three major scientific computing libraries, in addition to covering basic linear algebra, differential equations, integrals, random numbers, combinatorial numbers, equation root, polynomial root, sequencing, etc., as well as simulated annealing, fast Fourier transform, wavelet, interpolation, Basic spline, least squares fitting, special functions, etc. The installation and use of GSL are described below.
Method One:
First download from the official website to the source code (I use the version is gsl-1.9) compressed package, extracted into the directory, to perform
./configuremakemake Install
This process takes a few minutes. It is also important to note that, when executed make install
, the dynamic library and header files are automatically copied to/usr/local/lib and/usr/local/include respectively, but if the two directories do not have write permissions, the two directories cannot be created, causing the installation to fail, and instead use ' sudo make install ' or manually give permission to resolve this issue.
The installation is complete, here is the example of running the official online
#include <stdio.h> #include <gsl/gsl_sf_bessel.h>int main (void) { double x = 5.0; Double y = gsl_sf_bessel_j0 (x); printf ("J0 (%g) =%.18e\n", x, y); return 0; }
Compile it (assuming that the file is saved as TEST.C):
GCC test.c-lgsl-lgslcblas test.c-o test
Output the executable file test.
Method Two:
The GSL Source package provides the following binary packages:
- GSL-BIN:GNU Scientific Library (GSL)-binary package
- LIBGSL0-DBG:GNU Scientific Library (GSL)--Debug Symbols Package
- LIBGSL0-DEV:GNU Scientific Library (GSL)--Development package
- LIBGSL0LDBL:GNU Scientific Library (GSL)--Library package
The terminal can be installed by typing the following command:
sudo apt-get install Libgsl0ldbl
Description: Depending on the need to choose to install a different version, use gsl-bin
will install all content ( gsl - bin
dependent libgsl0ldbl
)
For more GSL, refer to the official instruction manual for more in-depth understanding of the GSL design documentation
ubuntu14.04 installation of GSL Scientific Computing Library