Hello r-helpers,

I am new to Rtools and would like to build dll's from fortran subroutines for 
use within R.

I have had no luck compiling the following simple fortran code;

c sample subroutine to include for R
       subroutine multiply(ax,bx,cx)
       implicit none

       integer ax,bx,cx

      cx=ax*bx

       end

>From the directory in which the file is located I used the following command;
R CMD SHLIB multiply.f

With the following a sample of the error messages, and no dll produced;

cygwin warning:
  MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.1/etc/i386/Makeconf
  Preferred POSIX equivalent is: 
/cygdrive/c/PROGRA~1/R/R-215~1.1/etc/i386/Makeconf
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
gcc -shared -s -static-libgcc -o multiply.dll tmp.def multiply.o -lgfortran 
-LC:/PROGRA~1/R/R-215~1.1/bin/i386 -lR
c:/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o:
 In function `pre_c_init':
/data/gannet/ripley/Sources/mingw-test3/src/mingw-w64/stable/v2.x/mingw-w64-crt/crt/crtdll.c:67:
 undefined reference to `_encode_pointer'


My system variables path is as follows;

c:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
 Files (x86)\Microsoft Application Virtualization Client;C:\Program 
Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth 
Software\syswow64;C:\Program Files (x86)\Internet Explorer;C:\Program 
Files\R\R-2.15.1\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files 
(x86)\MiKTeX 2.9\miktex\bin\

R info as follows;

platform       "i386-pc-mingw32"

arch           "i386"

os             "mingw32"

system         "i386, mingw32"

status         ""

major          "2"

minor          "15.1"

year           "2012"

month          "06"

day            "22"

svn.rev        "59607"

language       "R"

version.string "R version 2.15.1 (2012-06-22)"

nickname       "Roasted Marshmallows"

Thanks in advance

Justin Hughes



        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to