On Monday, September 19, 2011 7:41:08 PM UTC-7, Simon Urbanek wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Michael,<p>the problem has nothing to do with your package (you should not be touching any flags at all), but rather the Fortran you use.</p><p>If you have both static and dynamic fortran runtime, the dynamic one has always precedence. So there are essentially two possible ways forward:</p><p>a) use static Fortran runtime. It simply means moving /usr/local/lib/libgfortran.<wbr>dylib aside.</p><p>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.<wbr>framework/Versions/2.13/<wbr>Resources/lib/ so you can use it along the lines of<br>cd /usr/local/lib<br>sudo ln -sfn /Library/Frameworks/R.<wbr>framework/Versions/2.13/<wbr>Resources/lib/libgfortran.2.<wbr>dylib .<br>sudo ln -sfn libgfortran.2.dylib libgfortran.dylib<br>Alternatively you can simply use install_name_tool to point your package to R's runtime.</p></blockquote><div><br></div><div>Note that GFortran also has a `<span class="Apple-style-span" style="line-height: 18px; ">-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).</span></div><div><span class="Apple-style-span" style="line-height: 18px; "><br></span></div><div><span class="Apple-style-span" style="line-height: 18px;">Hope that helps!</span></div><div><span class="Apple-style-span" style="line-height: 18px;"><br></span></div><div><span class="Apple-style-span" style="line-height: 18px;">-Charlie</span></div>