Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libomp/
Date: Wed, 01 Aug 2018 20:53:46
Message-Id: 1533156803.b4d69f819e7d13e0849d08ae3f452d680f9f25c5.mgorny@gentoo
1 commit: b4d69f819e7d13e0849d08ae3f452d680f9f25c5
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 1 16:45:26 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 1 20:53:23 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4d69f81
7
8 sys-libs/libomp: Branch out LLVM 7.0
9
10 sys-libs/libomp/libomp-7.0.9999.ebuild | 116 +++++++++++++++++++++++++++++++++
11 1 file changed, 116 insertions(+)
12
13 diff --git a/sys-libs/libomp/libomp-7.0.9999.ebuild b/sys-libs/libomp/libomp-7.0.9999.ebuild
14 new file mode 100644
15 index 00000000000..8c9332ca58e
16 --- /dev/null
17 +++ b/sys-libs/libomp/libomp-7.0.9999.ebuild
18 @@ -0,0 +1,116 @@
19 +# Copyright 1999-2018 Gentoo Foundation
20 +# Distributed under the terms of the GNU General Public License v2
21 +
22 +EAPI=6
23 +
24 +: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
25 +# (needed due to CMAKE_BUILD_TYPE != Gentoo)
26 +CMAKE_MIN_VERSION=3.7.0-r1
27 +PYTHON_COMPAT=( python2_7 )
28 +
29 +inherit cmake-multilib git-r3 linux-info multiprocessing python-any-r1
30 +
31 +DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
32 +HOMEPAGE="https://openmp.llvm.org"
33 +SRC_URI=""
34 +EGIT_REPO_URI="https://git.llvm.org/git/openmp.git
35 + https://github.com/llvm-mirror/openmp.git"
36 +EGIT_BRANCH="release_70"
37 +
38 +# Additional licenses:
39 +# - MIT-licensed Intel code,
40 +# - LLVM Software Grant from Intel.
41 +
42 +LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant"
43 +SLOT="0"
44 +KEYWORDS=""
45 +IUSE="cuda hwloc kernel_linux offload ompt test"
46 +# CUDA works only with the x86_64 ABI
47 +REQUIRED_USE="offload? ( cuda? ( abi_x86_64 ) )"
48 +RESTRICT="!test? ( test )"
49 +
50 +RDEPEND="
51 + hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )
52 + offload? (
53 + virtual/libelf:=[${MULTILIB_USEDEP}]
54 + virtual/libffi:=[${MULTILIB_USEDEP}]
55 + cuda? ( dev-util/nvidia-cuda-sdk:= )
56 + )"
57 +# tests:
58 +# - dev-python/lit provides the test runner
59 +# - sys-devel/llvm provide test utils (e.g. FileCheck)
60 +# - sys-devel/clang provides the compiler to run tests
61 +DEPEND="${RDEPEND}
62 + dev-lang/perl
63 + offload? ( virtual/pkgconfig[${MULTILIB_USEDEP}] )
64 + test? (
65 + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
66 + >=sys-devel/clang-6
67 + )"
68 +
69 +# least intrusive of all
70 +CMAKE_BUILD_TYPE=RelWithDebInfo
71 +
72 +python_check_deps() {
73 + has_version "dev-python/lit[${PYTHON_USEDEP}]"
74 +}
75 +
76 +kernel_pds_check() {
77 + if use kernel_linux && kernel_is -lt 4 15 && kernel_is -ge 4 13; then
78 + local CONFIG_CHECK="~!SCHED_PDS"
79 + local ERROR_SCHED_PDS="\
80 +PDS scheduler versions >= 0.98c < 0.98i (e.g. used in kernels >= 4.13-pf11
81 +< 4.14-pf9) do not implement sched_yield() call which may result in horrible
82 +performance problems with libomp. If you are using one of the specified
83 +kernel versions, you may want to disable the PDS scheduler."
84 +
85 + check_extra_config
86 + fi
87 +}
88 +
89 +pkg_pretend() {
90 + kernel_pds_check
91 +}
92 +
93 +pkg_setup() {
94 + use test && python-any-r1_pkg_setup
95 +}
96 +
97 +multilib_src_configure() {
98 + local libdir="$(get_libdir)"
99 + local mycmakeargs=(
100 + -DOPENMP_LIBDIR_SUFFIX="${libdir#lib}"
101 +
102 + -DLIBOMP_USE_HWLOC=$(usex hwloc)
103 + -DLIBOMP_OMPT_SUPPORT=$(usex ompt)
104 +
105 + -DOPENMP_ENABLE_LIBOMPTARGET=$(usex offload)
106 +
107 + # do not install libgomp.so & libiomp5.so aliases
108 + -DLIBOMP_INSTALL_ALIASES=OFF
109 + # disable unnecessary hack copying stuff back to srcdir
110 + -DLIBOMP_COPY_EXPORTS=OFF
111 + )
112 + use offload && mycmakeargs+=(
113 + # this is non-fatal and libomp checks for CUDA conditionally
114 + # to ABI, so we can just ignore passing the wrong value
115 + # on non-amd64 ABIs
116 + -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=$(usex !cuda)
117 + )
118 + use test && mycmakeargs+=(
119 + # this project does not use standard LLVM cmake macros
120 + -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit"
121 + -DOPENMP_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
122 +
123 + -DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")"
124 + -DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")"
125 + )
126 + cmake-utils_src_configure
127 +}
128 +
129 +multilib_src_test() {
130 + # respect TMPDIR!
131 + local -x LIT_PRESERVES_TMP=1
132 +
133 + cmake-utils_src_make check-libomp
134 +}