<div dir="ltr">On further reflection, I guess <span style="font-family:arial,sans-serif;font-size:13px">${</span><font face="arial, sans-serif">SOVERSION} can be avoided entirely by just bumping the compatibility version on each major llvm/clang/openmp release. Was the soversioning meant to be achieved through through the shared library name? That is, when we have an ABI change in openmp which normally requires a soverson bump, the shared library name would be changed instead (e.g. libiomp5 to libiomp6)? In any case, we still have to consider the installation location of </font><span style="font-family:arial,sans-serif;font-size:13px">libomp5.${OMP_SHLIBEXT} and how relates to having multiple llvm/clang/openmp releases being installed </span><span style="font-family:arial,sans-serif;font-size:13px">simultaneously </span><span style="font-family:arial,sans-serif;font-size:13px">on the same machine.</span></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 31, 2014 at 10:51 PM, Jack Howarth <span dir="ltr"><<a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@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">Below is what I had in mind for the installation commands of CMakelists.txt once we have the cmake build<div>
of openmp hooked up to the llvm bootstrap…<div><br></div><div><div>install(</div><div>  FILES omp.h</div>
<div>  PERMISSIONS OWNER_READ OWNER_WRITE<span style="color:rgb(0,0,0)"> </span>GROUP_READ<span style="color:rgb(0,0,0)"> </span>WORLD_READ</div><div>  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include</div>

<div>)</div><div>install(</div><div>  FILES libiomp5.${OMP_SHLIBEXT}</div><div>  PERMISSIONS OWNER_READ OWNER_WRITE <span style="color:rgb(0,0,0)">OWNER_EXECUTE </span>GROUP_READ <span style="color:rgb(0,0,0)">GROUP_EXECUTE  </span>WORLD_READ <span style="color:rgb(0,0,0)">WORLD_EXECUTE</span></div>

<div>  DESTINATION lib${LLVM_LIBDIR_SUFFIX}</div><div>)</div><div><br></div><div>This mimics what we have been doing in fink. Placing the omp.h header in  lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include automatically allows the compiler to find it. In fink, we have been installing  libiomp5.${OMP_SHLIBEXT} in lib${LLVM_LIBDIR_SUFFIX} and using a patch…</div>

<div><br></div><div>--- cfe-3.4.1.src/lib/Driver/Tools.cpp.orig     2014-05-20 16:54:39.000000000 -0400</div><div>+++ cfe-3.4.1.src/lib/Driver/Tools.cpp  2014-05-20 17:01:28.000000000 -0400</div><div>@@ -5123,9 +5123,12 @@</div>

<div> </div><div>   Args.AddAllArgs(CmdArgs, options::OPT_L);</div><div> </div><div>-  if (Args.hasArg(options::OPT_fopenmp))</div><div>+  if (Args.hasArg(options::OPT_fopenmp)) {</div><div>+    // Help clang find libiomp5.dylib</div>

<div>+    CmdArgs.push_back("-L@FINK_PREFIX@/opt/llvm-3.4/lib");</div><div>     // This is more complicated in gcc...</div><div>     CmdArgs.push_back("-liomp5");</div><div>+  }</div><div> </div><div>
   AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);</div>
<div>   </div><div>@@ -6690,7 +6693,9 @@</div><div> </div><div>       bool OpenMP = Args.hasArg(options::OPT_fopenmp);</div><div>       if (OpenMP) {</div><div>-        CmdArgs.push_back("-liomp5");</div><div>+       // Help clang find libiomp5.dylib</div>

<div>+       CmdArgs.push_back("-L@FINK_PREFIX@/opt/llvm-3.4/lib");</div><div>+       CmdArgs.push_back("-liomp5");</div><div>       }</div><div> </div><div>       AddLibgcc(ToolChain.getTriple(), D, CmdArgs, Args);</div>

<div><br></div><div>to help clang find it there. So we would change @FINK_PREFIX@ to the </div><div>complete path to the installed lib${LLVM_LIBDIR_SUFFIX}. The alternative </div><div>would be to change the patch above to replace -liomp5 with a the full</div>

<div>path to the installed  lib${LLVM_LIBDIR_SUFFIX}/libomp5.${OMP_SHLIBEXT}</div><div>instead.</div><div><br></div><div> This brings up several questions…</div><div><br></div><div>1) Where do you intend to place libomp5.${OMP_SHLIBEXT}?</div>

<div><br></div><div>2) If it is installed outside of  lib${LLVM_LIBDIR_SUFFIX}, how do</div><div> you plan on handling having multiple versions of llvm/clang installed</div><div> on the same machine which will all claim to ownership of libomp5.${OMP_SHLIBEXT}?</div>

<div><br></div><div> My proposal for solving the issue of co-existing libomp5.${OMP_SHLIBEXT} would be…</div><div><br></div><div> Create  libomp5.${VERSION}.${SOVERSION}.${OMP_SHLIBEXT}, where SOVERSION</div><div> is set to the release number of the llvm/clang/openmp release and create a symlink</div>

<div> for  libomp5.${OMP_SHLIBEXT} pointing at libomp5.${VERSION}.${SOVERSION}.${OMP_SHLIBEXT}.</div><div> Install these two files in  lib${LLVM_LIBDIR_SUFFIX} and use additional symlinks to them</div><div> in an exposed directory like /usr/lib. These two symlinks in the exposed directory would be</div>

<div> swapped out when a particular releases of llvm/clang/openmp was designated as the system</div><div> one (i.e. they would end up in a conflicting  clang34-dev or clang35-dev packaging).</div><div><br></div><div> I think this would allow binaries to be compiled against a specific release of openmp and</div>

<div> insure that the resulting executables would find the original copy of libiomp5 for that</div><div> release of llvm/clang/openmp as installed in  lib${LLVM_LIBDIR_SUFFIX} as</div><div> libomp5.${VERSION}.${SOVERSION}.${OMP_SHLIBEXT}..</div>

<div><br></div><div> Sorry if that wasn't as clear as I intended but hopefully you will all get the idea.</div><div><div class="h5"><div>    </div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 31, 2014 at 9:41 PM, Jack Howarth <span dir="ltr"><<a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">   Attached is the revised initial implementation of cmake support for openmp in <a href="http://llvm.org" target="_blank">llvm.org</a> with the following requested changes implemented.<div>

<br></div><div>1) Indentations normalized to 2 spaces.</div>
<div>2) The test for APPLE moved above UNIX in setting OS_GEN and fatal error condition added.</div><div>3) Implemented used CMAKE_SHARED_LIBRARY_SUFFIX to set OMP_SHLIBEXT.</div><div>4) Added comment explaining the rational for temporary forcing of…</div>


<div><br></div><div>set(CMAKE_CXX_COMPILER "clang++")<br></div><div><br></div><div>to insure that the build of 'make compiler=clang' is always used, regardless of the actual system compiler, until the openmp build is wired into the llvm bootstrap and can be certain to use its clang compilers. Also note that the warnings added to the COMMON_FLAGS may be compiler-specific. Tested as before on x86_64-apple-darwin12 against the clang compilers from Xcode 5.1.1 and on x86_64 Fedora 15 using current clang-omp 3.4.</div>

<span><font color="#888888">
<div>                  Jack</div></font></span><div>ps We also probably want to add a fatal error message for unsupported arches but first I intend to adjust this file to support powerpc as soon as my clang-omp bootstrap completes on ppc darwin9.</div>


</div>
</blockquote></div><br></div></div></div></div></div></div>
</blockquote></div><br></div>