mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-22 23:07:10 -08:00
llvm-runtimes/openmp: Add 23.0.0_pre20260507 snapshot
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
DIST llvm-project-0f3ca6bb9ca514518c55fc02855a6083312ddfe2.tar.gz 271131672 BLAKE2B fe9b37bd214cbc401c24b1fd661321e6147696fe0be90cae66cf57e0dcf51a76e5977d1c786de382354b0eda8d0b2cb703f3ffb2645ccf20bcd5b37fc1c5d28f SHA512 8873c9ac3e95aae59cecd8652dbb21b76795ea9ee27ff3a9a74964e5d2378d91e45d86aa859855be0a0b4d5eb00e292f04ea929ce290b4df10f87203ac0713a2
|
||||
DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7
|
||||
DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447
|
||||
DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30
|
||||
|
||||
@@ -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[@]}"
|
||||
}
|
||||
Reference in New Issue
Block a user