<!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 &amp; Ripley's &quot;S
Programming&quot;, p243.&nbsp; That is, with my Fortran code in
testit.f, I say</div>
<div><br></div>
<div><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>g77 -O2
-c testit.f</div>
<div><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>undefined reference to `intpr_'</div>
<div><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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.&nbsp;
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.&nbsp; To print from my Fortran programs, it seems I need
subroutines dblepr, realpr and intpr.&nbsp; From the excellent
&quot;Writing R Extensions&quot; document:</font></blockquote>
<blockquote type="cite" cite><font
color="#000000"><br></font></blockquote>
<blockquote type="cite" cite><font color="#000000">&quot;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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>subroutine dblepr(label, nchar, data, ndata)<br>
<x-tab>&nbsp;&nbsp;&nbsp; </x-tab>subroutine realpr(label, nchar,
data, ndata)</font></blockquote>
<blockquote type="cite" cite><font
color="#000000"><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>subroutine intpr (label, nchar, data,
ndata)&quot;</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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span>&nbsp;&nbsp; Phone +44 1865 278544<br>
Nuffield
College&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fax&nbsp;&nbsp;
+44 1865 278621<br>
Oxford OX1
1NF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Secretary +44 1865 278553<br>
United
Kingdom&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Email david.firth@nuffield.ox.ac.uk<br>
<br>
http://www.stats.ox.ac.uk/~firth/</div>
</body>
</html>