The GNU Scientific Library, gsl, is a collection of numerical routines for scientific computing in C and C++.
Last update: Fri Nov 23 07:04:57 2001
Comments, and reports of errata or bugs, are welcome via e-mail to the author, Nelson H. F. Beebe <firstname.lastname@example.org>. In your report, please supply the full document URL, and the title and Last update time stamp recorded near the top of the document.
Most of the scientific libraries available at this site are written in Fortran, and usable from other programming languages, such as C and C++, subject to careful consideration of mixed-language programming issues. GSL is different: it is written entirely in Standard C (and thus also usable from C++), and makes heavy use of header files, C typedefs, and other C data types and data structures that have no counterparts in Fortran. GSL uses the C storage order for multidimensional arrays, which differs from that used by Fortran. The only way that you can use this library from Fortran code is to write your own wrapper routines in C to provide the necessary mapping between data types, data structures, and data storage conventions of the two languages. No such interface layer is included with the library. The GSL software distribution TO-DO list contains wishlist items calling for interfaces to guile (the GNU implementation of Scheme, a simplified derivative of Lisp) and python to be developed, but is completely silent about support for Fortran.
There is locally-provided online documentation for GSL inside the GNU Emacs info system. In emacs, type C-h i to enter the info system, then type Mgsl-ref for the GSL Reference Manual, or Mgsl-design for the GSL Design Manual. You can do the same thing in the standalone xinfo viewer. That documentation is also available in HTML form for the GSL Design Manual and the GSL Reference Manual for Web browsers.
C code can be linked with the GSL libraries like this:
cc -o ccode ccode.f -L/usr/local/lib -lgsl -lcblas
There are related several libraries whose source code is freely available, among them, EISPACK (for matrix eigenvalues and eigenvectors, and singular-value decompositions), LINPACK (for linear equations, least-squares, and singular-value decomposition), MINPACK (for function minimization and least-squares solutions), and LAPACK (for linear equations, least-squares, singular-value decomposition, and eigenvalue/eigenvector solution).