简体   繁体   English

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

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

I'm used to R but I'm a complete beginner in C++. 我习惯了R,但是我是C ++的完整入门者。 I'm having a hard time installing GSL to use it with RcppGSL in R in order to refine a package comprising C++ code. 我很难安装GSL以便将其与R中的RcppGSL一起使用,以完善包含C ++代码的软件包。 I downloaded the latest GSL version, unpacked it to C:/GSL , set the environmental variable LIB_GSL to C:/GSL and the PATH to C:/GSL/bin . 我下载了最新的GSL版本,将其解压缩到C:/GSL ,将环境变量LIB_GSL设置为C:/GSL ,将PATHC:/GSL/bin

Like I said, I want to refine an existing package. 就像我说的,我想完善一个现有的程序包。 I've forked and pulled the latest version of the package in question from github. 我已经分叉并从github上提取了该软件包的最新版本。 My primary goal is simply to be able to use and refine the package. 我的主要目标只是能够使用和完善该程序包。 However, when I'm trying to make a source package out of the source files I get the following Error: 但是,当我尝试从源文件中制作源包时,出现以下错误:

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.

Sorry, there are a couple of german words in there: Warnung: Ausf hrung von Kommando==Warning:executing command 抱歉,里面有几个德语单词:Warnung:Ausf hrungvon Kommando ==警告:执行命令

What I realize is that R is trying to access the GSL library via the RcppGSL path. 我意识到R正在尝试通过RcppGSL路径访问GSL库。 Is that correct? 那是对的吗? Shouldn't it go directly to C:/GSL instead? 它不应该直接转到C:/ GSL吗? I also realized that R is trying to go to paths from both Rcpp as well as RcppGSL and I don't see why... 我还意识到R正在尝试从Rcpp以及RcppGSL都走到路径,我不明白为什么...

I would appreciate any clarification or suggestions on how to solve the problem. 对于解决问题的任何澄清或建议,我将不胜感激。

Thank you!!! 谢谢!!!

Please install the prebuild GSL version for R on Windows from the support site provided by Prof Ripley and then set these values accordingly in src/Makevars.win 请从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 

either directly, or set LIB_GSL accordingly. 要么直接设置, LIB_GSL相应地设置LIB_GSL

This is how CRAN builds the package, and it evidently works. 这就是CRAN构建程序包的方式,并且显然可以运行。

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

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