[Rcpp-devel] [rinside] compiling e QT + RInside on win7 have some problems

PO SU rdevelmail at 163.com
Sat Jun 20 07:39:50 CEST 2015


First, I forgot to say, My sys is Win 7 32 bit, and R is 3.1.2.
As mentioned a lot, Rcpp and RInside and Qt library seems should be built with the same compiler, and for i think i will have hudge trouble with compiling QT using Rtools GCC-4.6.3, so now, i tried compiling Rcpp and RInside with MingW 4.8.2(as my QT is 4.8.6 compiled with it),   and i am pretty sure that i am not using Rtools GCC-4.6.3 by setting PATH and inspecting the compiling output, but i failed once again, the output is as following which i can not figure it out due to my poor knowledge  (SUPO is my chinese name and '此时不应有' is chinese  which means 'At this point should not be'  or  something like that),:


----------- output begin here ------------------------------------

> install.packages("E:/STATISTICS/Rcpp_0.11.6.tar.gz", repos = NULL, type = "source", INSTALL_opts=c("--no-multiarch"))
* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
** libs
g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Date.cpp -o Date.o
g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Module.cpp -o Module.o
g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Rcpp_init.cpp -o Rcpp_init.o
g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c api.cpp -o api.o
g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c attributes.cpp -o attributes.o
g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c barrier.cpp -o barrier.o
process_begin: CreateProcess(NULL, basename Rcpp.dll .dll, ...) failed.
mingw32-make: C:/PROGRA~1/SUPO/R/R-31~1.2/share/make/winshlib.mk:11: pipe: No error
process_begin: CreateProcess(NULL, basename Rcpp.dll .dll, ...) failed.
mingw32-make: C:/PROGRA~1/SUPO/R/R-31~1.2/share/make/winshlib.mk:11: pipe: No error
process_begin: CreateProcess(NULL, basename Rcpp.dll .dll, ...) failed.
mingw32-make: C:/PROGRA~1/SUPO/R/R-31~1.2/share/make/winshlib.mk:11: pipe: No error
此时不应有 "zDate.o Module.o Rcpp_init.o api.o attributes.o barrier.o"。
C:/PROGRA~1/SUPO/R/R-31~1.2/share/make/winshlib.mk:11: recipe for target 'Rcpp.dll' failed
mingw32-make: *** [Rcpp.dll] Error 255
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/SUPO/R/R-31~1.2/etc/i386/Makeconf" -f "C:/PROGRA~1/SUPO/R/R-31~1.2/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="Rcpp.dll" OBJECTS="Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o"' had status 2
ERROR: compilation failed for package 'Rcpp'
* removing 'C:/Program Files/SUPO/R/R-3.1.2/library/Rcpp'
* restoring previous 'C:/Program Files/SUPO/R/R-3.1.2/library/Rcpp'
Warning in install.packages :
  running command '"C:/PROGRA~1/SUPO/R/R-31~1.2/bin/i386/R" CMD INSTALL --no-multiarch -l "C:\Program Files\SUPO\R\R-3.1.2\library" "E:/STATISTICS/Rcpp_0.11.6.tar.gz"' had status 1
Warning in install.packages :
  installation of package ‘E:/STATISTICS/Rcpp_0.11.6.tar.gz’ had non-zero exit status
---- output end here------------------------------


And , i aslo show this:

Status(RInside) Version 0.2.5 should build, install and run on just about any Linux and OS X system, and even on Windows machines that have the Rtools compiled by Duncan Murdoch as detailed in the The Windows Toolset appendix to the R Installation manual. Do not report an error if you fail to build this with another compiler as this is not supported. Note that to build the examples on Windows, you need to say make -f Makefile.win to explicitly selects its Makefile. RInside works particularly well with the Rcpp package for interfacing R and C++ and shown by the examples in the RInside distribution. In fact, it now depends on it too.
 
with the sentence  
 Do not report an error if you fail to build this with another compiler as this is not supported.


