2016-05-26 15 views
0

Rcppコードを開発しましたが、Linuxでコンパイルしましたが、私はWindowsを試しています。Rcpp Windows失敗コンパイル

Rtoolsがインストールされていて、パスが設定されていると、パスが正しいように見えます。

> Sys.getenv("PATH") 
[1] "C:\\Program Files\\R\\R-3.3.0\\bin\\x64;c:\\Rtools\\bin;c:\\Rtools\\gcc-4.6.3\\bin;c:\\MiKTeX\\miktex\\bin;c:\\Program Files\\R\\R-3.3.0\\bin\\;c:\\windows;c:\\windows\\system32;C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32Files (x86)" 

私がg ++メイクもだから私は、エラーRcppExportsを知らないRtools

> system("where make") 
c:\Rtools\bin\make.exe 



system("R CMD INSTALL ./Sage_1.03.tar.gz") 
* installing to library 'C:/Users/Melannies/Documents/R/win-library/3.3' 
* installing *source* package 'Sage' ... 
** libs 
c:/Rtools/mingw_64/bin/g++ -I"C:/PROGRA~1/R/R-33~1.0/include" -DNDEBUG  -I"C:/Users/Melannies/Documents/R/win-library/3.3/Rcpp/include" -I"C:/Users/Melannies/Documents/R/win-library/3.3/RcppArmadillo/include" -I"d:/Compiler/gcc-4.9.3/local330/include" `-IC:/Users/Melannies/Documents/R/win-library/3.3/Rcpp/include -O2 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o 
Syntax error: EOF in backquote substitution 
make: *** [RcppExports.o] Error 2 
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-33~1.0/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.0/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="speedSage.dll" WIN=64 TCLBIN=64 OBJECTS="RcppExports.o aggregategsSumSigma.o bayesEstimation.o calcVIFarm_nosdalphaalt.o calcVIFarmalt.o notbayesEstimation.o sigmaArm.o sigmaSingle.o"' had status 2 
ERROR: compilation failed for package 'Sage' 
* removing 'C:/Users/Melannies/Documents/R/win-library/3.3/speedSage' 
    Warning message: 
running command 'R CMD INSTALL ./speedSage_1.03.tar.gz' had status 1 

によってインストールされている?

> system("g++ -v") 
Using built-in specs. 
COLLECT_GCC=c:\Rtools\GCC-46~1.3\bin\G__~1.EXE 
COLLECT_LTO_WRAPPER=c:/rtools/gcc-46~1.3/bin/../libexec/gcc/i686-w64-mingw32/4.6.3/lto-wrapper.exe 
Target: i686-w64-mingw32 
Configured with: /data/gannet/ripley/Sources/mingw-test3/src/gcc/configure --host=i686-w64-mingw32 --build=x86_64-linux-gnu --target=i686-w64-mingw32 --with-sysroot=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --prefix=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --with- gmp=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpfr=/data/gannet/ripley/Sources/mingw 
Thread model: win32 
gcc version 4.6.3 20111208 (prerelease) (GCC) 

がインストールされていますか私はRcpp-Develに加入しようとしましたが、問題がありました。説明ではなく、完全に問題がで与えられるLinkingTo

Package: Sage 
Type: Package 
Title: accelerated Client package 
Version: 1.04 

Depends: 
    Rcpp (>= 0.10.3), 
    RcppArmadillo (>= 0.3.810.2), 
    R (>= 2.15.0), 
    stats, 
    utils, 
    arkas 
Suggests: knitr, 
     roxygen2 
VignetteBuilder: knitr 
Maintainer: anthony colombo <[email protected]> 
Description: Computes the necessary statistics for analysis using R 
License: GPL (>= 2) 
LinkingTo: Rcpp, RcppArmadillo 
RoxygenNote: 5.0.1 
NeedsCompilation: yes 

答えて

4

を使用するかどうかはわからない:

ここ

は、私がLinkingToを持っていますMakevars.win

# Use the R_HOME indirection to support installations of multiple R version 
PKG_LIBS = $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()") 
PKG_CXXFLAGS=`$(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::CxxFlags()") 

です

Syntax error: EOF in backquote substitution

PKG_CXXFLAGS=`$(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::CxxFlags()") 

スイッチそれに:

` 

Makevars.winの最後の行の先頭にある

PKG_CXXFLAGS=$(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::CxxFlags()") 

そして、あなたは黄金色にする必要があります。

ところで... You should switch over the LinkingTo: feature of Rcpp.これは非常に古い学校(ヴィンテージRcpp?)の方法です。

+0

ありがとうございます。私は今夜​​これをもう一度試してみます、これは解決策になるかもしれません。 – arcolombo

+1

'devtools :: build_win()'で今すぐ試してみてください! – coatless

+0

自分のLinuxパッケージをDropboxにコピーした後、パッケージをWindowsシステムにダウンロードしましたが、失敗しました。 Windowsシステムにパッケージをビルドする必要がありますか?Windows OSにインストールするには?ありがとうございました。 – arcolombo

関連する問題