【发布时间】:2016-04-13 04:41:15
【问题描述】:
我在cygwin上用gfortran,想安装FGSL包,那我试试
xxx@xxx-PC ~
$wget http://www.lrz.de/services/software/mathematik/gsl/fortran/download/fgsl-1.0.0.tar.gz
$tar zxvf fgsl-1.0.0.tar.gz
$cd fgsl-1.0.0
$./configure
到目前为止一切顺利,那么接下来我该怎么办? https://de.wikibooks.org/wiki/Fortran:_FGSL
我很抱歉。在弗拉基米尔的指导下,我尝试了
xxx@xxx-PC ~/fgsl-1.0.0
$ make
make all-recursive
make[1]: Entering directory '/cygdrive/d/CygwinWorkshop/fgsl-1.0.0'
Making all in .
make[2]: Entering directory '/cygdrive/d/CygwinWorkshop/fgsl-1.0.0'
/bin/sh ./libtool --tag=FC --mode=link gfortran -g -O2 -version-info 0:0:0 -o libfgsl.la -rpath /usr/local/lib fgsl.lo libfgsl_la-fgsl_utils.lo -lgsl -lgslcblas -lblas
/usr/bin/grep: /usr/lib/libblas.la: No such file or directory
/usr/bin/sed: can't read /usr/lib/libblas.la: No such file or directory
libtool: link: `/usr/lib/libblas.la' is not a valid libtool archive
Makefile:531: recipe for target 'libfgsl.la' failed
make[2]: *** [libfgsl.la] Error 1
make[2]: Leaving directory '/cygdrive/d/CygwinWorkshop/fgsl-1.0.0'
Makefile:636: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/cygdrive/d/CygwinWorkshop/fgsl-1.0.0'
Makefile:437: recipe for target 'all' failed
make: *** [all] Error 2
和
xxx@xxx-PC ~/fgsl-1.0.0
$ make install
Making install in .
make[1]: Entering directory '/cygdrive/d/CygwinWorkshop/fgsl-1.0.0'
/bin/sh ./libtool --tag=FC --mode=link gfortran -g -O2 -version-info 0:0:0 -o libfgsl.la -rpath /usr/local/lib fgsl.lo libfgsl_la-fgsl_utils.lo -lgsl -lgslcblas -lblas
/usr/bin/grep: /usr/lib/libblas.la: No such file or directory
/usr/bin/sed: can't read /usr/lib/libblas.la: No such file or directory
libtool: link: `/usr/lib/libblas.la' is not a valid libtool archive
Makefile:531: recipe for target 'libfgsl.la' failed
make[1]: *** [libfgsl.la] Error 1
make[1]: Leaving directory '/cygdrive/d/CygwinWorkshop/fgsl-1.0.0'
Makefile:636: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
发生了一些我不知道如何处理的错误。
根据屏幕提示,我接下来检查
$ apt-cyg install lapack
Package lapack is already installed, skipping
$ apt-cyg install liblapack-devel
Package liblapack-devel is already installed, skipping
https://de.wikibooks.org/wiki/Fortran:_FGSL 给出的名为 bsp.f03 的 fortran 代码 用于测试目的
program bsp
use fgsl
implicit none
real( kind = fgsl_double ) :: a
real( kind = fgsl_double ) :: d = 5.0_fgsl_double
a = d ** 2 * m_pi_4
write( *, * ) "Kreisflaeche = ", a
end program bsp
然后我编译链接
$g95 bsp.f03 -I/usr/local/include/g95 -L/usr/local/lib -lgsl -lfgsl_g95 -lgslcblas
-bash: g95: command not found
我使用 R 进行统计 在 Windows 上进行了很多计算,而且我完全是 fortran 和 cygwin 的新手,所以请原谅我关于上述内容的非常基本和幼稚的问题。
【问题讨论】:
-
试试
make、make install,然后将其用作任何其他库。如果您有任何特殊问题,您必须更具体。 -
我很抱歉。在您的指导下,我重新编辑了我的问题。
-
您安装了 BLAS 吗?如果是,在哪个目录?
-
好的,我试试。以前,我认为安装 BLAS 是不必要的,因为我已经安装了 Lapack。根据您的建议,我将根据software_cygwin_libraries 安装 BLAS。非常感谢!
-
等等,在你的最后一个命令中你有
g95。你应该在那里有gfortran,不是吗? Lapack 需要 BLAS,并且必须单独安装。