So, with the above sentence, i am worry about even i compiled the Rcpp and RInside uing MingW 4.8.2,  i could not still  compile the examples in RInside such as  "Hellow world". (As i said before, i run the example using Rcpp and RInside compiled by Rtools Gcc-4.6.3), but anyway, i should try using MingW 4.8.2 to compile Rcpp and RInside, so PLZ  help me.






--

PO SU
mail: desolator88 at 163.com
Majored in Statistics from SJTU




At 2015-06-20 08:00:35, "John Buonagurio" <jbuonagurio at exponent.com> wrote:
>I did this a couple years ago, so you may need to make some changes with the latest toolset, but the process was straightforward. Here are my general suggestions:
>
> - Use the Qt 4.8.6 binary distribution built with MinGW GCC 4.8.2: http://download.qt.io/archive/qt/4.8/4.8.6/qt-opensource-windows-x86-mingw482-4.8.6-1.exe.mirrorlist
> - Set your path to include the Rtools binaries and R, but not Rtools GCC-4.6.3, e.g. C:\Rtools\bin;C:\MinGW\bin;C:\R\R-3.2.1\bin
> - Build Rcpp and RInside from source using GCC 4.8.2. You may need to use R i386 and prevent x64 compilation, e.g.
>
>   install.packages("C:/Rcpp_0.11.6.tar.gz", repos=NULL, type="source", INSTALL_opts=c("--no-multiarch"))
>   install.packages("C:/RInside_0.2.13.tar.gz", repos=NULL, type="source", INSTALL_opts=c("--no-multiarch"))
>
> - Test with Dirk's qtdensity example. It worked for me with no changes using the included .pro file with qmake && make.
>
>Looks like you're close. Try the above and if you still have issues I'll give it a shot myself tomorrow.
>
>John
>
>> -----Original Message-----
>> From: rcpp-devel-bounces at lists.r-forge.r-project.org [mailto:rcpp-devel-
>> bounces at lists.r-forge.r-project.org] On Behalf Of PO SU
>> Sent: Friday, June 19, 2015 12:30 PM
>> To: rcpp-devel at lists.r-forge.r-project.org
>> Subject: [Rcpp-devel] [rinside] compiling e QT + RInside on win7 have some
>> problems
>> 
>> 
>> Dear expeRts,
>>      Recently, i am plan to write GUI with QT, and using R to compute models.
>> As i am quite new to this area, i searched a lot on the internet, after 2 days'
>> studing on the task, i still can not solve the problem, here is my problem in
>> details:
>> 
>> 
>> 1. My Rcpp and RInside compiled using Rtools GCC-4.6.3 g++.
>> 2. I can compile Rcpp and Rinside with C++ by using  Makefile.win and Rtools
>> GCC-4.6.3 g++.
>> 3. The point is QT, i used the 4.8.6 QT library for windows, and MingW 4.8.2. i
>> compile QT with RInside  failed by using either MingW or Rtools GCC-4.6.3
>> g++. (i used the .pro and qmake to generate Makefile.Release and make
>> the  Makefile.Release) , when i using MingW , compiled failed with a lot
>> undefined reference, wrhen i using Rtools , compile completed but can
>> not  run the EXE ( i did add the 4 dlls such as QTCORE4.DLL QTCUI4.DLL and so
>> on ), the comiple print some unused paramters warning and
>> warning:  base class 'class Rcpp::S4_Impl<Rcpp::PreserveStorage>' should be
>> explicitly initialized in copy constructor[-Wetra] ........
>> 
>> 
>> PLZ help me in details, i almost read everything i can find include a solution
>> that he say he comipled Rcpp and RInside with MingW 4.4 and solve the
>> problem, i wonder how did he compiled in details~~~ TKS!
>> 
>> 
>> 
>> --
>> 
>> PO SU
>> mail: desolator88 at 163.com
>> Majored in Statistics from SJTU
>> _______________________________________________
>> Rcpp-devel mailing list
>> Rcpp-devel at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


More information about the Rcpp-devel mailing list