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 -- View this message in context: http://www.nabble.com/unable-to-load-shared-library%3A-undefined-symbol-tf4118911.html#a11713874 Sent from the R devel mailing list archive at Nabble.com.
Prof Brian Ripley
2007-Jul-21 08:04 UTC
[Rd] unable to load shared library: undefined symbol
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