diff options
author | V3n3RiX <venerix@koprulu.sector> | 2025-01-05 06:31:58 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2025-01-05 06:31:58 +0000 |
commit | e4d9d6796d5018e338f0b27a3bc97716195bf0b8 (patch) | |
tree | 38d56da69a3b5d5ccc7d73796d38469f5d4e610c /llvm-runtimes/offload | |
parent | 38efae7f3eb932ed41510139679efd5c1e2f5eda (diff) |
gentoo auto-resync : 05:01:2025 - 06:31:57
Diffstat (limited to 'llvm-runtimes/offload')
-rw-r--r-- | llvm-runtimes/offload/Manifest | 2 | ||||
-rw-r--r-- | llvm-runtimes/offload/offload-20.0.0_pre20250104.ebuild | 155 |
2 files changed, 157 insertions, 0 deletions
diff --git a/llvm-runtimes/offload/Manifest b/llvm-runtimes/offload/Manifest index 3cc7508706ed..c7b501e1538d 100644 --- a/llvm-runtimes/offload/Manifest +++ b/llvm-runtimes/offload/Manifest @@ -1,7 +1,9 @@ DIST llvm-project-19.1.6.src.tar.xz 141248428 BLAKE2B b35ab0c754f28c850ac6fd4ee584e963b1d5cf06885c59827ee4ac11f93cde5b8e0268fbed560839137de2c495c9da2b889331cd12a8a02958d8e0cbdbed2607 SHA512 d411a6d913d6a1e1f3c16cfc1ce81c1e6292ea370703f55fb67c7af62f02193d53f5ef7823c8679d6f25cbe47b40236fcaf37044ad7cdfada8166efe7eb106b3 DIST llvm-project-19.1.6.src.tar.xz.sig 438 BLAKE2B 1791e98252ab78a9a762ef601ff9edee115385181781c8100f14ec80061d7888ee4c4c519297a0e89b9c7ab2203aa9d5bb3084ea1d0f0024c2acf84826fd370b SHA512 8e79a39a4f54da3579794f9b5a009ea8ee56c7bc1805187274794ce56e81aa492ea93f5c7839a59beedcf7d657acded5ecb75d5803658cce1f9e8f753439c6c4 +DIST llvm-project-2529a8df53af9bc6cecfd6c83404ffa5e89e3370.tar.gz 224493461 BLAKE2B 0d3c757a8f34a9bf6b2ac0ad394cc1f8125cfee534c8bd0c5875eba56fe0171892586ec05b6f1e859e5962f81c76c9a315f60bcda012df73a3bd66709b265038 SHA512 a49fa1da2fd398b279a90292704e30d8ff7163219bfd91c4a80fa5123d957cdef52d2ee41710a8bcbfea3d9a5eec269dfc756584fcc27a495f7f381176de4e69 DIST llvm-project-ccfe0de0e1e37ed369c9bf89dd0188ba0afb2e9a.tar.gz 224396427 BLAKE2B 6e13c65d2ba83fdaf2db20a58b878106568406f07f9c2ceb47e4d2572fb041211384ed67c43801764060101ec4a1b04c18bf4097f37512d2751aa5860c1a8dc3 SHA512 ef4512b735568aaa627a7f4e9bac3fc4722db7a2b8bd1610faaf066856be9474fb297fd75b3c0dcc76f60ab35c3110fd329faad3e8d9b75e93844d56f41c03d1 EBUILD offload-19.1.6.ebuild 4284 BLAKE2B 8eb5087b58a05270257b75a3522b5d3bed67d2c53127d26b1c112be6af959e17cf3e47a415b839bf16d1cd12b25a5da8765f0f2820f28a768c34486bded4716c SHA512 c113267fda6a4ffae225e1ebdfff84ebc847cda967f992ee56dd4c9995670639767f71f9ce5d352373e9c9c8d8d6f4dafa5bf4242376865c82e1394a5dca9f81 EBUILD offload-20.0.0.9999.ebuild 3934 BLAKE2B 9ac1571296b78bdcc1f3c7108962181fd3630e6052d4d9bed39ae4c335a62920d7b1347fc52df4ae8fba37c799027da13441bc6309a9629eaec1332e5fcf84a9 SHA512 db745650bb54fd0319c1d0b0196a3b714a0185844578a01f280f473f8fb874b991d817f01bf3740fcaae32cfe228c410186f9fb2a6ede9a74cff6cd32f859b47 EBUILD offload-20.0.0_pre20241227.ebuild 3934 BLAKE2B 9ac1571296b78bdcc1f3c7108962181fd3630e6052d4d9bed39ae4c335a62920d7b1347fc52df4ae8fba37c799027da13441bc6309a9629eaec1332e5fcf84a9 SHA512 db745650bb54fd0319c1d0b0196a3b714a0185844578a01f280f473f8fb874b991d817f01bf3740fcaae32cfe228c410186f9fb2a6ede9a74cff6cd32f859b47 +EBUILD offload-20.0.0_pre20250104.ebuild 3934 BLAKE2B b6a812e9c2d9fd6dd6b3baf0eb93ba02df81c9b054d0f1b3259d0a1abf58def752e004659fc75d41ab6096d9593f13436986cc029379b3fa529114dbd2f38a5a SHA512 4dabdf7c290041662c2ce552d2920ea666a0afddfb794fdbb909add2e9d6e1486e5e0f05c3952dd0d4df385218ce133ca5dbdc72bd423f1ed1a8559d44aabb1e MISC metadata.xml 379 BLAKE2B 2b4c75d4ec6e126d887b736ea978c4b34683a347252f408c9d1f5f55c6c1bead7b7f9533812806f816538d8abaa00ded4d439dbe626d3f2cf09b78a3674e41bd SHA512 d49054d4b5a1a051d83f1ef397a7925fb36ee3092668d134e6ed5c1218bf5d67a43145b689709677643da070a783ec9f8705b37f15587475829fe185634af1d4 diff --git a/llvm-runtimes/offload/offload-20.0.0_pre20250104.ebuild b/llvm-runtimes/offload/offload-20.0.0_pre20250104.ebuild new file mode 100644 index 000000000000..c862c6448973 --- /dev/null +++ b/llvm-runtimes/offload/offload-20.0.0_pre20250104.ebuild @@ -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 +} |