[Rcpp-devel] RcppArmadillo solve function, dyn.load error

Ayn Leslie-Cook aynlc3 at uw.edu
Sun May 6 23:38:58 CEST 2012


Hi all,

I'm a student at the University of Washington and my course project this
spring involves rewriting the 'svmpath' R package into C++ using Rcpp and
RccpArmadillo.  Everything runs beautifully until I try to include the
function below:

vec solveKstar(mat Kstar){
  vec onestar = ones<vec>(Kstar.n_cols);

onestar[0]=0;

  vec
solution;

  solution=solve(trimatu(Kstar),onestar);
  return solution;
}

If I run R CMD INSTALL on my package removing the call to 'solve'
everything runs fine, but if I included the call to 'solve' then the R CMD
INSTALL input is


// all the typical output

* installing to library ‘/net/home/aynlc3/Rlib’
* installing *source* package ‘aynSVMpath’ ...
** libs
g++ -I/usr/share/R/include -DNDEBUG
-I"/net/home/aynlc3/Rlib/Rcpp/include"
-I"/net/home/aynlc3/Rlib/RcppArmadillo/include"   -fpic  -O3 -pipe  -g  -c
aynSVMpath.cpp -o aynSVMpath.o
g++ -I/usr/share/R/include -DNDEBUG
-I"/net/home/aynlc3/Rlib/Rcpp/include"
-I"/net/home/aynlc3/Rlib/RcppArmadillo/include"   -fpic  -O3 -pipe  -g  -c
svmHelpers.cpp -o svmHelpers.o
g++ -shared -o aynSVMpath.so aynSVMpath.o initializations.o svmHelpers.o
usetFunctions.o -L/net/home/aynlc3/Rlib/Rcpp/lib -lRcpp
-Wl,-rpath,/net/home/aynlc3/Rlib/Rcpp/lib -L/usr/lib/R/lib -lR
installing to /net/home/aynlc3/Rlib/aynSVMpath/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded

           // then

Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object
'/net/home/aynlc3/Rlib/aynSVMpath/libs/aynSVMpath.so':
  /net/home/aynlc3/Rlib/aynSVMpath/libs/aynSVMpath.so: undefined symbol:
dtrtrs_


If I change 3rd and 4th lines of the 'solveKstar' function to:

  vec
solution;

  solution=solve(Kstar,onestar);    // removing the call to 'trimatu'

the R CMD INSTALL output has the same typical output above, but with the
following change to the error

Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object
'/net/home/aynlc3/Rlib/aynSVMpath/libs/aynSVMpath.so':
  /net/home/aynlc3/Rlib/aynSVMpath/libs/aynSVMpath.so: undefined symbol:
dgels_


The symbols 'dtrtrs_' and 'dgels_' are not part of my code;  from digging
online, I believe these are coming from the lapack library, but I'm not
sure how to proceed with that knowledge.  Does anyone have any advice?

 Also, if relevant, I'm running R 2.15.0, Rcpp_0.9.10 and
RcppArmadillo_0.3.0.2 on mosix.

Many thanks,

Ayn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120506/84fd147d/attachment.html>


More information about the Rcpp-devel mailing list