Hanspeter,
      It has been a couple of weeks now since I emailed David Fang
about the update to the llvm39 package to add the proposed llvm-clang,
libomp-dev and libomp-shlibs split-offs required to cleanly support
packages like the gromacs/gromacs-mpi-2016-1 updates which require a
clang that supports -fopenmp without tethering the package to a
specific llvmXY release. The proposed changes are quite sensible,
straight-forward and safe...

https://sourceforge.net/p/fink/package-submissions/4831/
https://sourceforge.net/p/fink/package-submissions/4827/

Index: llvm39.info
===================================================================
RCS file: 
/cvsroot/fink/dists/10.9-libcxx/stable/main/finkinfo/languages/llvm39.info,v
retrieving revision 1.2
diff -u -r1.2 llvm39.info
--- llvm39.info 27 Oct 2016 04:01:28 -0000 1.2
+++ llvm39.info 13 Nov 2016 18:26:26 -0000
@@ -1,7 +1,7 @@
 Info3: <<
 Package: llvm39
 Version: 3.9.0
-Revision: 1
+Revision: 2
 Description: Modular and reusable compiler
 License: BSD
 Maintainer: David Fang <fang...@users.sourceforge.net>
@@ -54,8 +54,8 @@

 PatchFile: %n.patch
 PatchFile-MD5: 6addcbd4c9fe449b3cd006eb48f5219b
-#PatchFile2: %n-clang.patch
-#PatchFile2-MD5: d2a2b4207c19b7f09f197ae9769a51d2
+PatchFile2: %n-clang.patch
+PatchFile2-MD5: 25a45c309e14611b278c30b782f0d7e5
 #PatchFile3: %n-compiler-rt.patch
 #PatchFile3-MD5: 60ed1415e15b1781f2d58c0db17aab78
 #PatchFile4: %n-polly.patch
@@ -65,7 +65,7 @@
 #PatchFile6: %n-clang-omp.patch
 #PatchFile6-MD5: 8067f4cc1f58030f7746521d58c776c2
 PatchFile7: %n-clang-iomp5.patch
-PatchFile7-MD5: 33f21b006473cbdd5feced616b05903b
+PatchFile7-MD5: d5d9686fd0727c0e1cd953f585f4481d

 PatchScript: <<
  #!/bin/sh -ev
@@ -108,7 +108,7 @@
  pushd tools/clang
   # Apply clang-omp merge before clang patch
   #$patch_filter %{PatchFile6} | patch -p1
-  #$patch_filter %{PatchFile2} | patch -p1
+  $patch_filter %{PatchFile2} | patch -p1
   $patch_filter %{PatchFile7} | patch -p1
  popd
  pushd tools/polly
@@ -1078,15 +1078,6 @@
  iprefix=%i/$stem
  prefix=%p/$stem

- # Pass path to libLTO.dylib with -lto_library using ld shell script
- pushd $iprefix/bin
- cat <<EOF > ./ld
-#!/bin/sh
-exec /usr/bin/ld -lto_library %p/opt/llvm-3.9/lib/libLTO.dylib "\$@"
-EOF
- chmod ugo+x ./ld
- popd
-
 # convenient clang symlinks
  mkdir -p %i/bin
  pushd %i/bin
