[Rcpp-devel] Unable to install RcppArmadillo from CRAN or from SVN archive on Ubuntu 10.10

Jan de Leeuw deleeuw at stat.ucla.edu
Fri Apr 29 15:40:37 CEST 2011


On my machine RcppArmadillo compiles/links fine with

deleeuw at cuddyPro:~/Desktop/ > /usr/local/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin11/4.7.0/lto-wrapper
Target: x86_64-apple-darwin11
Configured with: ../gcc-4.5-trunk/configure --build=x86_64-apple-darwin11 --host=x86_64-apple-darwin11 --target=x86_64-apple-darwin11 --enable-languages=c++,fortran --prefix=/usr/local --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local
Thread model: posix
gcc version 4.7.0 20110424 (experimental) (GCC) 

but it compiles but refuses to link with

deleeuw at cuddyPro:~/Desktop/ > /usr/bin/g++ -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /var/tmp/llvmgcc42/llvmgcc42-2335.11~3/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/var/tmp/llvmgcc42/llvmgcc42-2335.11~3/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.11.00)

It also works fine with

deleeuw at cuddyPro:~/Desktop/ > /usr/bin/gcc-4.2 -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /var/tmp/gcc/gcc-5666.3~168/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)

So it may be the LLVM g++ compiler (note that this is a developer version which has not been released yet, comes with Xcode 4.1) or an unfortunate interaction of that compiler with libraries in /usr/local. For now, I will rebuild my R with clang, gfortran-4.7.0, and the stock (non-LLVM) g++ compiler from Apple.


On Apr 29, 2011, at 06:18 , Dirk Eddelbuettel wrote:

> 
> On 29 April 2011 at 22:56, Conrad Sanderson wrote:
> | Sorry, I don't know what's going on.  As far as I know, the structure
> | "arma_version" (as defined in the file
> | "include/armadillo_bits/arma_version.hpp") is following the C++
> | standard.  Please double check and let me know if it's not right.
> | 
> | If the structure is giving trouble and it's not really used in Rcpp,
> | perhaps it's best just to remove it ?
> 
> Thanks for the feedback.  And yes, by not referencing it from
> src/RcppArmadillo.cpp  we could avoid the issue---and Jan and Doug can try
> commenting this out in the short function armadillo_version to avoid the
> linker issue, at least for a test.
> 
> We may well have to consider removing this code bit (which we don't really
> need any more and only needed in the past) but it feels wrong to declare
> defeat to the compiler this way.
> 
> Dirk
> 
> 
> | 
> | 
> | On 29 April 2011 22:35, Dirk Eddelbuettel <edd at debian.org> wrote:
> | >
> | > (Conrad, This started as this thread
> | >    http://thread.gmane.org/gmane.comp.lang.r.rcpp/1877
> | >  which picks up the issue first reported by Jan regaring arma_version not
> | >  being found by the linker and which you commented on so colourfully a few
> | >  days ago.)
> | >
> | >
> | > On 28 April 2011 at 13:38, Jan de Leeuw wrote:
> | > | And I have armadillo-1.2.0 compiled from source on the Mac in /usr/local
> | > |
> | > | But removing the include and lib files does not help
> | >
> | > So just as a reference point, I did have Ubuntu's libarmadillo(0,-dev-doc)
> | > installed but both before and after purgeing them, I can do 'R CMD check
> | > RcppArmadillo' just fine against the SVN sources.  Dito for R CMD INSTALL.
> | >
> | > So I don't what's going on -- there should not be an issue building this.
> | > And on my end (and Romain's for that matter) it worked before and after the
> | > suggested by Conrad to use arma::version::major etc directly.
> | >
> | > So I really don't know
> | >
> | >   a) what is going on with Doug's setup as I use a very similar machine /
> | >      setup on my Ubuntu box --- but then Doug unfortunately had build issues
> | >      with related code on his box but not on mine, and
> | >
> | >   b) what is going on Jan's Mac -- other than Conrad's earlier colourful
> | >      remarks about maybe something being fishy with the OS X compiler, but
> | >      that is just a guess too.
> | >
> | > Also, a simple check (see below) builds fine here. The RcppArmadillo package
> | > really does nothing much different than this check: access the elements of
> | > that struct.
> | >
> | > So I remain rather puzzled.  One local build issue I could live with, but
> | > that both Doug and Jan have issues is a little strange.  But as I said:
> | > nothing I can replicate at my end. This should just work.
> | >
> | > Dirk
> | >
> | >
> | > edd at max:~/svn/rcpp/pkg/RcppArmadillo/inst/include$ cat /tmp/quickCheck.cpp
> | >
> | > #include <armadillo>
> | >
> | > int main(void) {
> | >  std::cout << "Seeing " << arma::arma_version::major
> | >            << "." << arma::arma_version::minor
> | >            << "." << arma::arma_version::patch << std::endl;
> | > }
> | > edd at max:~/svn/rcpp/pkg/RcppArmadillo/inst/include$ g++ -I. -o /tmp/quickCheck /tmp/quickCheck.cpp
> | > edd at max:~/svn/rcpp/pkg/RcppArmadillo/inst/include$ /tmp/quickCheck
> | > Seeing 1.2.0
> | > edd at max:~/svn/rcpp/pkg/RcppArmadillo/inst/include$
> 
> -- 
> Gauss once played himself in a zero-sum game and won $50.
>                      -- #11 at http://www.gaussfacts.com
> 

===
Jan de Leeuw; Distinguished Professor and Chair, UCLA Department of Statistics;
Director: UCLA Center for Environmental Statistics (CES);
Editor: Journal of Multivariate Analysis, Journal of Statistical Software;
US mail: 8125 Math Sciences Bldg, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw at stat.ucla.edu
.mac: jdeleeuw ++++++  aim: deleeuwjan ++++++ skype: j_deleeuw
homepages: http://gifi.stat.ucla.edu ++++++ http://www.cuddyvalley.org
 -------------------------------------------------------------------------------------------------
          No matter where you go, there you are. --- Buckaroo Banzai
                   http://gifi.stat.ucla.edu/sounds/nomatter.au                                  
 -------------------------------------------------------------------------------------------------        







More information about the Rcpp-devel mailing list