2013-01-08 184 views
3

我正在運行ubuntu,64位。我有這個最小的測試包 ,我作出了學習如何做這些事情(我遵循此tutorial,除了我也有一些C代碼在包中)。當我跑R包的windows安裝

R CMD check MySmallPackage 

就可以了,它工作正常(見下文)。然後, 我跑

R CMD build MySmallPackage 

它也可以工作(見下文)。所以,現在,我送 產生的.tar.gz下載到運行WIN7 64位 (和64位R)的朋友,他得到這個錯誤信息:

*** arch - i386 
ERROR: compilation failed for package 'MySmallPackage' 
* removing 'C:/Users/ES/Documents/R/win-library/2.15/MySmallPackage' 
Warning in install.packages : 
    running command 'C:/PROGRA~1/R/R-215~1.1/bin/x64/R CMD INSTALL -l "C:/Users/ES/Documents/R/win-library/2.15" "C:/Users/ES/Downloads/MySmallPackage_0.1.1(1).tar.gz"' had status 1 
Warning in install.packages : 
    installation of package ‘C:/Users/ES/Downloads/MySmallPackage_0.1.1(1).tar.gz’ had non-zero exit status 

這是非常令人費解。任何人都可以指出什麼可能會導致這個問題(我多年沒有使用Windows,但該軟件包安裝在Linux上很好)。該錯誤消息對我來說有點神祕。

$ R CMD check MySmallPackage 
* using log directory ‘~/MySmallPackage.Rcheck’ 
* using R version 2.15.2 (2012-10-26) 
* using platform: x86_64-pc-linux-gnu (64-bit) 
* using session charset: UTF-8 
* checking for file ‘MySmallPackage/DESCRIPTION’ ... OK 
* checking extension type ... Package 
* this is package ‘MySmallPackage’ version ‘0.1.1’ 
* checking package namespace information ... OK 
* checking package dependencies ... OK 
* checking if this is a source package ... OK 
* checking if there is a namespace ... OK 
* checking for executable files ... OK 
* checking whether package ‘MySmallPackage’ can be installed ... OK 
* checking installed package size ... OK 
* checking package directory ... OK 
* checking for portable file names ... OK 
* checking for sufficient/correct file permissions ... OK 
* checking DESCRIPTION meta-information ... OK 
* checking top-level files ... OK 
* checking for left-over files ... OK 
* checking index information ... OK 
* checking package subdirectories ... OK 
* checking R files for non-ASCII characters ... OK 
* checking R files for syntax errors ... OK 
* checking whether the package can be loaded ... OK 
* checking whether the package can be loaded with stated dependencies ... OK 
* checking whether the package can be unloaded cleanly ... OK 
* checking whether the namespace can be loaded with stated dependencies ... OK 
* checking whether the namespace can be unloaded cleanly ... OK 
* checking loading without being on the library search path ... OK 
* checking for unstated dependencies in R code ... OK 
* checking S3 generic/method consistency ... OK 
* checking replacement functions ... OK 
* checking foreign function calls ... OK 
* checking R code for possible problems ... OK 
* checking Rd files ... OK 
* checking Rd metadata ... OK 
* checking Rd cross-references ... OK 
* checking for missing documentation entries ... OK 
* checking for code/documentation mismatches ... OK 
* checking Rd \usage sections ... OK 
* checking Rd contents ... OK 
* checking for unstated dependencies in examples ... OK 
* checking line endings in C/C++/Fortran sources/headers ... OK 
* checking line endings in Makefiles ... OK 
* checking for portable compilation flags in Makevars ... OK 
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK 
* checking compiled code ... OK 
* checking examples ... OK 
* checking PDF version of manual ... OK 


$R CMD build MySmallPackage 
* checking for file ‘MySmallPackage/DESCRIPTION’ ... OK 
* preparing ‘MySmallPackage’: 
* checking DESCRIPTION meta-information ... OK 
* cleaning src 
* checking for LF line-endings in source and make files 
* checking for empty or unneeded directories 
* building ‘MySmallPackage_0.1.1.tar.gz’ 

回答

5

您需要爲Linux,Mac和Windows機器構建不同的軟件包。

有一個(至少)四種可能性:

  1. 主機你的包上r-forge。每晚r-forge都會構建一個linux,windows和mac版本的軟件包。
  2. 使用由Uwe Ligges維護的在線窗口package builder
  3. 發送給你的朋友的源代碼,並讓他在Windows機器上構建包。當我搜索「構建軟件包窗口」時,我得到了一些有用的點擊。
  4. 將您的軟件包置於github上,然後使用devtools軟件包安裝軟件包。
+0

謝謝。 「2」。工作並製作了一個可用的.zip文件。但速度非常慢!我認爲這需要一個新的問題。 – user189035

+1

但是4)沒有幫助建設,你仍然需要Rtools。 –

+0

@DirkEddelbuettel確實如此,但是如果您安裝了Rtools,則應該可以(以非Windows用戶身份發言)。 – csgillespie