在Windows下构建项目,包括Rcpp和RInside

时间:2017-02-22 17:03:04

标签: r windows rcpp building rinside

这是一个编译问题。

该项目适用于Linux和OS X,必须移植到Windows。它使用RInside和Rcpp图书馆。

为此,我安装了R,Cygwin和RTools并编译了R librairies。它运作良好。

现在出现问题:

QMake步骤没有错误,但是建筑物退出时出错。我明白了:

error: [1]: No such file or directory
error: Rcpp:::CxxFlags(): Invalid argument
error: [1]: No such file or directory
error: RInside:::CxxFlags(): Invalid argument

长版:

17:18:36: Débute : "C:\Qt\Qt5.7.0\Tools\mingw530_32\bin\mingw32-make.exe" 
C:/Qt/Qt5.7.0/5.7/mingw53_32/bin/qmake.exe -spec win32-g++ CONFIG+=debug CONFIG+=qml_debug -o Makefile ../IHM/Rpp-IHM.pro
C:/Qt/Qt5.7.0/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/Henri/Desktop/rpp/src/build-Rpp-IHM-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
g++ -c -pipe -fno-keep-inline-dllexport -Wno-unused-parameter -IC:/Progz/R-3.3.2/include -IC:/Progz/R-3.3.2/include/x64 [1] "Rcpp:::CxxFlags()" [1] "RInside:::CxxFlags()" -g -std=gnu++11 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../IHM -I. -I../computer/RppUtils -I../computer/RppEngine -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtSvg -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtWidgets -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtGui -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtANGLE -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtCore -Idebug -IC:/Qt/Qt5.7.0/5.7/mingw53_32/mkspecs/win32-g++  -o debug/WrapperRppR.o ../IHM/WrapperRppR.cpp
g++.exe: error: [1]: No such file or directory
g++.exe: error: Rcpp:::CxxFlags(): Invalid argument
g++.exe: error: [1]: No such file or directory
g++.exe: error: RInside:::CxxFlags(): Invalid argument
Makefile.Debug:2914: recipe for target 'debug/WrapperRppR.o' failed
mingw32-make[1]: *** [debug/WrapperRppR.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/Henri/Desktop/rpp/src/build-Rpp-IHM-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
17:18:40: Le processus "C:\Qt\Qt5.7.0\Tools\mingw530_32\bin\mingw32-make.exe" s'est terminé avec le code 2.
Erreur lors de la compilation/déploiement du projet Rpp-IHM (kit : Desktop Qt 5.7.0 MinGW 32bit)
When executing step "Make"

事实上,尽管R_HOM变量设置为R的目录(这里:C:/Progz/R-3.3.2/),它似乎找不到RInside.h。 )。

这是.pro文件的一部分:

QT       += core gui svg

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET    = Rpp-IHM
TEMPLATE  = app
CONFIG   += c++11
CONFIG   += -v

## comment this out if you need a different version of R,
## and set set R_HOME accordingly as an environment variable
## R_HOM = $$system($$R_HOME)
win32 {
    #A specifier
    R_HOM = "C:/Progz/R-3.3.2/"
}
unix:!macx {
    # WORKING
    R_HOM = "/usr/lib/R/"
}
macx {
    # WORKING
    R_HOM =  "/Library/Frameworks/R.framework/Resources/"
}

## include headers and libraries for R
RCPPFLAGS =             $$system($$R_HOM/bin/R CMD config --cppflags)
RLDFLAGS =              $$system($$R_HOM/bin/R CMD config --ldflags)
RBLAS =                 $$system($$R_HOM/bin/R CMD config BLAS_LIBS)
RLAPACK =               $$system($$R_HOM/bin/R CMD config LAPACK_LIBS)

## if you need to set an rpath to R itself, also uncomment
RRPATH =               -Wl,-rpath,R_HOME/lib

## include headers and libraries for Rcpp interface classes
RCPPINCL =              $$system($$R_HOM/bin/Rscript -e \'Rcpp:::CxxFlags\(\)\')
RCPPLIBS =              $$system($$R_HOM/bin/Rscript -e \'Rcpp:::LdFlags\(\)\')

## for some reason when building with Qt we get this each time
## so we turn unused parameter warnings off
RCPPWARNING =           -Wno-unused-parameter
## include headers and libraries for RInside embedding classes
RINSIDEINCL =           $$system($$R_HOM/bin/Rscript -e \'RInside:::CxxFlags\(\)\')
RINSIDELIBS =           $$system($$R_HOM/bin/Rscript -e \'RInside:::LdFlags\(\)\')

INCLUDEPATH = ../computer/RppUtils
INCLUDEPATH += ../computer/RppEngine

## compiler etc settings used in default make rules
QMAKE_CXXFLAGS +=       $$RCPPWARNING $$RCPPFLAGS $$RCPPINCL $$RINSIDEINCL
QMAKE_LFLAGS +=         $$RLDFLAGS $$RBLAS $$RLAPACK $$RCPPLIBS $$RINSIDELIBS
QMAKE_CXXFLAGS_WARN_OFF += -Wunused-parameter

我错过了什么?

0 个答案:

没有答案