简体   繁体   English

构建R程序包中的32位和64位错误调用了Fortran

[英]32-bit and 64-bit error in building R package which calls Fortran

I'm trying to build an R package which calls Fortran code in Windows system. 我正在尝试构建一个R包,在Windows系统中调用Fortran代码。 R BUILD works well but I got some error in R CHECK or R INSTALL. R BUILD运作良好,但在R CHECK或R INSTALL中出现错误。

To compile the Fortran code to get a dll file in Windows system, I have to specify x64 (64 bit) or i386 (32-bit). 要在Windows系统中编译Fortran代码以获取dll文件,我必须指定x64(64位)或i386(32位)。 But when I used dll file compiled by x64 in R CHECK, I will get the error: 但是,当我在R CHECK中使用x64编译的dll文件时,会收到错误消息:

Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Program Files/R/R-3.3.1/bin/catch.Rcheck/catch/libs/i386/tensor.dll': LoadLibrary failure: %1 is not a valid Win32 application. inDL(x,as.logical(local),as.logical(now),...)中的错误:无法加载共享对象'C:/ Program Files / R / R-3.3.1 / bin / catch.Rcheck /catch/libs/i386/tensor.dll':LoadLibrary失败:%1不是有效的Win32应用程序。

Similarly, if I used the dll file compiled by i386, I will get error in 64-bit installation. 同样,如果我使用了i386编译的dll文件,则在64位安装中会出现错误。

I was wondering is there any way that I can specify using dll from x64 to build a package works for 64 bit machine and dll from i386 to build one for 32 bit machine. 我想知道有什么方法可以指定使用x64的dll来构建适用于64位计算机的软件包,使用i386的dll来指定用于32位计算机的软件包。 Thanks! 谢谢!

It's been a while, but just in case people have the same issue. 已经有一段时间了,但是以防万一人们遇到同样的问题。 It's a designed issue and the 32-bit and 64-bit compiled files need to be built separately. 这是一个设计问题,需要分别构建32位和64位编译文件。 Solution is that to build 64 bit version, i386 needs to be moved out of the folder. 解决方案是,要构建64位版本,需要将i386移出该文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM