<p dir="auto">I am unable to build <code class="notranslate">clang</code> on OSX with <code class="notranslate">BUILD_LLVM_CLANG</code> in <code class="notranslate">Make.user</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cd /Users/kevin/Source/julia-cxx/deps/scratch/llvm-svn/build_Release+Asserts/projects/compiler-rt/lib/builtins &amp;&amp; \
    /usr/bin/clang -stdlib=libc++ -mmacosx-version-min=10.8 \
    -m64 -D_DEBUG -D__STDC_CONSTANT_MACROS \
    -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS \
    -I/Users/kevin/Source/julia-cxx/deps/scratch/llvm-svn/build_Release+Asserts/projects/compiler-rt/lib/builtins \
    -I/Users/kevin/Source/julia-cxx/deps/srccache/llvm-svn/projects/compiler-rt/lib/builtins \
    -I/Users/kevin/Source/julia-cxx/deps/scratch/llvm-svn/build_Release+Asserts/include \
    -I/Users/kevin/Source/julia-cxx/deps/srccache/llvm-svn/include  -O3  -arch i386   -UNDEBUG  \
    -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk \
    -mmacosx-version-min=10.5 -fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer -arch i386 \
    -o CMakeFiles/clang_rt.builtins_i386_osx.dir/absvsi2.c.o   \
    -c /Users/kevin/Source/julia-cxx/deps/srccache/llvm-svn/projects/compiler-rt/lib/builtins/absvsi2.c
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)"><pre class="notranslate"><code class="notranslate">cd /Users/kevin/Source/julia-cxx/deps/scratch/llvm-svn/build_Release+Asserts/projects/compiler-rt/lib/builtins &amp;&amp; \
    /usr/bin/clang -stdlib=libc++ -mmacosx-version-min=10.8 \
    -m64 -D_DEBUG -D__STDC_CONSTANT_MACROS \
    -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS \
    -I/Users/kevin/Source/julia-cxx/deps/scratch/llvm-svn/build_Release+Asserts/projects/compiler-rt/lib/builtins \
    -I/Users/kevin/Source/julia-cxx/deps/srccache/llvm-svn/projects/compiler-rt/lib/builtins \
    -I/Users/kevin/Source/julia-cxx/deps/scratch/llvm-svn/build_Release+Asserts/include \
    -I/Users/kevin/Source/julia-cxx/deps/srccache/llvm-svn/include  -O3  -arch i386   -UNDEBUG  \
    -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk \
    -mmacosx-version-min=10.5 -fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer -arch i386 \
    -o CMakeFiles/clang_rt.builtins_i386_osx.dir/absvsi2.c.o   \
    -c /Users/kevin/Source/julia-cxx/deps/srccache/llvm-svn/projects/compiler-rt/lib/builtins/absvsi2.c
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
</code></pre></div>
<p dir="auto">I've tracked it down to a problem with flags: when compiling compiler-rt, an extra <code class="notranslate">-mmacosx-version-min=10.5</code> is inserted late in the argument list, overriding the <code class="notranslate">-mmacosx-version-min=10.8</code> on the second line.</p>
<p dir="auto">Solutions on the web suggest</p>
<ul dir="auto">
<li>defining the environment variable <code class="notranslate">MACOSX_DEPLOYMENT_TARGET=10.8</code></li>
<li>for cmake, adding <code class="notranslate">CMAKE_OSX_DEPLOYMENT_TARGET=10.8</code></li>
</ul>
<p dir="auto">I've tried each of these, and while the second has an effect (I see two instances of <code class="notranslate">-mmacosx-version-min=10.8</code> in compile commands), it also does not seem to propagate to compiler-rt.  (Defining <code class="notranslate">MACOSX_DEPLOYMENT_TARGET=10.8</code> doesn't seem to do anything.)</p>
<p dir="auto">Thoughts on this?  I was hoping to use <code class="notranslate">Cxx.jl</code>, although I'm wondering if I can get around this issue with a brew installed version...</p>
<p dir="auto">Cc: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Keno/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Keno">@Keno</a></p>
<p dir="auto">This is the standard directory, distributions prefer documentation to go to <code class="notranslate">$(docdir)/julia</code> [1], which defaults to <code class="notranslate">/usr/share/doc/julia</code>. I'll have a look, this is mostly a reminder for myself.</p>
<p dir="auto">By the way, by default calling <code class="notranslate">make &amp;&amp; make install</code> you get the .rst installed directly. Maybe it would make more sense to compile this to HTML? Installing Python and configuration files does not make much sense either.</p>
<p dir="auto">The man page is also duplicated in <code class="notranslate">$(datarootdir)/julia/doc/man</code>. Not sure why.</p>
<p dir="auto">1: <a href="http://www.gnu.org/software/make/manual/html_node/Directory-Variables.html" rel="nofollow">http://www.gnu.org/software/make/manual/html_node/Directory-Variables.html</a></p>