[Rcpp-devel] Rcpp 0.12.3 does not compile properly under Solaris 11.2/sparc Error: Could not find a match for std::wstring::basic_string(const char*, const char*) needed in
Dimitar Vassilev
dimitar.vassilev at gmail.com
Tue Feb 23 12:56:28 CET 2016
Thanks Rich,
I deinstalled gnu gcc and set the options you mention
> Sys.getenv();
CC /opt/solarisstudio12.4/bin/cc -xc99 -m64
CLASSPATH .
COLUMNS 237
CXX /opt/solarisstudio12.4/bin/CC -m64
-library=stlport4
CXX1XFLAGS -xO3 -m64 -std=c++11
CXXFLAGS -xO3 -m64 -std=c++03
EDITOR vi
HOME /root
HZ
JAVA_HOME /usr/local/java/jdk1.7.0
JE_BASE /usr/local/java
trying URL 'http://cran.uni-muenster.de/src/contrib/Rcpp_0.12.3.tar.gz'
Content type 'application/x-gzip' length 2374320 bytes (2.3 MB)
==================================================
downloaded 2.3 MB
* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/local/R/include -DNDEBUG -I../inst/include/ -KPIC -m64 -c
Date.cpp -o Date.o
/bin/bash: g++: command not found
gmake: *** [Date.o] Error 127
ERROR: compilation failed for package 'Rcpp'
* removing '/usr/local/R/library/Rcpp'
The downloaded source packages are in
'/tmp/Rtmp3xi9P7/downloaded_packages'
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("Rcpp") :
installation of package 'Rcpp' had non-zero exit status
-bash-4.1# echo $PATH
/opt/solarisstudio12.4/bin:/usr/local/java/jdk1.7.0/bin:/usr/sbin:/usr/bin:/usr/local/java/bin:/bin:/usr/sfw/bin/:/usr/xpg4/bin:/usr/xpg6/bin:/usr/local/texlive20150523/bin/sparc-solaris:/usr/gnu/bin
How one can specify explicitly the compilers he prefers? I tried exporting
CC and so on but, still the programs insist on using gcc.
My .Renviron is
options(internet.info = 0)
TZ=CET
TERM=vt220
TAR=/usr/bin/tar
R_UNZIPCMD=/usr/bin/unzip
R_ZIPCMD=/usr/bin/zip
MAKE=/usr/bin/make
LD_LIBRARY_PATH=/lib:/usr/lib:/opt/solarisstudio12.4/lib/:/usr/local/R/lib:/lib:/usr/local/lib
PAGER=/usr/bin/less
R_BZIPCMD=/usr/bin/bzip2
R_GZIPCMD=/usr/bin/gzip
CXXFLAGS = -xO3 -m64 -std=c++03
CXX1XFLAGS = -xO3 -m64 -std=c++11
SHLIB_CXXLDFLAGS = -G -lstdc++ -lgcc_s -lCrunG3 -lrt -lm -lc
SHLIB_CXX1XLDFLAGS = -G -lstdc++ -lgcc_s -lCrunG3 -lrt -lm -lc
LDFLAGS = -norunpath -m64 -KPIC -DPIC -lc
-L/opt/solarisstudio12.4/lib/sparcv9 -R/opt/solarisstudio12.4/lib/sparcv9
-lsunperf -lfsu -lmtsk -lpicl -lkstat -L/usr/local/R/lib -R/usr/local/R/lib
CC = /opt/solarisstudio12.4/bin/cc -xc99 -m64
CXX = /opt/solarisstudio12.4/bin/CC -m64 -library=stlport4
gcc=${CC}
2016-02-22 7:42 GMT+01:00 Rich Burridge <rich.burridge at oracle.com>:
>
>
> On 9th Feb 2016, Dimitar Vassilev wrote:
> > I'm building on top of Oracle R Community edition 3.2, Sun Studio 12.4
> > and Solaris 11.2 some packages for internal use.
> > The error I get when trying to install Rcpp is:
> > ...
>
> On 9th Feb 2016, Dirk Eddelbuettel wrote:
> > The problem is likely the Sun Studio compiler.
> > ...
> > We are doing things in C++ which are standard now, but for which Sun
> > Studio does not seem to have caught up.
> >
> > Maybe you need to look into installing the gcc toolchain.
>
> Rcpp works just fine with the Studio compiler as long as R was built
> correctly. Unfortunately the Oracle R Community edition 3.2 isn't correctly
> handling C++ compilations.
>
> I'm in a different group within Oracle, and we will be providing the base
> R distribution (plus recommended packages) as native IPS packages in the
> Userland consolidation in Solaris 12.
>
> You can see this work under:
>
>
> https://java.net/projects/solaris-userland/sources/gate/show/components/r?rev=5476
>
> C++ compilation (for building packages such as Rcpp) works just fine
>
> The short answer is that you need to correctly configure R so that it
> uses the correct C++ build and link options. Here's what we've got for
> our 64-bit SPARC version:
>
> CXXFLAGS = -xO3 -m64 -std=c++03
> CXX1XFLAGS = -xO3 -m64 -std=c++11
> LDFLAGS = -norunpath -m64 -KPIC -DPIC -lc -L/usr/lib/studio/64
> -R/usr/lib/studio/64 -lsunperf -lfsu -lmtsk -lpicl -lkstat
> -L/usr/lib/sparcv9/R/lib -R/usr/lib/sparcv9/R/lib
> SHLIB_CXXLDFLAGS = -G -lstdc++ -lgcc_s -lCrunG3 -lrt -lm -lc
> SHLIB_CXX1XLDFLAGS = -G -lstdc++ -lgcc_s -lCrunG3 -lrt -lm -lc
>
> You might be able to simply adjust these lines accordingly in your
> installed /usr/lib/sparcv9/R/etc/Makeconf file (potentially allowing
> for the Oracle R Community edition having slightly different library
> paths) and then try:
>
> > install.packages("Rcpp")
>
> and see if that fixes the problem.
>
> (Note that the default library is not very standard-conforming.
> This uses gcc compatibility mode with the g++ runtime libraries
> to get the code to compile and then links against the gcc runtime
> libraries).
>
> If you have an email channel to the Oracle R Community edition 3.2
> developers, I suggest letting them know that they need to provide
> similar changes to the way that they build their R distribution.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20160223/59f84383/attachment.html>
More information about the Rcpp-devel
mailing list