<html>#2306: set up CPATH and LIBRARY_PATH in generic.ini
<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>enhancement</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>major</td></tr>
<tr><td style='text-align:right'>Component:</td><td>SimFactory</td></tr>
</table>

<p>The Cactus tools for ExternalLibraries strip (what is assumed to be) system directories from the search path for includes and linker libraries so that is a eg HDF5 is found in /usr no -L/usr is added which might eg conflict if one needs to use a FFTW other than the system one installed in /usr. </p>
<p>This is mostly an issue on clusters where a system wide library is provided by the OS (eg HDF5) but we need to build our own or use one provided by modules b/c the system one is too old. At the same time we may need eg pthreads which is always provided by the system (cannot be built from source).</p>
<p>On laptops this is typically less of an issue but can still happen.</p>
<p>For these reasons some libraries are stripped from the LIBDIRS reported by ExternalLibraries' detect.sh script under the assumption that they are system paths and the compiler will look there even when they are not mentioned.</p>
<p>Unfortunately this is not true for HomeBrew’s gcc compiler which does not look into /usr/local/{lib,include} even though HomeBrew itself installs software there.</p>
<p>Right now this requires an osx-homebrew.cfg file which sets up Cactus options</p>
<div class="codehilite language-shell"><pre><span></span><span class="c1"># the configure scripts strip /usr/local from XXX_DIR to avoid chosing system</span>
<span class="c1"># libraries, however OSX does not search in /usr/local by default, so</span>
<span class="c1"># we add it by hand.</span>
<span class="nv">LIBDIRS</span> <span class="o">=</span> /usr/local/lib
<span class="nv">SYS_INC_DIRS</span> <span class="o">=</span> /usr/local/include
</pre></div>


<p>which however adds <code>/usr/local/lib</code> to the <em>front</em> of the search path rather than the end. A way to add to the end for the gcc compiler (nothing else matters for generic.ini) is to set <code>CPATH</code> and <code>LIBRARY_PATH</code> environment variables:</p>
<div class="codehilite language-shell"><pre><span></span><span class="nb">export</span> <span class="nv">LIBRARY_PATH</span><span
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2306/set-up-cpath-and-library_path-in'>https://bitbucket.org/einsteintoolkit/tickets/issues/2306/set-up-cpath-and-library_path-in</a></p>
</html>