From nicola.lunardon at hotmail.it  Wed Mar 25 10:44:54 2015
From: nicola.lunardon at hotmail.it (bstr)
Date: Wed, 25 Mar 2015 02:44:54 -0700 (PDT)
Subject: [Rd] F77_CALL/NAME problem
Message-ID: <1427276694207-4705076.post@n4.nabble.com>

Dear R-devel,

I am trying to use Fortran DGESV subroutine into C. Here it is the relevant
part of the C file I am currently writing

#include<stdio.h>
#include<R.h>
#include<Rmath.h>
#include<math.h>

void F77_NAME(DGESV)( int*, int*, double*, int*, int*, double*, int*, int*);

void solve( int *p, double *A, double *Ainv)
{
        ...
	F77_CALL(DGESV)(p, p, Ain, p, ipiv, Bin, p, &info);
}

In order to create the ".so" file to load in R I downloaded the dgesv.f file
as well as the dependencies (dgetf2.f dgetrf.f dgetrs.f dlaswp.f). As I was
used to I ran in a terminal

R CMD COMPILE *.f
R CMD SHLIB MY_C_FILE.c *.o

to get the MY_C_FILE.so file. However, when I try to load it in a R session
I get the following error message "undefined symbol: DGESV_". Similar errors
are occurring with some other (old) C files that I was used to use a couple
of years ago. In this connection I have to say that those file were working
under an older linux version (I guess ubuntu 12.04 LTS rather than the
current one which is 14.04 LTS).

Best Regards,

N. Lunardon



--
View this message in context: http://r.789695.n4.nabble.com/F77-CALL-NAME-problem-tp4705076.html
Sent from the R devel mailing list archive at Nabble.com.



[Rd] F77_CALL/NAME problem
bstr