sys-devel/llvm: Set libomp as default OpenMP provider in -9999, #562990
authorMichał Górny <mgorny@gentoo.org>
Sat, 5 Dec 2015 16:32:24 +0000 (17:32 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sat, 5 Dec 2015 16:34:43 +0000 (17:34 +0100)
Use libomp as default OpenMP provider rather than libgomp because the
support for the latter is unable to find omp.h without explicit -I, and
provides syntax checking only.

Bug: https://bugs.gentoo.org/show_bug.cgi?id=562990

sys-devel/llvm/llvm-9999.ebuild

index e65e57368880fd7f09f432e003d22ad78565cdf1..2f8afe7563401285417a669a88b81a9c07a1c1aa 100644 (file)
@@ -254,6 +254,9 @@ multilib_src_configure() {
        if use clang; then
                mycmakeargs+=(
                        -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
+                       # libgomp support fails to find headers without explicit -I
+                       # furthermore, it provides only syntax checking
+                       -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
                )
        fi
 
@@ -481,8 +484,7 @@ multilib_src_install_all() {
 }
 
 pkg_postinst() {
-       if use clang; then
-               elog "To enable OpenMP support in clang, install sys-libs/libomp"
-               elog "and use the '-fopenmp=libomp' command line option"
+       if use clang && ! has_version 'sys-libs/libomp'; then
+               elog "To enable OpenMP support in clang, install sys-libs/libomp."
        fi
 }