0

I would like to use library fgsl, that depends on gsl. I have problem indicating where gsl is installed while configuring fgsl. I want to use the static version of these libraries. I can not use gsl library from Linux packages, these versions are not recent enough.

First I download, configure, compile and install gsl locally, i.e. using the --prefix option. (Instructions are presented below)

Then I download fgsl, configure it. This last operation fails because I do not succeed indicating where is gsl. I have tried to use gsl_LIBS unsuccessfully.

wget http://ftp.igh.cnrs.fr/pub/gnu/gsl/gsl-2.3.tar.gz -O gsl.tar.gz
mkdir -p gsl_build && cd gsl_build
tar -xzf ../gsl.tar.gz --strip 1
autoreconf -fi
./configure CFLAGS="-Wall" --prefix `pwd`/../gsl
make
make install
cd ..
rm -rf gsl_build

Here are the commands I run to install fgsl

wget https://github.com/reinh-bader/fgsl/archive/v1.2.0.tar.gz -O fgsl.tar.gz
mkdir -p fgsl_build
cd fgsl_build
tar -xzf ../fgsl.tar.gz --strip 1
autoreconf -fi
export gsl_LIBS=`pwd`/../gsl/lib
./configure CFLAGS="-Wall" FCFLAGS="-Wall" --prefix `pwd`/../fgsl --libdir=`pwd`/../gsl/lib --includedir=`pwd`/../gsl/include
make
make check
make install
cd ..
rm -rf fgsl_build

I try to do this for the open source project AcousticBEM. Here is the log presenting the problem.

Guillaume Jacquenot
  • 9,076
  • 5
  • 38
  • 47
  • What is the relevant output from `configure`? But you aren't specifying a complete link line, just a directory name. – francescalus Oct 12 '17 at 20:27
  • I have tried with `export gsl_LIBS=`pwd`/../gsl/lib/libgsl.a;`pwd`/../gsl/lib/libgslcblas.a`, but without success – Guillaume Jacquenot Oct 12 '17 at 20:52
  • The output log is located at the end of this webpage: https://travis-ci.org/Gjacquenot/AcousticBEM – Guillaume Jacquenot Oct 12 '17 at 20:54
  • Some selected relevant part should be in the question so that it survives the changes of that website r deletion of your comment. – Vladimir F Oct 12 '17 at 22:13
  • Have a look at the ` ./configure --prefix= \ --libdir=/lib/$FC \ --includedir=/include/$FC` part in the instructions for gsl: https://github.com/reinh-bader/fgsl and add the explicit error in your question. – Pierre de Buyl Oct 13 '17 at 07:25
  • Why the `$FC` in the install script paths? Also, you use `--prefix ../gsl` and your question is now out of sync... – Pierre de Buyl Oct 13 '17 at 07:54

1 Answers1

1

Well, here are my updated scripts to install gsl and fgsl locally. I have used PKG_CONFIG_PATH to tell fgsl where gsl is installed. I end up with a directory named gsl containing gsl libraries and fgsl libraries.

First a shell script to install gsl

export gsl_INSTALL_DIR=`pwd`/gsl
[ -f ./gsl.tar.gz ] && echo "No need to download gsl" || wget http://ftp.igh.cnrs.fr/pub/gnu/gsl/gsl-2.3.tar.gz -O gsl.tar.gz
mkdir -p gsl_build
cd gsl_build
tar -xzf ../gsl.tar.gz --strip 1
autoreconf -fi
./configure CFLAGS="-Wall" --prefix=${gsl_INSTALL_DIR}
make
make install
cd ..
rm -rf gsl_build

Second, a script to install fgsl locally using the newly install gsl

export PKG_CONFIG_PATH=`pwd`/gsl/lib/pkgconfig
export gsl_LIBS=`pwd`/gsl
[ -f ./fgsl.tar.gz ] && echo "No need to download fgsl" || wget https://github.com/reinh-bader/fgsl/archive/v1.2.0.tar.gz -O fgsl.tar.gz
mkdir -p fgsl_build
cd fgsl_build
tar -xzf ../fgsl.tar.gz --strip 1
autoreconf -fi
./configure CFLAGS="-Wall" FCFLAGS="-Wall" --prefix=${gsl_LIBS}
make
make check
make install
cd ..
rm -rf fgsl_build
Guillaume Jacquenot
  • 9,076
  • 5
  • 38
  • 47