Nathan S. Watson-Haigh
2009-Feb-17 01:34 UTC
[R] Create package with Fortran 90 and C code
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm trying to add some Fortran 90 code to an existing package. When I compile and load the file manually like: SHELL> R CMD SHLIB file.f90 R> dyn.load("file.so") I can use the .Fortran() fine. However, when I try to build, install and load the library I seem to be missing something. I do a: SHELL> R CMD build dir SHELL> R CMD INSTALL pkg_version.tar.gz Things seem to progress smoothly. However, in R when I try to load the package I get an error like: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library '/cs/home/cslsi/wat410/R/ia64-unknown-linux-gnu-library/2.7/pkg/libs/pkg.so': /cs/home/cslsi/wat410/R/ia64-unknown-linux-gnu-library/2.7/pkg/libs/pkg.so: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE Error: package/namespace load failed for 'pkg' Can anyone suggest what I might do to solve this? Cheers, Nathan - -- - -------------------------------------------------------- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Queensland Bioscience Precinct St Lucia, QLD 4067 Australia Tel: +61 (0)7 3214 2922 Fax: +61 (0)7 3214 2900 Web: http://www.csiro.au/people/Nathan.Watson-Haigh.html - -------------------------------------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmaFCAACgkQ9gTv6QYzVL5cHACdFgIs0oHvr9aeOXMe4ULVAvPS 0ywAn2Maw9Jq2MBAMw3Q/mzV9Bsd+arh =thcm -----END PGP SIGNATURE-----
On Tue, 17 Feb 2009, Nathan S. Watson-Haigh wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I'm trying to add some Fortran 90 code to an existing package. > > When I compile and load the file manually like: > SHELL> R CMD SHLIB file.f90 > R> dyn.load("file.so") > > I can use the .Fortran() fine. However, when I try to build, install and load > the library I seem to be missing something. > > I do a: > SHELL> R CMD build dir > SHELL> R CMD INSTALL pkg_version.tar.gz > > Things seem to progress smoothly. However, in R when I try to load the package I > get an error like: > > Error in dyn.load(file, DLLpath = DLLpath, ...) : > unable to load shared library > '/cs/home/cslsi/wat410/R/ia64-unknown-linux-gnu-library/2.7/pkg/libs/pkg.so': > /cs/home/cslsi/wat410/R/ia64-unknown-linux-gnu-library/2.7/pkg/libs/pkg.so: > undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE > Error: package/namespace load failed for 'pkg' > > Can anyone suggest what I might do to solve this?See the posting guide! This is a question about compiled code, hence for the R-devel list. You are apparently using an obsolete R, and it rather looks as if you are using C++ with Fortran 90, something that is not supported (since in general it does not work, and you need to tell us the compilers you are using). So please post a much more complete description on R-devel, and perhaps make the failing package available for potential helpers to look at.> Cheers, > Nathan> - -------------------------------------------------------- > Dr. Nathan S. Watson-Haigh > OCE Post Doctoral Fellow > CSIRO Livestock Industries > Queensland Bioscience Precinct > St Lucia, QLD 4067 > Australia > > Tel: +61 (0)7 3214 2922 > Fax: +61 (0)7 3214 2900 > Web: http://www.csiro.au/people/Nathan.Watson-Haigh.html-- 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