llvm-runtimes/openmp: Add 23.0.0

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2026-08-29 09:30:10 +02:00
parent e964f8cdeb
commit 4cb4c2998e
2 changed files with 179 additions and 0 deletions
+2
View File
@@ -15,4 +15,6 @@ DIST llvm-project-23.1.0-rc2.src.tar.xz 179079292 BLAKE2B 59b4ae719ca496b29e37c1
DIST llvm-project-23.1.0-rc2.src.tar.xz.sig 466 BLAKE2B c7acaa7f8833286cd0037c4c31ba8a1bb20f4a09b62979c7df9f69993728406b1a42db62d2ab2a34c526c0bdae1bc027074a623142420d2fc264c3f83e3c0f7b SHA512 7e2db57ed17efe3bf36c476049973b760af60c8a9302992a17e050e7a61db7b92df0b6c06f26989c61ce2e4682e7604bfdd0f063e322a726923e857890cedc8c
DIST llvm-project-23.1.0-rc3.src.tar.xz 179126732 BLAKE2B f0843aacbf9ebd57929dbba0436773775dc121223ae3a81d1c30bd5a3ccba136359b9e483d2be58546dc6bf468743711d5057f8b1486e5ba4d59a96136426c3c SHA512 0c9bdf4c75784269bd4560d94126e667d1d145da2f6db4d94f437b2388880f3dcb52f85c0580d78e2597b141511a4b7ddadfc31f83b690d5cd383e84330ce247
DIST llvm-project-23.1.0-rc3.src.tar.xz.sig 466 BLAKE2B c7bd61c1cab2bdb4c8026aa095f7543e7c2f50520531f3ca6bd8c0cb78b2a7770d39723cec6effe9366c260d01b0db2bfd072281790b63b7d0d8b48339f51c42 SHA512 751f602d29235d4ce58a0d38c23f360977cb9e978e04399b3032053e7168903a721d307f001864b73fef8f567023eebe8f4fdbf4124667789d0afaff57b01d7d
DIST llvm-project-23.1.0.src.tar.xz 179140728 BLAKE2B 9253189469c70b1e7e326851635934fab85bf64139f1dcd44721ab261c097c9980276d48eac705b999cde0a024a362191c719646956504364534585dbf57d643 SHA512 f87a6084a4b4ddbf155949bb0a9d95592e665683d03db59c65002520634db57bb0b9e90011cbdf1dfc72bf2c649cebc5c546a1de4811c3bfc0b89620b1669061
DIST llvm-project-23.1.0.src.tar.xz.sig 119 BLAKE2B 6bd4f681aa0926b3a8e896993fcb238749a5b29dd26f6637e5543699334c0818223d9c798da35515f27fd197cc7de370cc70de3e1bb6721e6c7cac3050879fc7 SHA512 3b1ffaf6fbc6ed08c1d0523b565fb63cbde1a76344bb3ed1a53722482927c03e2652859ef44de962ce90bdb7c5711db63f8d98559bc86cb58294a1cfc62e4b4f
DIST llvm-project-bb9934d4dfef9033ded36d26827dbb6d3ac1dd92.tar.gz 277566365 BLAKE2B 401320655d19b3d430d15a48e2daf1f00567ef87fd2d1f86c3d505a1b2f5920db6cbfa620bf1b0561cd318d6046830d5b19fe0e7b58647863372c6c96526526c SHA512 354b901ca80227abe6b0514eeba437f237ea2658dd1927bb6e1d3b0b298bdb0dfdb7855c0f359eea4977dd344f6d0f6d1ce486ea0100d4a5615a9139ef198fca
+177
View File
@@ -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_{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 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[@]}"
}