[Rcpp-devel] [rinside] compiling e QT + RInside on win7 have some problems
PO SU
rdevelmail at 163.com
Mon Jun 22 17:46:19 CEST 2015
Dear John Buonagurio,
Tks a lot for your guide, finally, i make it success to run the qtdensity example, i think there is a lot of details should be careful to get it work. I even do not know why it works now exactly(the order path setted in PATH may be a key point). Although i can not remember the details, i will list the environment for me to run the qtdensity:
1. win 7 32 bits;R 3.1.2( and the corresponding R tools);MingW 4.8.2; QT 4.8.6 for windows compiled by MingW 4.8.2,also Rcpp, RInside source codes,
2.(MAY BE as I said ) make sure to remove R tools\gcc-4.6.3\bin in PATH when compiling, that is , not just put the MingW 4.8.2\bin in PATH before it(this point may not be correct, but you should try to follow it when you don not familiar with the process, i say this because when you install R tools in windows, the path of R tools may be automaticly setted in PATH, thus, when you compile Rcpp and RInside, the compile may automaticly use the R tools Gcc 4.6.3, so i think for new user, the easiest thing is to remove it when compiling)
3. Set "C:\Rtools\bin;C:\mingw-w64-gcc-4.8.2-stable-r10\bin;C:\R\R-3.1.2\bin" in PATH with the exact order.(The version of MingW 4.8.2 I used is the version when you install QT 4.8.6, the installer will give a hint for you before install it, the hint will remind you to use MingW 4.8.2 and give a URL to download it , and i used that version)
4.compile Rcpp and RInside using:
install.packages("Rcpp_xxx.tar.gz", repos = NULL, type = "source", INSTALL_opts=c("--no-multiarch")) or install.packages("Rcpp", type = "source", INSTALL_opts=c("--no-multiarch"))
I think both will work, as i compiled Rcpp in the first format, and RInside the latter one.(the latter one in fact will download the source first then do the same thing with the first one)
5. If your R is installed in a path have spaces like what i have:C:\Program Files\SUPO\R\R-3.1.2, you should be carefully with the path, because the Makefiles and .pro files will have some problems to do the correct thing, actually, i modified the .pro file with the following sentence:
RINSIDEINCL = $$system($$R_HOME/bin/Rscript -e \"RInside:::CxxFlags\(\)\")
to:
RINSIDEINCL = -I"C:/PROGRA~1/SUPO/R/R-31~1.2/library/RInside/include"
Because, however, the RInside:::CxxFlags() return a :C:\Program Files\ in my PC, and the Makefile seems failing to make it correct, so i modify this myself, otherwise you will get some errors.
6. Following qtdensity example guides, Finally, i think you should run the qtdensity example.like me.
NB: the above steps are not the whole process, you should check the above steps based on you tried the original steps introduced by the author Dirk Eddelbuettel.
--
PO SU
mail: desolator88 at 163.com
Majored in Statistics from SJTU
At 2015-06-22 21:44:28, "John Buonagurio" <jbuonagurio at exponent.com> wrote:
>Su Po,
>
>I just compiled and ran qtdensity using the toolchain I described and R 3.1.2 with no issues. I'm using "mingw-w64-gcc-4.8.2-stable-r10.7z" from files.1f0.de/mingw/
>
>I see a couple issues:
>
>> mingw32-make: *** [Rcpp.dll] Error 255
>
>You should be using make.exe from Rtools here. Make sure your path is set appropriately. Rtools binaries first, then MinGW 4.8.2, then R, e.g. "C:\Rtools\bin;C:\mingw-w64-gcc-4.8.2-stable-r10\bin;C:\R\R-3.1.2\bin;"
>
>> g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG
>
>Generally good practice to install R in a directory with no spaces.
>
>I understand that only the Rtools MinGW distribution is supported for RInside, but you need to use GCC 4.8.2 to get QT+RInside working on Windows.
>
>John
>
>> -----Original Message-----
>> From: PO SU [mailto:rdevelmail at 163.com]
>> Sent: Saturday, June 20, 2015 1:40 AM
>> To: John Buonagurio
>> Cc: rcpp-devel at lists.r-forge.r-project.org
>> Subject: Re:RE: [Rcpp-devel] [rinside] compiling e QT + RInside on win7 have
>> some problems
>>
>>
>> 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
>> g++ -I../inst/include/
>> g++ -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall
>> g++ -mtune=core2 -c Date.cpp -o Date.o
>> g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG
>> g++ -I../inst/include/
>> g++ -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall
>> g++ -mtune=core2 -c Module.cpp -o Module.o
>> g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG
>> g++ -I../inst/include/
>> g++ -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall
>> g++ -mtune=core2 -c Rcpp_init.cpp -o Rcpp_init.o
>> g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG
>> g++ -I../inst/include/
>> g++ -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall
>> g++ -mtune=core2 -c api.cpp -o api.o
>> g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG
>> g++ -I../inst/include/
>> g++ -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall
>> g++ -mtune=core2 -c attributes.cpp -o attributes.o
>> g++ -m32 -I"C:/PROGRA~1/SUPO/R/R-31~1.2/include" -DNDEBUG
>> g++ -I../inst/include/
>> g++ -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall
>> g++ -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
>
More information about the Rcpp-devel
mailing list