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