本文介绍了无法在R中安装基于fortran的软件包 - “gfortran -m32:not found”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am writing an R package that has Fortran source code. In short, my problem is when I try to install the package I get the error "gfortran -m32: not found" however, I am able compile my code using gfortran -m32 when I'm not installing the package.

详细版本:

我已经安装了最新版本的R(3.1.1)以及最新版本的Rtools (C:\Rtools\bin; C:\ Rtools \ gcc-4.6.3 \ bin; C:\ Program Files \R\R-3.1.1) \bin\x64; C:\ msys; C:\程序文件(x86)\ SSH安全Shell; C:\程序文件\MiKTeX 2.9\miktex\bin)。

I have installed the newest version of R(3.1.1) along with the newest version of Rtools(31) and renamed my path variables accordingly (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).

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

For testing purposes, I downloaded the PropClust package from CRAN which has Fortran source code.

当我在构建它之后键入R CMD INSTALL PropClust_1.4.tar.gz时,出现以下错误:

When I type "R CMD INSTALL PropClust_1.4.tar.gz" after building it, I get the following error:

* 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位,如果这很重要的话。

Although it says "gfortran -m32: not found" I have compiled my code in the same window with the same options(gfortran -m32 -O3 -mtne=core2 -c a.f90 -o a.out) with no problems. Has anyone had this problem before? I am running Windows 7 64-bit if that matters.

推荐答案

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

I had a similar problem : R was invoking gfortran-4.8 - an unrecognized command on my system - instead of gfortran. This problem was fixed upon creating the file ~/.R/Makevars within my home directory. Here are the contents of Makevars which points to the appropriate gfortran installation:

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

这篇关于无法在R中安装基于fortran的软件包 - “gfortran -m32:not found”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 12:03