Here is the problems I meet and the solutions I see from other pepople. Just a note!
- first, download
gsl-2.1.tar.gz
from gslnet.- unpackage it:
$ tar -xzvf gsl-2.1.tar.gz
.- get into the file
$ cd gsl-2.1
- compile it
$ ./configure --prefix=/usr/local/gsl
- install it
$sudo make && make check && make install
- edit the the path in .barsrc
cd ~
andvi .barsrc
- added in
#___ gsl ___
export PATH=/usr/local/gsl/bin:${PATH}
export C_INCLUDE_PATH=/usr/local/gsl/include:${C_INCLUDE_PATH}
export LD_LIBRARY_PATH=/usr/local/gsl/lib:${LD_LIBRARY_PATH}
- complete
solution to cannot find -lxxx
I have installed the gsl library on my CentOS 7
computer and complete it. However, when I use gcc
to compile a program, in which it calls gsl
to do some calculation, I have suffered
/usr/bin/ld: cannot find -lgsl
/usr/bin/ld: cannot find -lgslcblas
I checked my lib in /usr/lib
, and find there is no libgsl*
exit. For -lxxx
represent 'lib+xxx+.so'.
Then I checked my computer: $ find / -name libgsl.so
I find the file in /usr/local/gsl/lib/libgsl.so
, where I installed the gsl.
Then I linked it to /usr/lib
$ sudo ln -s /usr/loca/gsl/lib/libgsl.so /usr/lib/
The same to solve some same problems, maybe, I think.
The end!