From ripley at stats.ox.ac.uk  Sat Jul 21 10:04:03 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat, 21 Jul 2007 09:04:03 +0100 (BST)
Subject: [Rd] unable to load shared library: undefined symbol
In-Reply-To: <11713874.post@talk.nabble.com>
References: <11713874.post@talk.nabble.com>
Message-ID: <Pine.LNX.4.64.0707210855110.25332@gannet.stats.ox.ac.uk>

This is nothing to do with R: you need to seek help from whoever you are 
'wroking' for.

You don't have any libraries on your link command, but you do have include 
directories: please get your supervisor to explain how linking works and 
what to do to link against 'symphony'.  (Are you confusing -L and -l?)

On Fri, 20 Jul 2007, Ctagz wrote:

>
> Hi all,
>
> I'm a summer University research student and I've been wroking on writing a
> package, Rsoam, to integrate R with Platform's symphony software to allow
> for distributed computing.  When I "R CMD check" the package, I get the
> following error when trying to load the Rsoam.so after building Rsoam.cpp:
>
> * checking whether the package can be loaded ... ERROR
> Loading required package: snow
> Error in dyn.load(x, as.logical(local), as.logical(now)) :
> 	unable to load shared library '/root/Rsoam.Rcheck/Rsoam/libs/Rsoam.so':
>  /root/Rsoam.Rcheck/Rsoam/libs/Rsoam.so: undefined symbol:
> _ZTIN4soam13SoamExceptionE
> Error in library(Rsoam) : .First.lib failed for 'Rsoam'
> Error in dyn.unload(x) : dynamic/shared library
> '/root/Rsoam.Rcheck/Rsoam/libs/Rsoam.so' was not loaded
>
>            My Makevars file consists of:
>
> PKG_CPPFLAGS = -I/opt/symphonyDE/3.1/src -I/opt/symphonyDE/3.1/include
> -DGCC34 -Wall -DLINUX -Wno-deprecated
> PKG_LIBS = -L/opt/symphonyDE/3.1/src -L/opt/symphonyDE/3.1/include
> -L/opt/symphonyDE/3.1/linux2.6-glibc2.3-x86/lib -LsampleCommon -Lsoambase
> -Lsoamapi
>
>            and 00install.out has the following g++ build:
>
> g++ -I/usr/lib/R/include -I/usr/lib/R/include -I/opt/symphonyDE/3.1/src
> -I/opt/symphonyDE/3.1/include -DGCC34 -Wall -DLINUX -Wno-deprecated
> -I/usr/local/include    -fpic  -O2 -g -c Rsoam9.cpp -o Rsoam9.o
> g++ -shared -Wl,-O1 -o Rsoam.so Rsoam9.o -L/opt/symphonyDE/3.1/src
> -L/opt/symphonyDE/3.1/include
> -L/opt/symphonyDE/3.1/linux2.6-glibc2.3-x86/lib -LsampleCommon -Lsoambase
> -Lsoamapi  -L/usr/lib/R/lib -lR
>
> I thought I'd written the Makevars to a sufficient degree, but I guess that
> may not actually be the case.  I understand that you guys are probably not
> familiar with symphony, but I was hoping if someone could tell me what slips
> through when I'm building this shared library?
>
> -Jon
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] unable to load shared library: undefined symbol
Prof Brian Ripley