@@ -1112,6 +1103,26 @@
  cp %b/../build/last/*-check.log testlogs/
  cp %b/../build/last-libcxx/*-check.log testlogs/
  popd
+
+# place omp.h in %p/include/libomp for common libomp-dev package
+ install -d %i/include/libomp
+ pushd %i/opt/llvm-$brv/lib/clang/%v/include
+ mv omp.h %i/include/libomp
+ popd
+
+# place libomp.dylib in libomp subdirectory for common libomp-shlibs package
+# leave legacy copy in %p/opt/llvm-$brv/lib for clang39-shlibs
+ install -d %i/lib/libomp
+ pushd %i/opt/llvm-$brv/lib
+ cp libomp.dylib %i/lib/libomp
+ ln -s libomp.dylib %i/lib/libomp/libiomp5.dylib
+ ln -s libomp.dylib %i/lib/libomp/libgomp.dylib
+ popd
+ install_name_tool -id %p/lib/libomp/libomp.dylib %i/lib/libomp/libomp.dylib
+
+# create compiler symlinks for common llvm-clang split-off
+ ln -s clang-$brv %i/bin/llvm-clang
+ ln -s clang++-$brv %i/bin/llvm-clang++
 <<
 SplitOff: <<
  Package: clang39-tools
@@ -1178,7 +1189,9 @@
  # odcctools,
  # choosing to require opt-in instead of defaulting to libcxx1-dev
  # libcxx1-dev,
+ libomp-dev (>= %v-%r),
  clang39-shlibs (= %v-%r),
+ libomp-shlibs (>= %v-%r),
  polly39-shlibs (= %v-%r)
  <<
  Description: Executables and runtime for clang compiler
@@ -1186,7 +1199,6 @@
  Files: <<
  bin/clang*
  opt/llvm-3.9/bin/clang*
- opt/llvm-3.9/bin/ld
  opt/llvm-3.9/lib/clang
  <<
  DescUsage: <<
@@ -1313,6 +1325,37 @@
  <<
 <<
 SplitOff14: <<
+ Package: libomp-shlibs
+ Description: Standard library for libomp
+ Files: <<
+ (%m != powerpc) lib//libomp/lib*omp*.dylib
+ <<
+ DocFiles: <<
+ projects/openmp/CREDITS.txt
+ projects/openmp/LICENSE.txt
+ <<
+ Shlibs: <<
+ (%m != powerpc) %p/lib/libomp/libomp.dylib 5.0.0 %n (>= 3.9.0-2)
+ <<
+<<
+SplitOff15: <<
+ Package: libomp-dev
+ Description: Standard library header for libomp
+ Depends: libomp-shlibs (= %v-%r)
+ BuildDependsOnly: false
+ Files: include/libomp/omp.h
+ DescPackaging: <<
+ BuildDependsOnly set to false since clang compiler always needs
+ access to omp.h at run-time.
+ <<
+<<
+SplitOff16: <<
+ Package: llvm-clang
+ Description: LLVM.org clang compilers
+ Depends: clang39 (= %v-%r)
+ Files: bin/llvm-clang bin/llvm-clang++
+<<
+SplitOff17: <<
  Package: %N-bundle
  Description: Bundle of LLVM/Clang compiler tools
  Type: bundle

I would also point out that David left the details of the openmp
support in the llvmXY packaging up to me since I was working with the
upstream developers to make sure the openmp support on darwin had no
regressions compared to linux.
     Please go ahead and commit the attached packaging files into the
10.9-libc++ tree so we can have the current version of gromacs and
gromacs-mpi. Thanks in advance.

                Jack
ps This refactoring of llvm39 is *extremely* useful to other fink
package maintainers as it simplifies their task of building against a
-fopenmp-savvy clang to just adding a

BuildDepends: llvm-clang, libomp-dev
Depends: libomp-shlibs

which will result in the llvm-clang split-off from the most recent
llvmXY package being used. It also fully decouples the libomp.dylib
and omp.h dependencies from a specific llvmXY package.

pos The deprecation of the ld script again is now allowed by the back
port of the llvm 4.0 changes to clang in llvm39-clang.patch which
cause the compiler to automatically emit -lto_library for the linkage
with the correct path to the libLTO.dylib bundled with the specific
llvmXY release.

Attachment: llvm39.info
Description: Binary data

Attachment: llvm39.patch
Description: Binary data

Attachment: llvm39-clang-iomp5.patch
Description: Binary data

Attachment: llvm39-clang.patch
Description: Binary data

Attachment: gromacs.info
Description: Binary data

Attachment: gromacs-mpi.info
Description: Binary data

Attachment: gromacs-libxml2.patch
Description: Binary data

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to