llvm-runtimes/openmp: Add 23.0.0_pre20260716

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2026-07-16 16:01:23 +02:00
parent 333702753a
commit 7589faff6f
2 changed files with 178 additions and 0 deletions
+1
View File
@@ -13,3 +13,4 @@ DIST llvm-project-21.1.8.src.tar.xz.sig 119 BLAKE2B cffc1825f5778a3e3c128ec3e856
DIST llvm-project-22.1.8.src.tar.xz 167061596 BLAKE2B 092204f62e0f0364a041c737eb2c25fd073cb5689663d6ccd5a9e4e1743d6d80822360d59b64bff7b4d7872a68a79e899bf2f75f384e55c7d313a79243576f03 SHA512 2615b20ba08534f83ab8ecc7b5ba43b5f1dfcf9cdb2534a32fcdbf0ccdd9a008b46276e45ef26ed9377f65b5e4ae89ea798f3863fd034484b5715140f3a7b35c
DIST llvm-project-22.1.8.src.tar.xz.sig 119 BLAKE2B 2ce93472036e68782252991e4a8bdbeeec8706a56022220083a38a42ef18714a7894c41aaa04dc0d03f18601d8bfc1a5a030ed0ef0f0d64a662eae9843a4b362 SHA512 99a457b5b1fb409a5fe72b59ebd4ddae5cade3e5f2493e33b44d4f4b4625f7a1743f80106efb1134668842b15ea3400ce2c29263bec8ff986e05040910125e15
DIST llvm-project-43ccdbc84774da0ae4cb5131f2245a9633d977b9.tar.gz 276747748 BLAKE2B 874e5d95e8f3a8401ec989f093095be6203fa77c9729ef66981a13cbff91e6937a9925257f051650c820ea82f6ab8c03884a5a3599e2b450bed11b95c54cc440 SHA512 a84e2f97abc92bdf4da8a00cc89f22d28adef44b316f02992708ee2ebb78f0d4ce38254389a1408caa4b0846134af47ca4bccbfe987f014fefe439495bed3848
DIST llvm-project-ce6af707aac85db6e176ad0faa3bfe608e1a68f5.tar.gz 277486383 BLAKE2B 03b4df53f1605e4cbe2a8b23a875b78f1336c5b0212d5e9591bf8f898abf0d947f8ff4551b2c9c0044fa18da1dd98e4ded4fe6ce7cb56df17e6cf9c1912afafe SHA512 5be1db6b9cabeed3b7db4c94c7dc06b5fac0dd5f4225a8dd06792494a0ca1dce45959b03e342edf2bce076fd19de81aa6f1451eda09047532e61546cf1f8d283
@@ -0,0 +1,177 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{11..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 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 )
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/OffloadPrint.hpp
/usr/include/offload/OffloadAPI.h
)
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
# 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 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}")"
# disable Fortran tests for now
# (TODO: enable where we have flang keyworded)
-DOPENMP_TEST_Fortran_COMPILER=
)
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
cmake_build "${targets[@]}"
}