<html>#2659: ExternalLibrary auto-detection fails on M1 macs using homebrew
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Roland Haas</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>major</td></tr>
<tr><td style='text-align:right'>Component:</td><td></td></tr>
</table>

<p>With <span class="ap-mention" data-atlassian-id="6350afe6fe5ff37523587456">@Leung, Lisa Jing</span> I just dug down a bit into compilation failures using HomeBrew on macOS M1. </p>
<p>There were three errors reported at CST stage by ExternalLibraries;</p>
<div class="codehilite"><pre><span></span><span>CST error 1:</span>
<span> -&gt; Configuration script for thorn LIBJPEG returned exit code 77</span>
<span>   (no error message)</span>
<span>CST error 2:</span>
<span> -&gt; Configuration script for thorn OPENSSL returned exit code 2</span>
<span>   (no error message)</span>
<span>CST error 3:</span>
<span> -&gt; Configuration script for thorn ZLIB returned exit code 1</span>
<span>   (no error message)</span>
</pre></div>


<p>which turn out to be compilation failures, at least in LIBJPEG’s case. Now libjpeg should not even be attempted to be compiled since the tutorial instructions (which were followed) contain <code>brew install jpeg</code> and indeed <code>jpeg</code> was installed. </p>
<p>It turns out that HomeBrew moved from <code>/usr/local</code> to <code>/opt/homebrew</code> so that the rather limited set of locations checked by many ExternalLibraries no longer match. <code>pkg-config</code> is not help here either it seems.</p>
<p>Part of this is already broken on x86 macs where HomeBrew does not install <code>OpenSSL</code> and <code>zlib</code> into <code>/usr/local</code> but only into its own <code>Cellar</code> hierarchy so that the installed copies are being ignored already on x86 macs (verified on my own x86 macOS VM).</p>
<p>With this we can no longer claim macOS support using homebrew. If similar issues occur using macports then we can no longer claim any macOS support.</p>
<p>Fixes would involve finding out why pkg-config fails and also why compilation attempts fail. Looking at the log files for libjpeg it tried using <code>gcc</code> (ie Apple’s clang-in-disguise) instead of the correct <code>gcc-12</code> from homebrew. This, unsurprisingly failed. Similarly for OpenSSL (fails due to lack
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2659/externallibrary-auto-detection-fails-on-m1'>https://bitbucket.org/einsteintoolkit/tickets/issues/2659/externallibrary-auto-detection-fails-on-m1</a></p>
</html>