Ubuntu – GSL libray and header paths

14.04svn

I am trying to install a package which has a dependecy on gsl. In the package docs, it is mentioned:

0. This installation is known to work easily if you use Mac OS X and have 
installed python and gsl using MacPorts.

1. Modify the setup_cfg.py
Change the 'GSL_INCLUDE' and 'GSL_LIB' variables to your path to the GSL
header and library files. For example:
GSL_INCLUDE = 'some_path/gsl-1.15/include'
GSL_LIB = 'some_path/gsl-1.15/lib'

I am using ubuntu and installed gsl using

sudo apt-get install libgsl0-dev

How can I find the gsl libraries path? 'some_path/gsl-1.15/include' ; 'some_path/gsl-1.15/lib'

abhishek:/usr/lib$ pkg-config --libs gsl 
-lgsl -lgslcblas -lm

Best Answer

If you installed the libgsl0-dev package, then its header files should have gone in /usr/include/gsl and its libraries in /usr/lib

You can confirm this by looking at the output of the command dpkg -L libgsl0-dev or by looking at the list of files online at http://packages.ubuntu.com

I don't think it is possible to know from what you have posted whether the software you are installing is expecting the gsl subdirectory - that is, whether it wants

GSL_INCLUDE = '/usr/include/gsl'

or just

GSL_INCLUDE = '/usr/include'

(in C-language terms, that would be the difference between something like #include <gsl/cblas.h> and #include <cblas.h>). You may need to try both.

Note that /usr/include and /usr/lib are standard search paths for tools such as gcc. Most often, when development packages install to such paths there is no need to set them explicitly - you will see that pkg-config --cflags --libs does not output any -I or -L include path or library path directives.

Related Question