Dear People, After considerable effort, I managed to install gcc-3.0 on my Debian system. However, Debian keeps gcc-2.95 around as the default compiler, and gcc, g++ point to the 2.95 version. The 3.0 versions need to be explicitly invoked as gcc-3.0, g++-3.0 etc. How can I get R CMD SHLIB to invoke gcc-3.0 instead of gcc and g++-3.0 instead of g++? I would like this to be done by default but only for R. That is, I would like everything except R CMD SHLIB to call the 2.95 versions by default, but have R CMD SHLIB to call the 3.0 versions by default. I didn't see this issue addressed in "Writing R Extensions". Is there a way to do this? Sincerely, Faheem Mitha. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian Ripley
2001-Nov-17 17:49 UTC
[R] choosing g/g++ compiler executable in R CMD SHLIB
On Sat, 17 Nov 2001, Faheem Mitha wrote:> > Dear People, > > After considerable effort, I managed to install gcc-3.0 on my Debian > system. However, Debian keeps gcc-2.95 around as the default compiler, and > gcc, g++ point to the 2.95 version. The 3.0 versions need to be explicitly > invoked as gcc-3.0, g++-3.0 etc. How can I get R CMD SHLIB to invoke > gcc-3.0 instead of gcc and g++-3.0 instead of g++? I would like this to be > done by default but only for R. That is, I would like everything except R > CMD SHLIB to call the 2.95 versions by default, but have R CMD SHLIB to > call the 3.0 versions by default. > > I didn't see this issue addressed in "Writing R Extensions". Is there a > way to do this?It's nothing to do with "Writing R Extensions": it is an installation issue. If you build R with CC=gcc-3.0, CXX=g++-3.0 then these will be recorded in RHOME/etc/Makeconf and used by R CMD SHLIB (at least, that works for me). I suspect manually editing that file will do what you want. However, a warning. FLIBS is also set at build time (configure time), and the correct specification for gcc 3.0.x is not the same as for gcc 2.95.x. I think it would be a lot safer to rebuild R under your favoured compilers. The FLIBS problem arises if compilers are updated so g77 refers to 3.0.x, BTW. It may not be relevant is you only want to compile C and C++. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dirk Eddelbuettel
2001-Nov-17 17:53 UTC
[R] choosing g/g++ compiler executable in R CMD SHLIB
"Faheem" == Faheem Mitha <faheem at email.unc.edu> writes: Faheem> Dear People, Faheem> Faheem> After considerable effort, I managed to install gcc-3.0 on my Faheem> Debian system. However, Debian keeps gcc-2.95 around as the default Provided you told apt about testing or unstable, all you need is $ apt-get update; apt-get install gcc-3.0 What is wrong with that? Faheem> compiler, and gcc, g++ point to the 2.95 version. The 3.0 versions Depends. Some architectures (hppa) only have the 3.0* branch of gcc. Faheem> need to be explicitly invoked as gcc-3.0, g++-3.0 etc. How can I Faheem> get R CMD SHLIB to invoke gcc-3.0 instead of gcc and g++-3.0 Faheem> instead of g++? I would like this to be done by default but only Faheem> for R. That is, I would like everything except R CMD SHLIB to call Faheem> the 2.95 versions by default, but have R CMD SHLIB to call the 3.0 Faheem> versions by default. One full-blown way is to re-configure and build R with these. An easy is to (provided you told apt about source archives) $ apt-get source r-base $ cd r-base-1.3.1 [ go off and edit debian/rules; just uncomment my stanza about using gcc/g++/g77-3.0 on i386 in lines 62-68 in the r-base_1.3.1-5 package currently in http://incoming.debian.org ] [ you also want to change debian/changelog to make the revision, say, 1.3.1-5local to protect it from being overwritten by the one from the archive ] $ fakeroot dpkg-buildpackage $ su -c "dpkg -i ../r-base_1.3.1-5local_i386.deb" and you should be all set. A more hackish way is to simply define CC=gcc-3.0, CXX=g++-3.0, FC=g77-3.0 and to export those. You will end up mixing gcc-2.95 and gcc-3.0, not sure if that works. Faheem> I didn't see this issue addressed in "Writing R Extensions". Is Faheem> there a way to do this? It is way too distribution-specific to be covered there, and almost too specific for this list. Hope this helps. Bug me privately if you need more help. Cheers, Dirk -- Better to have an approximate answer to the right question than a precise answer to the wrong question. -- John Tukey -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Reasonably Related Threads
- passing arguments to R CMD SHLIB
- using MAKEFLAGS in compiling C code as a shared library using R CMD SHLIB
- R CMD SHLIB uses foo.c instead of foo.cc if both are present (PR#2644)
- a couple of minor points about SHLIB
- loading compiled C++ code as shared library