Claudio Verzilli
2001-Jun-20 18:58 UTC
[R] Loading Fortran code with NAG subroutines: Solution
Create a Makevars file in the compiling directory and set PKG_LIBS=-L/path/to/naglib.so -lnag therein. Then use dyn.load with now=F. Thanks to Prof Ripley for his suggestion. Regards Claudio>>> Prof Brian Ripley <ripley at stats.ox.ac.uk> 06/20/01 04:07pm >>>On Wed, 20 Jun 2001, Claudio Verzilli wrote:> Dear R-users, > > System specs > R-1.2.2 under Unix Sun Solaris 2.7 > Nag Fortran library Mark 18 > > when I try to dynload a Fortran77 code (compiled using R CMD SHLIB) which contains calls to NAG subroutines (nagsymbols) I get the following error message > > ld.so.1: /opt/rhome/R-1.2.2/bin/R.bin: fatal: relocation error: file /path/to/myfile.so: symbol nagsymbol_:referenced symbol not found > > I changed the default compilation flags in rhome/Makeconf (i.e. adding -L/path/to/nablib.so, -lnag) without success. > Any suggestions on what might be missing?Well, R CMD SHLIB uses R_HOME/etc/Makeconf.... Look in `Writing R Extensions'' for how to do this properly, using PKG_LIBS -- 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._