Re: [R] Calling Fortran from R: Issues with dynamic loading of fortran dll

2012-01-16 Thread Duncan Murdoch
The problem is your path. You are finding a 64 bit compiler first, so you get a 64 bit dll. The path I use has these components in this order (as recommended in our docs, and as set by the Rtools installer): Rtools/bin Rtools/perl/bin Rtools/MinGW/bin # NOT MinGW64/bin as you had So t

Re: [R] Calling Fortran from R: Issues with dynamic loading of fortran dll

2012-01-16 Thread David Stevens
I'm a little worried this is getting off track. I'll recap 1. I'm using R 2.14.1 from CRAN - installed last week in d:\program files\R\R-2.14.1 using the Windows installer 2. I've just installed Rtools 15.1 this morning in d:\Rtools at Duncan's recommendation using the Rtools Windows installer

Re: [R] Calling Fortran from R: Issues with dynamic loading of fortran dll

2012-01-16 Thread Duncan Murdoch
On 16/01/2012 8:55 AM, David Stevens wrote: I installed RTools - though I'm unable to use it within R, from the command prompt the file will compile and create the foo.dll using R CMD SHLIB foo.f. I simlified to code for fortran IV (?really) compliance foo.f: Subroutine foo(x)

Re: [R] Calling Fortran from R: Issues with dynamic loading of fortran dll

2012-01-16 Thread Berend Hasselman
On 16-01-2012, at 14:55, David Stevens wrote: > I installed RTools - though I'm unable to use it within R, from the > command prompt the file will compile and create the foo.dll using R CMD > SHLIB foo.f. I simlified to code for fortran IV (?really) compliance > > foo.f: > >Subroutin

Re: [R] Calling Fortran from R: Issues with dynamic loading of fortran dll

2012-01-16 Thread David Stevens
I installed RTools - though I'm unable to use it within R, from the command prompt the file will compile and create the foo.dll using R CMD SHLIB foo.f. I simlified to code for fortran IV (?really) compliance foo.f: Subroutine foo(x) real x x = x + 2. return

Re: [R] Calling Fortran from R: Issues with dynamic loading of fortran dll

2012-01-16 Thread Barry Rowlingson
On Mon, Jan 16, 2012 at 12:09 AM, Duncan Murdoch wrote: > 3.  Find out what name got exported, and use .C instead of .Fortran to call > that. For example, when compiling Fortran subroutines within modules, the exported name on my system (gcc on Ubuntu of some flavour) becomes __subroutinename_M

Re: [R] Calling Fortran from R: Issues with dynamic loading of fortran dll

2012-01-15 Thread Duncan Murdoch
On 12-01-15 5:34 PM, David Stevens wrote: I successfully used .Fortran to load and execute my fortran procedures under WinXP and 32 bit R. Alas, the same isn't true with my next Windows 7/64 machine, R 2.14.1 (64 bit) and the gnu gfortran (64) compiler (mingw64 v. 4.6.1). Though I'm able to compi

[R] Calling Fortran from R: Issues with dynamic loading of fortran dll

2012-01-15 Thread David Stevens
I successfully used .Fortran to load and execute my fortran procedures under WinXP and 32 bit R. Alas, the same isn't true with my next Windows 7/64 machine, R 2.14.1 (64 bit) and the gnu gfortran (64) compiler (mingw64 v. 4.6.1). Though I'm able to compile the routines from the command line us