You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Errors:
/usr/bin/ld: /tmp/cceiCL9M.o: in function MAIN__': bessel.f90:(.text+0x1d): undefined reference to gsl_sf_bessel_Kn'
/usr/bin/ld: bessel.f90:(.text+0xc3): undefined reference to `gsl_sf_bessel_Knu'
collect2: error: ld returned 1 exit status
The method I install is like this, doese there any problem?
export FC=gfortran export PKG_CONFIG_PATH=/usr/include/gsl/lib/pkgconfig export gsl_LIBS=/usr/include/gsl [ -f ./fgsl.tar.gz ] && echo "No need to download fgsl" || wget https://github.com/reinh-bader/fgsl/archive/v1.3.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
The text was updated successfully, but these errors were encountered:
Since you seem to have found the solution, I will close this ticket. Generally note that the gsl_LIBS need to contain the library linkage spec, not the include path.
Someone else install FGSL on my desktop, I can use FGSL in such an easy way:
gfortran -I/usr/include/fgsl bessel.f90 -lfgsl
However I installed FGSL on my Laptop, the same test does not work properly.
chen@jesuslovesme:~/Documents/numerical/fortran/fgsl$ gfortran -I/usr/include/fgsl bessel.f90 -lfgsl
Errors:
/usr/bin/ld: /tmp/cceiCL9M.o: in function
MAIN__': bessel.f90:(.text+0x1d): undefined reference to
gsl_sf_bessel_Kn'/usr/bin/ld: bessel.f90:(.text+0xc3): undefined reference to `gsl_sf_bessel_Knu'
collect2: error: ld returned 1 exit status
The method I install is like this, doese there any problem?
export FC=gfortran
export PKG_CONFIG_PATH=/usr/include/gsl/lib/pkgconfig
export gsl_LIBS=/usr/include/gsl
[ -f ./fgsl.tar.gz ] && echo "No need to download fgsl" || wget https://github.com/reinh-bader/fgsl/archive/v1.3.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
The text was updated successfully, but these errors were encountered: