From dmbates at gmail.com  Wed Jun 22 17:47:39 2005
From: dmbates at gmail.com (Douglas Bates)
Date: Wed, 22 Jun 2005 10:47:39 -0500
Subject: [Rd] Lapack calls from fortran
In-Reply-To: <42B97F42.2060108@bank-banque-canada.ca>
References: <42B97F42.2060108@bank-banque-canada.ca>
Message-ID: <40e66e0b05062208471211f26e@mail.gmail.com>

On 6/22/05, Paul Gilbert <pgilbert at bank-banque-canada.ca> wrote:
> I am trying to call the lapack routine dgesv in the R distribution from
> the fortran code for a package, but when I dyn.load("dse1.so") I get an
> error about undefined symbol: dgesv_
> 
> I thought the proper incantation was
> 
> MAKEFLAG="FLIBS=/path to/R-2.1.1/libRlapack.so" R CMD SHLIB dse1.f
> 
> but apparantly not. How does one do this?

See section 1.2.1 of "Writing R Extensions".  You should add a file
called Makevars to the src directory and include the line

PKG_LIBS = ${LAPACK_LIBS} ${BLAS_LIBS}

in that file



[Rd] Lapack calls from fortran
Douglas Bates