mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
llvm-runtimes/offload: Add 20.0.0_pre20250122 snapshot
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -3,4 +3,5 @@ DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9
|
||||
DIST llvm-project-19.1.7.src.tar.xz 141249332 BLAKE2B 1259ed7f9aca7b35e89d818befdee20fd8bed4d2dc2c2c6f6f56451fd43d35ac03a0a5a406e142d22b25137999dc5b17471c196f8fcf79f20a8296832d900f6d SHA512 c7d63286d662707a9cd54758c9e3aaf52794a91900c484c4a6efa62d90bc719d5e7a345e4192feeb0c9fd11c82570d64677c781e5be1d645556b6aa018e47ec8
|
||||
DIST llvm-project-19.1.7.src.tar.xz.sig 438 BLAKE2B 4015140f4ba77de45039bdbdfbaf6f30e75705123d067ea97175d91d7a5b6a75008df01d99ae7aa16aaa3b101f3f41e38d01f04158f95a261d617b3ede0254cd SHA512 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda
|
||||
DIST llvm-project-8af4d206e0f979f68925a08f9dffd60a98ce97e2.tar.gz 224825146 BLAKE2B 36e9c8f9615d65fc72beb699c4ce5959676975267a4c4288a01009d26ab84ae411f2855e4e6475957b91ddc21da29251ab22e331395bc9fee0f9bc907a05384a SHA512 ec72cdd7cc6d9bef31ae9295606d18e4935468fe60ab632aced21261d437e76f11d83d0d7199a6028689990260d9155098f7d64e97db0e0af28ea6c75a773bcc
|
||||
DIST llvm-project-97c3a990f05606cb807faf53bc41302fb62c7980.tar.gz 226261635 BLAKE2B 9dd0bdfaa6ee984747f2d9d8b9606cd8d2e75fa64d45fd7c87227ddca7cffe888a1d932d73c123b25360690fd687554cc333fb3d871ab0e72ddd2b1158bae2e0 SHA512 466ae8aea014fd396f3fd6b77055238a672f012b79f25ed0b215e01f968a56dd4eeaf148d03246701b1ac4cbb8f02a4325142d6e5503fb6231e330c2e49e28e7
|
||||
DIST llvm-project-c3a935e3f967f8f22f5db240d145459ee621c1e0.tar.gz 225133913 BLAKE2B ced922010bad14df6bce0dbbb9323ee3cc9d7bf2f764f8c982d134d7a97e38d84b0b81635bbb16031aa1899c744e7c036cec5d1957733bbed7a2f18f89db0b6f SHA512 0ea083defb3c0ecaa5d8d28682f140c68ec6b3ab6cbfc60fc38a9265a8eb88b618c075d6ae03170ed54c5e7dcb3b7003eaacea2fcb115e9864b64a17cea0013d
|
||||
|
||||
155
llvm-runtimes/offload/offload-20.0.0_pre20250122.ebuild
Normal file
155
llvm-runtimes/offload/offload-20.0.0_pre20250122.ebuild
Normal file
@@ -0,0 +1,155 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{10..13} )
|
||||
inherit cmake flag-o-matic llvm.org python-any-r1 toolchain-funcs
|
||||
|
||||
DESCRIPTION="OpenMP offloading support"
|
||||
HOMEPAGE="https://openmp.llvm.org"
|
||||
|
||||
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
|
||||
SLOT="0/${LLVM_SOABI}"
|
||||
IUSE="+debug ompt test llvm_targets_AMDGPU llvm_targets_NVPTX"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="
|
||||
dev-libs/libffi:=
|
||||
~llvm-core/llvm-${PV}
|
||||
~llvm-runtimes/openmp-${PV}[ompt?]
|
||||
llvm_targets_AMDGPU? ( dev-libs/rocr-runtime:= )
|
||||
"
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
"
|
||||
# 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
|
||||
BDEPEND="
|
||||
dev-lang/perl
|
||||
virtual/pkgconfig
|
||||
llvm_targets_AMDGPU? ( llvm-core/clang )
|
||||
llvm_targets_NVPTX? ( llvm-core/clang )
|
||||
test? (
|
||||
$(python_gen_any_dep '
|
||||
dev-python/lit[${PYTHON_USEDEP}]
|
||||
')
|
||||
llvm-core/clang
|
||||
)
|
||||
"
|
||||
# TODO: can it be fixed to compile with gcc?
|
||||
BDEPEND+="
|
||||
llvm-core/clang
|
||||
"
|
||||
|
||||
LLVM_COMPONENTS=( offload cmake runtimes/cmake libc/shared )
|
||||
LLVM_TEST_COMPONENTS=( openmp/cmake )
|
||||
llvm.org_set_globals
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
python_check_deps() {
|
||||
python_has_version "dev-python/lit[${PYTHON_USEDEP}]"
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
if use test; then
|
||||
python-any-r1_pkg_setup
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# TODO
|
||||
local -x CC=${CHOST}-clang
|
||||
local -x CXX=${CHOST}-clang++
|
||||
strip-unsupported-flags
|
||||
|
||||
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
|
||||
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
|
||||
|
||||
local libdir="$(get_libdir)"
|
||||
local ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
|
||||
local ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
|
||||
local plugins="host"
|
||||
local gpus=
|
||||
local build_devicertl=FALSE
|
||||
|
||||
if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then
|
||||
if use llvm_targets_AMDGPU; then
|
||||
plugins+=";amdgpu"
|
||||
build_devicertl=TRUE
|
||||
gpus+="amdgpu"
|
||||
fi
|
||||
if use llvm_targets_NVPTX; then
|
||||
plugins+=";cuda"
|
||||
build_devicertl=TRUE
|
||||
gpus+="nvptx"
|
||||
fi
|
||||
[[ ${gpus} == amdgpunvptx ]] && gpus=all
|
||||
fi
|
||||
|
||||
local mycmakeargs=(
|
||||
-DLLVM_ROOT="${ESYSROOT}/usr/lib/llvm/${LLVM_MAJOR}"
|
||||
|
||||
-DOFFLOAD_LIBDIR_SUFFIX="${libdir#lib}"
|
||||
-DLIBOMPTARGET_PLUGINS_TO_BUILD="${plugins}"
|
||||
-DLIBOMPTARGET_OMPT_SUPPORT="$(usex ompt)"
|
||||
-DLIBOMPTARGET_BUILD_DEVICERTL_BCLIB="${build_devicertl}"
|
||||
|
||||
# this breaks building static target libs
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
|
||||
-DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
|
||||
-DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
|
||||
)
|
||||
|
||||
[[ ! ${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
|
||||
)
|
||||
[[ -n ${gpus} ]] && mycmakeargs+=(
|
||||
-DLIBOMPTARGET_DEVICE_ARCHITECTURES="${gpus}"
|
||||
)
|
||||
use test && mycmakeargs+=(
|
||||
# this project does not use standard LLVM cmake macros
|
||||
-DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit"
|
||||
-DOPENMP_LIT_ARGS="$(get_lit_flags)"
|
||||
|
||||
-DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")"
|
||||
-DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")"
|
||||
# requires flang
|
||||
-DOPENMP_TEST_Fortran_COMPILER=
|
||||
)
|
||||
|
||||
cmake_src_configure
|
||||
|
||||
if [[ -z ${gpus} ]]; then
|
||||
# clang requires libomptarget.devicertl.a, but it can be empty
|
||||
> "${BUILD_DIR}"/libomptarget.devicertl.a || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# respect TMPDIR!
|
||||
local -x LIT_PRESERVES_TMP=1
|
||||
|
||||
cmake_build check-offload
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake_src_install
|
||||
|
||||
if [[ ! -f ${ED}/usr/$(get_libdir)/libomptarget.devicertl.a ]]
|
||||
then
|
||||
dolib.a "${BUILD_DIR}"/libomptarget.devicertl.a
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user