![](/img/trans.png)
[英]RccpArmadillo and RccpGSL not loading in RStudio in Windows
[英]RccpGSL, installing/using GSL from R on windows 7
我習慣了R,但是我是C ++的完整入門者。 我很難安裝GSL以便將其與R中的RcppGSL一起使用,以完善包含C ++代碼的軟件包。 我下載了最新的GSL版本,將其解壓縮到C:/GSL
,將環境變量LIB_GSL
設置為C:/GSL
,將PATH
為C:/GSL/bin
。
就像我說的,我想完善一個現有的程序包。 我已經分叉並從github上提取了該軟件包的最新版本。 我的主要目標只是能夠使用和完善該程序包。 但是,當我嘗試從源文件中制作源包時,出現以下錯誤:
Installing to library 'C:/Users/Simon/Documents/R/win-library/3.1'
* installing *source* package 'Rflim' ...
** libs
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/Simon/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -IC:/Users/Simon/Documents/R/win-library/3.1/Rcpp/include -I/usr/local/include -I C:/Users/Simon/Documents/R/win-library/3.1/RcppGSL/include -O2 -Wall -mtune=core2 -c flim.cpp -o flim.o
In file included from C:/Users/Simon/Documents/R/win-library/3.1/RcppGSL/include/RcppGSL.h:23:0,
from flim.cpp:1:
C:/Users/Simon/Documents/R/win-library/3.1/RcppGSL/include/RcppGSLForward.h:26:29: fatal error: gsl/gsl_vector.h: No such file or directory
compilation terminated.
make: *** [flim.o] Error 1
Warnung: Ausf�hrung von Kommando 'make -f "Makevars" -f "C:/PROGRA~1/R/R-31~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-31~1.2/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="Rflim.dll" WIN=64 TCLBIN=64 OBJECTS="flim.o"' ergab Status 2
ERROR: compilation failed for package 'Rflim'
* removing 'C:/Users/Simon/Documents/R/win-library/3.1/Rflim'
Exited with status 1.
抱歉,里面有幾個德語單詞:Warnung:Ausf hrungvon Kommando ==警告:執行命令
我意識到R正在嘗試通過RcppGSL路徑訪問GSL庫。 那是對的嗎? 它不應該直接轉到C:/ GSL嗎? 我還意識到R正在嘗試從Rcpp以及RcppGSL都走到路徑,我不明白為什么...
對於解決問題的任何澄清或建議,我將不勝感激。
謝謝!!!
請從Ripley教授提供的支持站點在Windows上安裝R的預構建GSL版本,然后在src/Makevars.win
相應地設置這些值。
## This assumes that the LIB_GSL variable points to working GSL libraries
PKG_CPPFLAGS=-I$(LIB_GSL)/include -I../inst/include
PKG_LIBS=-L$(LIB_GSL)/lib -lgsl -lgslcblas
要么直接設置, LIB_GSL
相應地設置LIB_GSL
。
這就是CRAN構建程序包的方式,並且顯然可以運行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.