sys-libs/libomp: Add hwloc support
authorMichał Górny <mgorny@gentoo.org>
Thu, 29 Sep 2016 21:20:05 +0000 (23:20 +0200)
committerMichał Górny <mgorny@gentoo.org>
Thu, 29 Sep 2016 21:40:04 +0000 (23:40 +0200)
sys-libs/libomp/libomp-9999.ebuild
sys-libs/libomp/metadata.xml

index 2496f2083f43fa5562a29348f9970b099701d808..c64f8401c8e501a0cc8f63f9b5dd2af3df1d9e65 100644 (file)
@@ -18,13 +18,15 @@ EGIT_REPO_URI="http://llvm.org/git/openmp.git
 LICENSE="UoI-NCSA"
 SLOT="0"
 KEYWORDS=""
-IUSE="test"
+IUSE="hwloc test"
 
+RDEPEND="hwloc? ( sys-apps/hwloc:0= )"
 # tests:
 # - dev-python/lit provides the test runner
 # - sys-devel/llvm provide test utils (e.g. FileCheck)
 # - sys-devel/clang provides the compiler to run tests
-DEPEND="dev-lang/perl
+DEPEND="${RDEPEND}
+       dev-lang/perl
        test? (
                $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
                sys-devel/llvm
@@ -43,6 +45,7 @@ multilib_src_configure() {
        local libdir="$(get_libdir)"
        local mycmakeargs=(
                -DLIBOMP_LIBDIR_SUFFIX="${libdir#lib}"
+               -DLIBOMP_USE_HWLOC=$(usex hwloc)
                # do not install libgomp.so & libiomp5.so aliases
                -DLIBOMP_INSTALL_ALIASES=OFF
                # disable unnecessary hack copying stuff back to srcdir
index 7e5a689ec28a88f1bcc90601f6958a65e1fafd73..a6f393e8425a1280940ae89cbe2b2ce6fc6ba25b 100644 (file)
@@ -8,5 +8,8 @@
        <maintainer type="project">
                <email>llvm@gentoo.org</email>
        </maintainer>
+       <use>
+               <flag name='hwloc'>Enable CPU affinity support via hwloc</flag>
+       </use>
        <longdescription>The OpenMP subproject of LLVM is intended to contain all of the components required to build an executing OpenMP program that are outside the compiler itself.</longdescription>
 </pkgmetadata>