Menu
Step 0: Checking existence of GSL (and Fink) I use Fink to install the GNU Scientific Library (GSL).Fink is like Aptitute (high-level package manager) in Linux. If you are not sure if GSL is already installed, at the Terminal prompt $ type. Versions 1.3 should be able to be compiled on Windows systems using the Microsoft Visual Studio C compiler (= 2015). For this you need to first install the GNU Scientific Library (GSL), for example using Anaconda (see below). Similar to on a UNIX system, you need to set paths to the header and library files where the GSL is located. Dec 31, 2012 GSL follows the standard GNU installation procedure. The INSTALL file in this distribution for more detailed instructions. 'Compilation Notes' section in the INSTALL file. Jan 20, 2016 Tutorial: Installing paprica on Mac OSX. This should install the Gnu Scientific Library v1.16 in the default location. Install Infernal, pplacer, and epa-ng. Assuming all that went okay go ahead and download the software you need to execute just the paprica-run.sh portion of paprica.
1. Introduction
GNU Scientific Library(GSL) is a numerical library for C and C++ programmers. It’s a free software under the GNU General Public License.This library provides over 1000 functions which almost covers all the regular mathematical routines.
The complete range of subject areas covered by the library includes:
Complex Numbers, Roots of PolynomialsSpecial Functions, Vectors and MatricesPermutation, SortingBLAS Support,Linear AlgebraEigensystems, Fast Fourier TransformsQuadrature, Random NumbersQuasi-Random Sequences, Random DistributionsStatistics, HistogramsN-Tuples, Monte Carlo IntegrationSimulated Annealing, Differential EquationsInterpolation, Numerical DifferentiationChebyshev Approximation, Series AccelerationDiscrete Hankel Transforms, Root-FindingMinimization, Least-Squares FittingPhysical Constants, IEEE Floating-PointDiscrete Wavelet Transforms, Basis splines
- The library uses an object-oriented design. Different algorithms can be plugged-in easily or changed at run-time without recompiling the program
- Unlike the license of proprietary numerical libraries the license of GSL does not restrict scientific cooperation, instead, it allows you to share your program freely with others.
- The interface was designed to be simple to link to very high-level language, such as GNU Guile or python.
Primarily Supported Platforms:
Developed on the following platform:
- GNU/Linux with gcc
Other platforms:
- SunOS 4.1.3 & Solaris 2.x(Sparc)
- Alpha GNU/Linux, gcc
- HP-UX 9/10/11, PA-RISC, gcc/cc
- IRIX 6.5, gcc
- m68k NeXTSTEP, gcc
- Compaq Alpha Tru64 Unix, gcc
- FreeBSD, OpenBSD & NetBSD, gcc
- Cygwin
- Apple Darwin 5.4
- Hitachi SR8000 Super Technical Server, cc
2. Installation
The current version is GSL-1.16. It was released on 19 July 2013. This version can be found in the gel subdirectory on your nearest GNU mirror )
Recommended way to install:
use a package manager
- Homebrew(for mac users):
brew install gsl
- Synaptic(for Linux users): preinstalled in Ubuntu, Debian administers need to
apt-get install synaptic
in terminal - Cygwin(for windows users):
gsl
the GNU Scientific Library: runtimegsl-apps
the GNU Scientific Library: application programsgsl-debuginfo
Debug info for gslgsl-devel
the GNU Scientific Library: developers toolsgsl-doc
the GNU Scientific Library: documentation
Link to the libraries:
- Mac+Xcode:1.Create a new Xcode Project2.Edit Build Settings3.Under “Other Linker Flags” add the following:-lgsl-lgslcblas4.Under “Header Search Path” add the following:/usr/local/Cellar/gsl/1.15/include5.Under “Library Search Path” add the following:/usr/local/Cellar/gsl/1.15/lib6.Add the appropriate #include to your source files for the GSL library you wish to use.8. Code and Compile.
- Windows+Virtual Studio:manual
- Linux+Terminal:
g++ -Wall -o program program.c -lgsl -lgslcblas -lm
3. Examples
![Scientific Scientific](/uploads/1/2/6/4/126477532/550455140.png)
The error code numbers returned by library functions are defined in the file gsl_errno.h. They all have the prefix GSL_ and expand to non-zero constant integer values.
- Macro: int GSL_EDOMDomain error; used by mathematical functions when an argument value does not fall into the domain over which the function is defined (like EDOM in the C library)
- Macro: int GSL_ERANGERange error; used by mathematical functions when the result value is not representable because of overflow or underflow (like ERANGE in the C library)
- Macro: int GSL_ENOMEMNo memory available. The system cannot allocate more virtual memory because its capacity is full (like ENOMEM in the C library). This error is reported when a GSL routine encounters problems when trying to allocate memory with malloc.
- Macro: int GSL_EINVALInvalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function (like EINVAL in the C library).
int status = gsl_function (...) // status 0, no error
printf ('error: %sn', gsl_strerror (status)); //gsl_strerror converts the error codes into a message.