无法在R中安装基于fortran的软件包 - " gfortran -m32:未找到"

时间:2014-08-17 08:58:52

标签: r windows-7 fortran gfortran

我正在编写一个包含Fortran源代码的R包。简而言之,我的问题是当我尝试安装软件包时出现错误“gfortran -m32:not found”但是,当我不安装软件包时,我可以使用gfortran -m32编译我的代码。

详细版本:

我已经安装了最新版本的R(3.1.1)以及最新版本的Rtools(31)并相应地重命名了我的路径变量(C:\ Rtools \ bin; C:\ Rtools \ gcc-4.6.3 \ bin; C:\ Program Files \ R \ R-3.1.1 \ bin \ x64; C:\ msys; C:\ Program Files(x86)\ SSH Secure Shell; C:\ Program Files \ MiKTeX 2.9 \ miktex \ bin)中。

出于测试目的,我从CRAN下载了具有Fortran源代码的PropClust软件包。

在构建之后输入“R CMD INSTALL PropClust_1.4.tar.gz”时,我收到以下错误:

* installing *source* package 'PropClust' ...
** libs

*** arch - i386
C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf:202: warning: overriding recipe for target `.m.o'
C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf:195: warning: ignoring old recipe for target `.m.o'
gfortran -m32   -O3  -mtune=core2 -c  PropClustParallelTrials.f90 -o PropClustParallelTrials.o
gcc -m32 -I"C:/PROGRA~1/R/R-31~1.1/include" -DNDEBUG     -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O3 -Wall  -std=gnu99 -mtune=core2 -c minWhichMin.c -o minWhichMin.o
gfortran -m32 -shared -s -static-libgcc -o PropClust.dll tmp.def PropClustParallelTrials.o minWhichMin.o -Ld:/RCompile/CRANpkg/extralibs64/local/lib/i386 -Ld:/RCompile/CRANpkg/extralibs64/local/lib  -LC:/PROGRA~1/R/R-31~1.1/bin/i386 -lR
gfortran -m32: not found
C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf:202: warning: overriding recipe for target `.m.o'
C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf:195: warning: ignoring old recipe for target `.m.o'
cygwin warning:
  MS-DOS style path detected: C:/PROGRA~1/R/R-31~1.1/bin/i386/Rterm.exe
  Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-31~1.1/bin/i386/Rterm.exe
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
no DLL was created
ERROR: compilation failed for package 'PropClust'
* removing 'C:/Users/kamicz/Documents/IsotopeR/PropClust.Rcheck/PropClust'

虽然它说“gfortran -m32:not found”虽然我在相同的窗口中使用相同的选项编译了我的代码(gfortran -m32 -O3 -mtne = core2 -c a.f90 -o a.out)但没有问题。以前有人有这个问题吗?如果重要的话,我正在运行Windows 7 64位。

1 个答案:

答案 0 :(得分:1)

我遇到了类似的问题:R正在调用gfortran-4.8 - 我系统上无法识别的命令 - 而不是gfortran。在我的主目录中创建文件~/.R/Makevars时,此问题已得到解决。以下是Makevars的内容,它指向相应的gfortran安装:

F77 = gfortran
FC = gfortran
FLIBS = -L/usr/local/gfortran/lib