<div dir="ltr"><div>I have a problem with the static build on Mac OS X using gcc and gfortran now, and I think the issue is with gfortran/Apple, not with CMake. (Things work fine with the intel compilers too.) However, on the off chance that someone has a fix or some advice I thought I would run the issue past all of you.</div>
<div><br></div><div>On Mac the -static flag doesn't work because there is no way to statically link against crt0.o and libSystem.dylib, but that's fine, these should be present on any reasonable OS X system. AFAICT, gfortran and gcc have no flag to specify that libquadmath should be statically linked. This library is distributed with gfortran, and there is no guarantee that it will be present on the end user's system. (I'd like to just be able to distribute the compiled binary without the sources, build system, etc.) Also, moving to an older version of gfortran is not an option since many new features are required by the software. A static version of libquadmath is distributed with gcc/gfortran and is available at: /opt/local/lib/gcc48/libquadmath.a</div>
<div><br></div><div>What is the best way to setup my link command using CMake so that the binary executable is linked against the static libquadmath.a instead of the .dylib version? (I couldn't find any examples or solutions via an extensive search online.)</div>
<div><br></div>After spending nearly the entire afternoon trying to create a statically linked executable on Mac, now using gcc and gfortran instead of the Intel compilers, I can understand the wisdom in not attempting to fully support static builds: they are a royal pain!<div>
<br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div>Izaak Beekman<br>===================================<br>(301)244-9367<br>Princeton University Doctoral Candidate<br>Mechanical and Aerospace Engineering<br>
<a href="mailto:ibeekman@princeton.edu" target="_blank">ibeekman@princeton.edu</a><br><br>UMD-CP Visiting Graduate Student<br>Aerospace Engineering<br><a href="mailto:ibeekman@umiacs.umd.edu" target="_blank">ibeekman@umiacs.umd.edu</a><br>
<a href="mailto:ibeekman@umd.edu" target="_blank">ibeekman@umd.edu</a></div>
<br><br><div class="gmail_quote">On Tue, Apr 15, 2014 at 10:56 AM, Zaak Beekman <span dir="ltr"><<a href="mailto:zbeekman@gmail.com" target="_blank">zbeekman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra">Brad, thanks so much for your help! From the online documentation it can be hard to figure out which variable/property controls certain features as someone with limited CMake experience.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">One strange detail I forgot was that this problem does not appear on Mac/OS X for the same project using the intel 13.x compilers. It seems on Mac all the implicit link libraries exist in static form. I'm going to poke around some more now that I know where to look and which variables to watch, etc. and I may file a bug report and/or submit a patch if I can determine a better but still safe way to detect required implicit link libraries.</div>
<div class="gmail_extra"><br>Thanks again for your help<div class=""><br clear="all"><div>Izaak Beekman<br>===================================<br><a href="tel:%28301%29244-9367" value="+13012449367" target="_blank">(301)244-9367</a><br>
Princeton University Doctoral Candidate<br>Mechanical and Aerospace Engineering<br>
<a href="mailto:ibeekman@princeton.edu" target="_blank">ibeekman@princeton.edu</a><br><br>UMD-CP Visiting Graduate Student<br>Aerospace Engineering<br><a href="mailto:ibeekman@umiacs.umd.edu" target="_blank">ibeekman@umiacs.umd.edu</a><br>
<a href="mailto:ibeekman@umd.edu" target="_blank">ibeekman@umd.edu</a></div>
</div></div></div>
</blockquote></div><br></div>