Gilles GUILLOT
2005-Jul-05 11:12 UTC
[Rd] calling fortran functions CHOL and DPOTRF form Fortran
Hi all,
I'm working out some Fortran code for which
I want to compute the Choleski decomposition of a covariance matrix
in Fortran.
I tried to do it by two methods :
1) Calling the lapack function DPOTRF.
I can see the source code and check that my call is correct,
but it does not compile with:
system("R CMD SHLIB ~/main.f")
dyn.load("~/main.so")
I get:
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library
[...]
undefined symbol: dpotrf_
Could anyone point out how to compile with such a call to lapack?
2) Calling the Fortran function CHOL
The previous combination of R CMD SHLIB and dyn.load
compiles fine but I would like to see the source code of this function
to check if my call is correct. I've not been able to find it in the R
source
distribution.
Could anyone point the place of that file?
Thanks in advance,
Gilles
--
_________________________________________________________________________
Gilles GUILLOT
INRA -D?partement Math?matiques et Informatique Appliqu?es
Unit? Mixte de Recherche INRA - INAPG - ENGREF
Institut National Agronomique de Paris-Grignon
16, rue Claude Bernard
75231 Paris cedex 5 France
phone 33 1 44 08 18 42
fax 33 1 44 08 16 66
http://www.inapg.fr/ens_rech/mathinfo/personnel/guillot/welcome.html
Douglas Bates
2005-Jul-05 13:58 UTC
[Rd] calling fortran functions CHOL and DPOTRF form Fortran
On 7/5/05, Gilles GUILLOT <gilles.guillot at inapg.inra.fr> wrote:> Hi all, > > I'm working out some Fortran code for which > I want to compute the Choleski decomposition of a covariance matrix > in Fortran. > > I tried to do it by two methods : > > 1) Calling the lapack function DPOTRF. > I can see the source code and check that my call is correct, > but it does not compile with: > system("R CMD SHLIB ~/main.f") > dyn.load("~/main.so") > > I get: > Error in dyn.load(x, as.logical(local), as.logical(now)) : > unable to load shared library > [...] > undefined symbol: dpotrf_ > > Could anyone point out how to compile with such a call to lapack?Make a small package from your source code then follow the instructions in http://tolstoy.newcastle.edu.au/R/devel/05/06/1382.html> > 2) Calling the Fortran function CHOL > The previous combination of R CMD SHLIB and dyn.load > compiles fine but I would like to see the source code of this function > to check if my call is correct. I've not been able to find it in the R source > distribution. > Could anyone point the place of that file?${RSRC}/src/appl/chol.f> > Thanks in advance, > > Gilles > > > -- > _________________________________________________________________________ > Gilles GUILLOT > > INRA -D?partement Math?matiques et Informatique Appliqu?es > Unit? Mixte de Recherche INRA - INAPG - ENGREF > > Institut National Agronomique de Paris-Grignon > 16, rue Claude Bernard > 75231 Paris cedex 5 France > > phone 33 1 44 08 18 42 > fax 33 1 44 08 16 66 > http://www.inapg.fr/ens_rech/mathinfo/personnel/guillot/welcome.html > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >