简体   繁体   English

在Winbuild上编译R包时编译C ++错误

[英]C++ compiling error while compiling R package on Winbuild

My package (slfm) uses Rcpp to connect C++ code to R. Its check runs OK on linux, but I get this error when trying to compile it using WinBuild: 我的包(slfm)使用Rcpp将C ++代码连接到R.它的检查在linux上运行正常,但是在尝试使用WinBuild编译它时出现此错误:

* installing *source* package 'slfm' ...
** libs

*** arch - i386
g++  -I"D:/RCompile/recent/R-3.1.2/include"            -I"d:/RCompile/CRANpkg/lib/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include" -I"d:/Rcompile/CRANpkg/extralibs215/local215/include"     -O3 -Wall  -mtune=core2            -c RcppExports.cpp -o RcppExports.o
g++  -I"D:/RCompile/recent/R-3.1.2/include"            -I"d:/RCompile/CRANpkg/lib/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include" -I"d:/Rcompile/CRANpkg/extralibs215/local215/include"     -O3 -Wall  -mtune=core2            -c gibbs.cpp -o gibbs.o
g++ -shared -s -static-libgcc -o slfm.dll tmp.def RcppExports.o gibbs.o -Ld:/Rcompile/CRANpkg/extralibs215/local215/lib/i386 -Ld:/Rcompile/CRANpkg/extralibs215/local215/lib -LD:/RCompile/recent/R-3.1.2/bin/i386 -lR
gibbs.o:gibbs.cpp:(.text+0x125e): undefined reference to `ddot_'
gibbs.o:gibbs.cpp:(.text+0x1981): undefined reference to `dgemv_'
gibbs.o:gibbs.cpp:(.text+0x22f9): undefined reference to `dgemv_'
gibbs.o:gibbs.cpp:(.text$_ZN4arma10glue_times5applyIdLb0ELb0ELb0ENS_3MatIdEENS_3ColIdEEEEvRNS2_IT_EERKT3_RKT4_S6_[void arma::glue_times::apply<double, false, false, false, arma::Mat<double>, arma::Col<double> >(arma::Mat<double>&, arma::Mat<double> const&, arma::Col<double> const&, double)]+0x1bf): undefined reference to `dgemv_'
gibbs.o:gibbs.cpp:(.text$_ZN4arma10glue_times5applyIdLb1ELb0ELb0ENS_3ColIdEENS_3MatIdEEEEvRNS4_IT_EERKT3_RKT4_S6_[void arma::glue_times::apply<double, true, false, false, arma::Col<double>, arma::Mat<double> >(arma::Mat<double>&, arma::Col<double> const&, arma::Mat<double> const&, double)]+0x251): undefined reference to `dgemv_'
gibbs.o:gibbs.cpp:(.text$_ZN4arma4gemvILb1ELb0ELb0EE15apply_blas_typeIdNS_3MatIdEEEEvPT_RKT0_PKS5_S5_S5_[void arma::gemv<true, false, false>::apply_blas_type<double, arma::Mat<double> >(double*, arma::Mat<double> const&, double const*, double, double)]+0x87): undefined reference to `dgemv_'
collect2: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'slfm'
* removing 'd:/RCompile/CRANguest/R-release/lib/slfm'

Has anyone experienced it before? 以前有没有人经历过? Is it related to configuring Rcpp? 它与配置Rcpp有关吗? Strange thing is: I haven't changed anything on Rcpp configuration, just some simple lines on C++ code and it was running OK before. 奇怪的是:我没有改变任何关于Rcpp配置的东西,只是在C ++代码上的一些简单的行,它之前运行正常。 Version 0.1 in CRAN is stable. CRAN版本0.1稳定。

You are not linking with the LAPACK and BLAS libraries which are used by the code. 您没有链接代码使用的LAPACK和BLAS库。

Easiest fix: look at the Makefile.win created by the package skeleton generator. 最简单的修复:查看包骨架生成器创建的Makefile.win。

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

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