[Rcpp-devel] Installing RcppArmadillo under Ubuntu 10.10

Douglas Bates bates at stat.wisc.edu
Wed Feb 9 16:16:14 CET 2011


On Tue, Feb 8, 2011 at 3:49 PM, Douglas Bates <bates at stat.wisc.edu> wrote:
> On Tue, Feb 8, 2011 at 2:54 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
>>
>> On 8 February 2011 at 14:39, Douglas Bates wrote:
>> | On Tue, Feb 8, 2011 at 1:55 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
>> |
>> | > On 8 February 2011 at 13:42, Douglas Bates wrote:
>> | > | I'm back to "it's not your night, kid".  I seem to be unable to
>> | > | install the RcppArmadillo package under Ubuntu 10.10 with R-2.12.1
>> | > | installed from the packages on CRAN.  The compilation goes fine but
>> | > | the package can't be loaded because the symbol
>> | > | arma::arma_version::major is undefined.  It should have been defined
>> | > | as a static unsigned int in
>> | > | RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp and is
>> | > | indeed used in RcppArmadillo/src/RcppArmadillo.cpp.  The output from
>> | > | the attempted installation is enclosed.
>> |
>> | > What does ldd say when you point at .so file that fails to load?  Do you
>> | > maybe have an old .deb package for Armadillo hanging around?
>> |
>> | The ldd output is
>> |       linux-vdso.so.1 =>  (0x00007fffcddff000)
>> |       libRcpp.so => /home/bates/R/x86_64-pc-linux-gnu-library/2.12/Rcpp/lib/libRcpp.so
>> | (0x00007fea656ee000)
>> |       liblapack.so.3gf => /usr/lib/liblapack.so.3gf (0x00007fea64ab8000)
>> |       libblas.so.3gf => /usr/lib/libblas.so.3gf (0x00007fea64573000)
>> |       libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x00007fea6428f000)
>> |       libR.so => /usr/lib/libR.so (0x00007fea63d30000)
>> |       libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fea63a29000)
>> |       libm.so.6 => /lib/libm.so.6 (0x00007fea637a6000)
>> |       libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fea63590000)
>> |       libc.so.6 => /lib/libc.so.6 (0x00007fea6320c000)
>> |       libpthread.so.0 => /lib/libpthread.so.0 (0x00007fea62fef000)
>> |       libreadline.so.6 => /lib/libreadline.so.6 (0x00007fea62dae000)
>> |       libpcre.so.3 => /lib/libpcre.so.3 (0x00007fea62b7c000)
>> |       liblzma.so.2 => /usr/lib/liblzma.so.2 (0x00007fea6295a000)
>> |       libbz2.so.1.0 => /lib/libbz2.so.1.0 (0x00007fea62749000)
>> |       libz.so.1 => /lib/libz.so.1 (0x00007fea62530000)
>> |       libdl.so.2 => /lib/libdl.so.2 (0x00007fea6232c000)
>> |       /lib64/ld-linux-x86-64.so.2 (0x00007fea65b96000)
>> |       libncurses.so.5 => /lib/libncurses.so.5 (0x00007fea620e8000)
>> |
>> | but armadillo shouldn't show up in ldd because it is only headers,
>>
>> Correct, brain fart on my part.
>>
>> | right?  The output of nm -g applied to that shared object does list
>> | the major, minor and patch members of the arma_version struct but has
>> | them as undefined
>> |
>> |                  U _ZN4arma12arma_version5majorE
>> |                  U _ZN4arma12arma_version5minorE
>> |                  U _ZN4arma12arma_version5patchE
>> |
>> | I checked and I don't have any of the Ubuntu packages associated with
>> | armadillo installed.
>> |
>> | I really don't know what is going on.
>>
>> I don't have them!
>>
>> edd at max:~$ nm /usr/local/lib/R/site-library/RcppArmadillo/libs/RcppArmadillo.so | wc -l
>> 218
>> edd at max:~$ nm /usr/local/lib/R/site-library/RcppArmadillo/libs/RcppArmadillo.so | grep version
>> 0000000000004ba0 T armadillo_version
>> edd at max:~$
>
> And I shouldn't have them either.  What should happen during the
> compilation is that RcppArmadillo.cpp includes RcppArmadillo.h, which
> should be found in ../inst/include, which, in turn, includes
> RcppArmadilloForward.h (also in ../inst/include) which includes
> armadillo which includes armadillo_bits/arma_version.hpp which defines
> the arma::arma_version struct with those static unsigned ints.  I
> don't know why that doesn't happen.  If I add the -E flag to the
> compiler call it does get included
>
> # 113 "../inst/include/armadillo" 2
> # 1 "../inst/include/armadillo_bits/arma_version.hpp" 1
> # 26 "../inst/include/armadillo_bits/arma_version.hpp"
> struct arma_version
>  {
>  static const unsigned int major = 1;
>  static const unsigned int minor = 1;
>  static const unsigned int patch = 0;
>
>  static
>  inline
>  std::string
>  as_string()
>    {
>    const char* nickname = "Climate Vandal";
>
>    std::stringstream ss;
>    ss << arma_version::major
>       << '.'
>       << arma_version::minor
>       << '.'
>       << arma_version::patch
>       << " ("
>       << nickname
>       << ')';
>
>    return ss.str();
>    }
>  };
>
> I guess my compiler just doesn't like me.

Actually it's my compiler options that don't like me.  I was using the
-ggdb option to g++ instead of -g.  When i switched back to -g I could
compile and load RcppArmadillo.

>> Could you have an old file hanging around or something?
>>
>> Dirk
>>
>> --
>> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
>>
>


More information about the Rcpp-devel mailing list