我的包(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'
之前有没有人经历过?它与配置Rcpp有关吗?奇怪的是:我没有改变任何关于Rcpp配置的东西,只是在C ++代码上的一些简单的行,它之前运行正常。 CRAN版本0.1稳定。
答案 0 :(得分:3)
您没有链接代码使用的LAPACK和BLAS库。
最简单的修复:查看包骨架生成器创建的Makefile.win。