<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { margin-top: 0 ; margin-bottom: 0 }
--></style><title>Re: [R] Fortran subroutines dblepr, realpr,
intpr</title></head><body>
<div>Further to my earlier request for help (see below): I should have
said what operating system and compiler I am using.</div>
<div><br></div>
<div>I am working with the (mingw) g77 compiler under Windows 2000,
and following the approach outlined in Venables & Ripley's "S
Programming", p243. That is, with my Fortran code in
testit.f, I say</div>
<div><br></div>
<div><x-tab> </x-tab>g77 -O2
-c testit.f</div>
<div><x-tab> </x-tab>dllwrap
-o testit.dll --export-all-symbols testit.o</div>
<div><br></div>
<div>which works fine when I don't have any print statements in
testit.f, but if for example I call INTPR in testit.f the dllwrap step
fails with the complaint</div>
<div><x-tab>
</x-tab>undefined reference to `intpr_'</div>
<div><x-tab>
</x-tab>dllwrap: gcc exited with status 1</div>
<div><font color="#000000"><br></font></div>
<div><font color="#000000">Any hints will be much appreciated.
As I said earlier, I am just beginning with this.</font></div>
<div><font color="#000000"><br></font></div>
<div><font color="#000000">David</font></div>
<div><font color="#000000"><br></font></div>
<blockquote type="cite" cite><font color="#000000">I am making my
first attempts at using some Fortran code with R, and so far it's
going OK. To print from my Fortran programs, it seems I need
subroutines dblepr, realpr and intpr. From the excellent
"Writing R Extensions" document:</font></blockquote>
<blockquote type="cite" cite><font
color="#000000"><br></font></blockquote>
<blockquote type="cite" cite><font color="#000000">"Three
subroutines are provided to ease the output of information from
FORTRAN code.</font><br>
</blockquote>
<blockquote type="cite" cite><font
color="#000000"><x-tab>
</x-tab>subroutine dblepr(label, nchar, data, ndata)<br>
<x-tab> </x-tab>subroutine realpr(label, nchar,
data, ndata)</font></blockquote>
<blockquote type="cite" cite><font
color="#000000"><x-tab>
</x-tab>subroutine intpr (label, nchar, data,
ndata)"</font></blockquote>
<blockquote type="cite" cite><font
color="#000000"><br></font></blockquote>
<blockquote type="cite" cite><font color="#000000">Where can one find
these subroutines?</font></blockquote>
<blockquote type="cite" cite><br></blockquote>
<blockquote type="cite" cite>David</blockquote>
<div><br></div>
<div>-- <br>
<br>
<br>
David
Firth <span
></span
> <span
></span> Phone +44 1865 278544<br>
Nuffield
College <span
></span> Fax
+44 1865 278621<br>
Oxford OX1
1NF <span
></span>
Secretary +44 1865 278553<br>
United
Kingdom <span
></span>
Email david.firth@nuffield.ox.ac.uk<br>
<br>
http://www.stats.ox.ac.uk/~firth/</div>
</body>
</html>