<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Thanks for these helpful suggestions.  Changing the symbolic link for libgfortran worked.  Also, I did convert the Fortran code to C using f2c, and that worked as well.</div><div><br></div><br><div><div>On Sep 20, 2011, at 2:24 PM, Simon Urbanek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Sep 20, 2011, at 2:09 PM, Charlie Sharpsteen wrote:<br><br><blockquote type="cite">On Monday, September 19, 2011 7:41:08 PM UTC-7, Simon Urbanek wrote:<br></blockquote><blockquote type="cite">Michael,<br></blockquote><blockquote type="cite">the problem has nothing to do with your package (you should not be touching any flags at all), but rather the Fortran you use.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">If you have both static and dynamic fortran runtime, the dynamic one has always precedence. So there are essentially two possible ways forward:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">a) use static Fortran runtime. It simply means moving /usr/local/lib/libgfortran.dylib aside.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">b) if you use dynamic Fortran runtime, take the one from R. Since you have R 2.13.x it is shipped in /Library/Frameworks/R.framework/Versions/2.13/Resources/lib/ so you can use it along the lines of<br></blockquote><blockquote type="cite">cd /usr/local/lib<br></blockquote><blockquote type="cite">sudo ln -sfn /Library/Frameworks/R.framework/Versions/2.13/Resources/lib/libgfortran.2.dylib .<br></blockquote><blockquote type="cite">sudo ln -sfn libgfortran.2.dylib libgfortran.dylib<br></blockquote><blockquote type="cite">Alternatively you can simply use install_name_tool to point your package to R's runtime.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Note that GFortran also has a `-static-libgfortran` flag that will force the compiler to select the static runtime library over the dynamic one. Using this flag should remove any need to move libraries around or muck about with `install_name_tool` (unless your package has other dynamic dependencies).<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Hope that helps!<br></blockquote><blockquote type="cite"><br></blockquote><br>Not in this case, because this linking is not done by gfortran so the flag has no effect. The problem with linking mixed code is that you have to use g++ for linking so the Fortran runtime must be linked "by hand". R takes care of this but it means you get your fortran used at configure time which in Michael's case is dynamic linking.<br><br>Cheers,<br>Simon<br><br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Michael Braun <br>MIT Sloan School of Management<br><a href="mailto:braunm@mit.edu">braunm@mit.edu</a><br>-------------------------------------------------- <br>View my research at<br>http://braunm.scripts.mit.edu/</span>
</div>
<br></body></html>