[Rcpp-devel] configure

Dirk Eddelbuettel edd at debian.org
Fri Jan 8 13:37:57 CET 2010


Basic configure support to detect g++ versions has been added.  This
currently only sets PKG_CXXFLAGS to include (or not) the magic -std=c++0x but
that is all we need so far.  And it may make for an easy example :)

edd at ron:~/svn/rcpp/pkg$ autoconf          
edd at ron:~/svn/rcpp/pkg$ CXX=g++-4.2 ./configure  
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++-4.2 accepts -g... yes
checking how to run the C++ preprocessor... g++-4.2 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++-4.2 accepts -g... (cached) yes
configure: WARNING: With g++ version 4.2 core functionality should be stable.
checking for R... yes
checking for Rscript... yes
configure: creating ./config.status
config.status: creating src/Makevars
Completed configuration and ready to build.
edd at ron:~/svn/rcpp/pkg$ grep PKG_CXX src/Makevars
PKG_CXXFLAGS += -g -O2
edd at ron:~/svn/rcpp/pkg$ ./configure
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
configure: WARNING: With g++ version 4.3 parts of the new Cxx0x standard are available.
checking for R... yes
checking for Rscript... yes
configure: creating ./config.status
config.status: creating src/Makevars
Completed configuration and ready to build.
edd at ron:~/svn/rcpp/pkg$ grep PKG_CXX src/Makevars
PKG_CXXFLAGS += -g -O2 -std=c++0x
edd at ron:~/svn/rcpp/pkg$ CXX=g++-4.4 ./configure
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++-4.4 accepts -g... yes
checking how to run the C++ preprocessor... g++-4.4 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++-4.4 accepts -g... (cached) yes
configure: WARNING: With g++ version 4.4 or newer more parts of the new Cxx0x standard are available.
checking for R... yes
checking for Rscript... yes
configure: creating ./config.status
config.status: creating src/Makevars
Completed configuration and ready to build.
edd at ron:~/svn/rcpp/pkg$ grep PKG_CXX src/Makevars
PKG_CXXFLAGS += -g -O2 -std=c++0x
edd at ron:~/svn/rcpp/pkg$

The 'messaging' ie the 'configure: WARNING' could be improved.  I don't know
to do it with a configure macro with the WARNING bit -- could simply switch
to echo...

And I don't quite know yet what to do on Windows. I say for now just hardcode
one way or the other.  We could simple ask Uwe / Stefan what compilers CRAN
and R-Forge use...

Dirk

-- 
Three out of two people have difficulties with fractions.


More information about the Rcpp-devel mailing list