[139987] trunk/dports/lang/libomp/Portfile

eborisch at macports.org eborisch at macports.org
Fri Sep 4 20:52:49 PDT 2015


Revision: 139987
          https://trac.macports.org/changeset/139987
Author:   eborisch at macports.org
Date:     2015-09-04 20:52:49 -0700 (Fri, 04 Sep 2015)
Log Message:
-----------
libomp: Update to latest; move installs into (include|lib)/libomp to facilitate clang modifications for -fopenmp. Add +top_level variant for users who want them in include/ and lib/ directly.

Modified Paths:
--------------
    trunk/dports/lang/libomp/Portfile

Modified: trunk/dports/lang/libomp/Portfile
===================================================================
--- trunk/dports/lang/libomp/Portfile	2015-09-05 00:48:07 UTC (rev 139986)
+++ trunk/dports/lang/libomp/Portfile	2015-09-05 03:52:49 UTC (rev 139987)
@@ -8,7 +8,7 @@
 
 name                    libomp
 version                 0.0
-revision                243276
+revision                246703
 maintainers             eborisch openmaintainer
 homepage                http://openmp.llvm.org
 description             The OpenMP subproject of LLVM
@@ -38,6 +38,24 @@
 
 compiler.blacklist-append {clang < 500}
 
+# Do actual install into ${prefix}/(install|lib)/libomp
+# A little unorthodox, but to have clang automatically find the includes and
+# lib, with -fopenmp, it is nice to have them their own directories. Not
+# exactly a config cmake supports directly; install into dummy location and
+# move post-install
+configure.pre_args      -DCMAKE_INSTALL_PREFIX=${prefix}/tmp
+
+configure.args-delete   -DCMAKE_INSTALL_RPATH=${prefix}/lib \
+                        -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib \
+
+# With this, cmake sets the correct library name in the dylibs for the
+# final destination we move them to
+configure.args-append   -DCMAKE_INSTALL_RPATH=${prefix}/lib/libomp \
+                        -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/libomp \
+
+variant top_level description \
+    "Install (links to) omp.h and libs into ${prefix}/(include|lib)" {}
+
 post-extract {
     file rename ${workpath}/trunk ${workpath}/${name}-${version}
     if {${os.major} >= 14} {
@@ -51,22 +69,37 @@
 
 post-destroot {
     set instdest ${destroot}${prefix}
-    xinstall -d ${instdest}/share/doc/openmp
+    xinstall -d ${instdest}/share/doc/libomp
     file copy ${worksrcpath}/README.txt ${worksrcpath}/../LICENSE.txt \
-      ${instdest}/share/doc/openmp/
+        ${worksrcpath}/../www ${instdest}/share/doc/libomp/
+    xinstall -d ${instdest}/include/libomp
+    move ${instdest}/tmp/include/omp.h ${instdest}/include/libomp/
+    xinstall -d ${instdest}/lib/libomp
+    foreach p {libiomp5.dylib libomp.dylib libgomp.dylib} {
+        move ${instdest}/tmp/lib/${p} ${instdest}/lib/libomp/
+    }
+    if [variant_isset top_level] {
+        system -W ${instdest}/include \
+          "ln -s libomp/omp.h"
+        foreach p {libiomp5.dylib libomp.dylib libgomp.dylib} {
+            system -W ${instdest}/lib/ \
+              "ln -s libomp/${p}"
+        }
+    }
 }
 
 notes "
-    Use with llvm-3.7/clang-3.7 (both built with 'assertions' variant DISABLED)
-    via:
-      -I${prefix}/include -L${prefix}/lib -fopenmp=libomp
+  Use with clang-3.\[78\] (when built with +openmp variant) by adding
+  \"-fopenmp\" to your compile and link lines.
+  (Or \"-I${prefix}/include/libomp -L${prefix}/lib/libomp -fopenmp\"
+  if clang is installed without +openmp.)
 "
 
 test.run                yes
 test.target             libomp-micro-tests
 
 livecheck.url \
-    http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/?view=log
+    http://llvm.org/viewvc/llvm-project/openmp/trunk/?view=log
 
 livecheck.version       ${revision}
 livecheck.regex         revision=(\[0-9\]+)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150904/54b044ff/attachment.html>


More information about the macports-changes mailing list