mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-24 23:47:14 -08:00
llvm-runtimes/openmp: Add 24.0.0_pre20261028 snapshot
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -12,4 +12,5 @@ DIST llvm-project-22.1.8.src.tar.xz 167061596 BLAKE2B 092204f62e0f0364a041c737eb
|
||||
DIST llvm-project-22.1.8.src.tar.xz.sig 119 BLAKE2B 2ce93472036e68782252991e4a8bdbeeec8706a56022220083a38a42ef18714a7894c41aaa04dc0d03f18601d8bfc1a5a030ed0ef0f0d64a662eae9843a4b362 SHA512 99a457b5b1fb409a5fe72b59ebd4ddae5cade3e5f2493e33b44d4f4b4625f7a1743f80106efb1134668842b15ea3400ce2c29263bec8ff986e05040910125e15
|
||||
DIST llvm-project-23.1.4.src.tar.xz 179272572 BLAKE2B dbd14791e5674d89427f2abec54a30c5570bac6b8a2b210611bc4cb9ded4f057f729f8d20df29ec7ffca34f767294a1c589a09a13e79bef29b124d62a84a53ea SHA512 1443531768d7040677302e4468b95b345511f10881a072e703814e9e10316d6ce12f56e8d1fbab5c350550380ae8d242acebb68c833fa385ea7777f05d8bde23
|
||||
DIST llvm-project-23.1.4.src.tar.xz.sig 466 BLAKE2B 120e228f58ada689b8ae04221fc5c682c577f827e4e27e68a931e640c2462414681e0e3ca93ba6cefd4d910e138d17c673afd91220ff84afe49d299d01f2159a SHA512 1c37a50413faffb4f73c76583bbc3148d7e28005126aed0a41f63882aae174ba840aeaf6b43e56649d64e749fe9503c8f41435c7bdcf62468b1c0b4b93515802
|
||||
DIST llvm-project-ac4bd3cf8dd61a17d728ebc9b5ac9b3101eeed43.tar.gz 322898483 BLAKE2B e36e0632acedfccb87f39c22cc1109e909c80936ffcc245b6cecc5adf3cbda62f4ab2952d19d4dffca8bf4a2c05542af92c79d9563696d38396ad149597c2a5d SHA512 e4edc6aa681d537d5627ae36aa96f3a3b08333cd933678c0cbd7ec10d0da72e1b6ae1e79b05112b7af0e63602a24f5fd7428974565260e0efdd9a445861b3361
|
||||
DIST llvm-project-c5904d2bebe0497b30a712adc085e96107f03160.tar.gz 321341453 BLAKE2B d2915041721282318947af08cfa79b42017dcaf9674863469f97752a6f98c323539fda7c329a926b274a7e196da1aef7ed747945a5a374cfb0803474368a0214 SHA512 55fb2c912d0b87fa6bea5eacd1006a44f40a2880e59b6eec2e22e21cedd4b67eef0da66a58b03c508fc1f2e77e815cba034ed0b1c3cf11ad99a15186f16f9244
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
# Copyright 1999-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{12..14} )
|
||||
inherit cmake-multilib crossdev flag-o-matic llvm.org python-single-r1
|
||||
inherit toolchain-funcs
|
||||
|
||||
DESCRIPTION="OpenMP runtime libraries for LLVM/clang compiler"
|
||||
HOMEPAGE="https://openmp.llvm.org"
|
||||
|
||||
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
|
||||
SLOT="0/${LLVM_SOABI}"
|
||||
IUSE="
|
||||
+clang +debug fortran gdb-plugin hwloc offload ompt test
|
||||
cuda level-zero rocm
|
||||
"
|
||||
REQUIRED_USE="
|
||||
gdb-plugin? ( ${PYTHON_REQUIRED_USE} )
|
||||
"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
DEPEND="
|
||||
hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] )
|
||||
offload? (
|
||||
dev-libs/libffi:=
|
||||
~llvm-core/llvm-${PV}
|
||||
level-zero? ( dev-libs/level-zero:= )
|
||||
rocm? ( dev-libs/rocr-runtime:= )
|
||||
)
|
||||
"
|
||||
# tests:
|
||||
# - dev-python/lit provides the test runner
|
||||
# - llvm-core/llvm provide test utils (e.g. FileCheck)
|
||||
# - llvm-core/clang provides the compiler to run tests
|
||||
RDEPEND="
|
||||
${DEPEND}
|
||||
gdb-plugin? ( ${PYTHON_DEPS} )
|
||||
offload? (
|
||||
!llvm-runtimes/offload
|
||||
cuda? ( ~llvm-runtimes/openmp-nvptx64-nvidia-cuda-${PV} )
|
||||
level-zero? ( ~llvm-runtimes/openmp-spirv64-intel-${PV} )
|
||||
rocm? ( ~llvm-runtimes/openmp-amdgcn-amd-amdhsa-${PV} )
|
||||
)
|
||||
"
|
||||
BDEPEND="
|
||||
dev-lang/perl
|
||||
clang? ( llvm-core/clang )
|
||||
fortran? (
|
||||
llvm-core/flang:${LLVM_MAJOR}
|
||||
llvm-runtimes/flang-rt:${LLVM_MAJOR}
|
||||
)
|
||||
gdb-plugin? ( ${PYTHON_DEPS} )
|
||||
offload? (
|
||||
virtual/pkgconfig
|
||||
)
|
||||
test? (
|
||||
${PYTHON_DEPS}
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/lit[${PYTHON_USEDEP}]
|
||||
')
|
||||
llvm-core/clang:${LLVM_MAJOR}
|
||||
llvm-core/llvm:${LLVM_MAJOR}
|
||||
)
|
||||
"
|
||||
|
||||
LLVM_COMPONENTS=(
|
||||
runtimes openmp offload cmake libc llvm/{cmake,include,utils}
|
||||
third-party/unittest
|
||||
)
|
||||
llvm.org_set_globals
|
||||
|
||||
MULTILIB_WRAPPED_HEADERS=(
|
||||
/usr/include/offload/OffloadAPI.h
|
||||
/usr/include/offload/OffloadPrint.hpp
|
||||
/usr/include/offload/cuda/cuda_runtime.h
|
||||
/usr/include/offload/hip/hip_runtime.h
|
||||
/usr/include/offload/kernel/DefineLanguageNames.inc
|
||||
/usr/include/offload/kernel/LanguageErrors.h
|
||||
/usr/include/offload/kernel/LanguageLaunch.h
|
||||
/usr/include/offload/kernel/LanguageRuntime.h
|
||||
/usr/include/offload/kernel/Types.h
|
||||
/usr/include/offload/kernel/UndefineLanguageNames.inc
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
if [[ ${LLVM_ALLOW_GPU_TESTING} ]]; then
|
||||
ewarn "LLVM_ALLOW_GPU_TESTING set. This package will run tests against your"
|
||||
ewarn "GPU if it is supported. Note that these tests may be flaky, fail or"
|
||||
ewarn "hang, or even cause your GPU to crash (requiring a reboot)."
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
if use gdb-plugin || use test; then
|
||||
python-single-r1_pkg_setup
|
||||
fi
|
||||
}
|
||||
|
||||
multilib_src_configure() {
|
||||
if use clang && ! is_crosspkg; then
|
||||
# Only do this conditionally to allow overriding with
|
||||
# e.g. CC=clang-13 in case of breakage
|
||||
if ! tc-is-clang ; then
|
||||
local -x CC=${CHOST}-clang
|
||||
local -x CXX=${CHOST}-clang++
|
||||
fi
|
||||
|
||||
strip-unsupported-flags
|
||||
fi
|
||||
|
||||
if use fortran; then
|
||||
local -x FC=flang-${LLVM_MAJOR} F77=flang-${LLVM_MAJOR}
|
||||
strip-unsupported-flags
|
||||
else
|
||||
local -x FC= F77=
|
||||
fi
|
||||
|
||||
# LTO causes issues in other packages building, #870127
|
||||
filter-lto
|
||||
|
||||
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
|
||||
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
|
||||
|
||||
local libdir="$(get_libdir)"
|
||||
local mycmakeargs=(
|
||||
-DLLVM_ENABLE_RUNTIMES=openmp
|
||||
-DLLVM_LIBDIR_SUFFIX="${libdir#lib}"
|
||||
-DLLVM_BINARY_DIR="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}"
|
||||
|
||||
-DLIBOMP_USE_HWLOC=$(usex hwloc)
|
||||
-DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin)
|
||||
-DLIBOMP_OMPT_SUPPORT=$(usex ompt)
|
||||
|
||||
# do not install libgomp.so & libiomp5.so aliases
|
||||
-DLIBOMP_INSTALL_ALIASES=OFF
|
||||
# disable unnecessary hack copying stuff back to srcdir
|
||||
-DLIBOMP_COPY_EXPORTS=OFF
|
||||
# this breaks building static target libs
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
)
|
||||
|
||||
if multilib_is_native_abi && use fortran; then
|
||||
mycmakeargs+=(
|
||||
# cmake.eclass does not set if it we don't inherit fortran-2
|
||||
# and upstream code relies on it being set before Fortran logic
|
||||
# kicks in and reds envvars
|
||||
-DCMAKE_Fortran_COMPILER="${FC}"
|
||||
-DRUNTIMES_FORTRAN_MODULES=ON
|
||||
-DRUNTIMES_INSTALL_RESOURCE_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}"
|
||||
)
|
||||
fi
|
||||
|
||||
if multilib_is_native_abi && use offload; then
|
||||
local ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
|
||||
local ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
|
||||
local plugins="host"
|
||||
|
||||
if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then
|
||||
if use rocm; then
|
||||
plugins+=";amdgpu"
|
||||
fi
|
||||
if use cuda; then
|
||||
plugins+=";cuda"
|
||||
fi
|
||||
if use level-zero; then
|
||||
plugins+=";level_zero"
|
||||
fi
|
||||
fi
|
||||
|
||||
mycmakeargs+=(
|
||||
-DLLVM_ENABLE_RUNTIMES="openmp;offload"
|
||||
-DOFFLOAD_INCLUDE_TESTS=$(usex test)
|
||||
-DLIBOMPTARGET_PLUGINS_TO_BUILD="${plugins}"
|
||||
-DLIBOMPTARGET_OMPT_SUPPORT="$(usex ompt)"
|
||||
)
|
||||
|
||||
[[ ! ${LLVM_ALLOW_GPU_TESTING} ]] && mycmakeargs+=(
|
||||
# prevent trying to access the GPU
|
||||
-DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND
|
||||
-DLIBOMPTARGET_NVPTX_ARCH=LIBOMPTARGET_NVPTX_ARCH-NOTFOUND
|
||||
-DLIBOMPTARGET_OFFLOAD_ARCH=LIBOMPTARGET_OFFLOAD_ARCH-NOTFOUND
|
||||
)
|
||||
fi
|
||||
|
||||
use test && mycmakeargs+=(
|
||||
-DLLVM_LIT_ARGS="$(get_lit_flags)"
|
||||
-DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang-${LLVM_MAJOR}")"
|
||||
-DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++-${LLVM_MAJOR}")"
|
||||
# may be set to empty above
|
||||
-DOPENMP_TEST_Fortran_COMPILER="${FC}"
|
||||
)
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
multilib_src_test() {
|
||||
# respect TMPDIR!
|
||||
local -x LIT_PRESERVES_TMP=1
|
||||
local targets=( check-openmp )
|
||||
if multilib_is_native_abi && use offload; then
|
||||
targets+=( check-offload check-offload-unit )
|
||||
fi
|
||||
|
||||
if multilib_is_native_abi && use fortran; then
|
||||
# hack header search around by copying the modules to a directory
|
||||
# that is already given via -I
|
||||
cp "${BUILD_DIR}/$(get_libdir)/clang"/*/finclude/flang/*/*.mod \
|
||||
"${WORKDIR}/offload/test/" || die
|
||||
fi
|
||||
|
||||
cmake_build "${targets[@]}"
|
||||
}
|
||||
Reference in New Issue
Block a user