cygwin安装FGSL?

时间:2016-04-07 22:18:11

标签: cygwin gfortran

我在cygwin上使用gfortran并想安装FGSL包,然后我尝试

"Events"

到目前为止一切顺利,接下来应该做什么? https://de.wikibooks.org/wiki/Fortran:_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

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

https://de.wikibooks.org/wiki/Fortran:_FGSL给出的名为bsp.f03的fortran代码 用于测试目的

$ apt-cyg install lapack
Package lapack is already installed, skipping
$ apt-cyg install liblapack-devel
Package liblapack-devel is already installed, skipping

然后我编译并链接

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

我使用R进行统计 在Windows上计算很多,我是fortran和cygwin的新手,所以请原谅我对上述问题的基本和天真的问题。

1 个答案:

答案 0 :(得分:0)

您缺少配置步骤。源包已配置用于其他系统。

通常,对于任何构建,您应该运行

autoreconf -ivf
./configure
make

此外,在这些步骤之前,请替换Makefile.am

libfgsl_la_LDFLAGS = -version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@ @FGSL_LDFLAGS@ 

libfgsl_la_LDFLAGS = -version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@ @FGSL_LDFLAGS@ -no-undefined

构建共享库。