commit:     de0ea1f1898758a2e5f9973d3c248b800675360c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 29 21:20:05 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep 29 21:40:04 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de0ea1f1

sys-libs/libomp: Add hwloc support

 sys-libs/libomp/libomp-9999.ebuild | 7 +++++--
 sys-libs/libomp/metadata.xml       | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/sys-libs/libomp/libomp-9999.ebuild 
b/sys-libs/libomp/libomp-9999.ebuild
index 2496f20..c64f840 100644
--- a/sys-libs/libomp/libomp-9999.ebuild
+++ b/sys-libs/libomp/libomp-9999.ebuild
@@ -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

diff --git a/sys-libs/libomp/metadata.xml b/sys-libs/libomp/metadata.xml
index 7e5a689..a6f393e 100644
--- a/sys-libs/libomp/metadata.xml
+++ b/sys-libs/libomp/metadata.xml
@@ -8,5 +8,8 @@
        <maintainer type="project">
                <email>l...@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>

Reply via email to