繁体   English   中英

RccpGSL,在Windows 7上从R安装/使用GSL

[英]RccpGSL, installing/using GSL from R on windows 7

我习惯了R,但是我是C ++的完整入门者。 我很难安装GSL以便将其与R中的RcppGSL一起使用,以完善包含C ++代码的软件包。 我下载了最新的GSL版本,将其解压缩到C:/GSL ,将环境变量LIB_GSL设置为C:/GSL ,将PATHC:/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.

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