[Rcpp-devel] Unable to load shared object

Jules Archer jules.archer at ymail.com
Wed Jul 10 20:18:48 CEST 2013


Dirk,

Thank you for your fast reply!

With regard to your specific suggestions:

|Two suggestions.  First, try creating a simple package without MathGL just to
|make sure you have that process of going from sourceCpp via compileAttributes
|to a package licked.  

Yes, I did successfully create a simple package (using RStudio) as a "warm-up" exercise (I created a package for the
classic gibbs.cpp function). I can load the package, and use the gibbs function as expected.

|Second, and as an alternative, try it the other way
|without attributes.  There are a number of simple package that link to
|external libraries; you could pick any as an example. 

I'm not quite sure what you mean by this one. Could you please give me a brief description/procedure as to how to do this? (I'm still a bit of 
a newbie with Rcpp...)


|The linmk error rings a faint bell, but I cannot quite connect the dots. You
|don't by chance have two version of Rcpp installed -- in /usr/local and below
|/home/hp, say?


No, I don't have two versions installed. Just to be sure, I removed what I had and re-installed (actually upgraded to 0.10.4). Same issue...


After going some googling on this, the consensus seems to be that there's something awry with ldconfig or LD_LIBRARY_PATH environment variable setting.

Thanks!


________________________________
 From: Dirk Eddelbuettel <edd at debian.org>
To: Jules Archer <jules.archer at ymail.com> 
Cc: "rcpp-devel at lists.r-forge.r-project.org" <rcpp-devel at lists.r-forge.r-project.org> 
Sent: Tuesday, July 9, 2013 10:35 PM
Subject: Re: [Rcpp-devel] (no subject)
 


Hi Jules,

On 9 July 2013 at 22:16, Jules Archer wrote:
| Hi,
| 
| I've been trying to integrate the mathGL plotting library into R with Rcpp,
| with the ultimate goal of rendering in the browser.  So far, I've been
| successful with creating simple plotting test functions, compile with sourceCpp
| ("myplotter.cpp") and output *.png and *.json files for browser 3D plotting. 

Cool.

| However, when I try to compile as an R package, I keep getting the following
| error:
| 
| ** building package indices
| ** testing if installed package can be loaded
| Error in dyn.load(file, DLLpath = DLLpath, ...) : 
|   unable to load shared object '/usr/local/lib/R/site-library/mathGL/libs/
| mathGL.so':
|   /usr/local/lib/R/site-library/mathGL/libs/mathGL.so: undefined symbol:
| _ZTIN4Rcpp14not_compatibleE
| Error: loading failed
| Execution halted
| ERROR: loading failed
| 
| The mathGL.so library was created and exists. For reference, I'm using the
| following flags in the Makevars file:
| 
| PKG_CXXFLAGS=-"I/home/hp/Downloads/mathgl-2.1/include/mgl2" -lmgl
| PKG_LIBS=-L/usr/local/lib/
| 
| Any ideas or thoughts as to what the "undefined symbol" error means and how to
| resolve this would be greatly appreciated.

Two suggestions.  First, try creating a simple package without MathGL just to
make sure you have that process of going from sourceCpp via compileAttributes
to a package licked.  Second, and as an alternative, try it the other way
without attributes.  There are a number of simple package that link to
external libraries; you could pick any as an example. 

The linmk error rings a faint bell, but I cannot quite connect the dots. You
don't by chance have two version of Rcpp installed -- in /usr/local and below
/home/hp, say?

Dirk

| Thanks!
| 
| ----------------------------------------------------------------------
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130710/d546b4b0/attachment.html>


More information about the Rcpp-devel mailing list