diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-07-17 12:28:32 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-07-17 12:28:32 +0100 |
commit | 16857b69f990738d17bc5842e3e49a6e82d1428d (patch) | |
tree | 09af7d330926974197aa59536133e026de791874 /dev-cpp/eigen | |
parent | b6fa31c964a602f8461a77d5b83355e8750c12eb (diff) |
gentoo auto-resync : 17:07:2024 - 12:28:31
Diffstat (limited to 'dev-cpp/eigen')
-rw-r--r-- | dev-cpp/eigen/Manifest | 2 | ||||
-rw-r--r-- | dev-cpp/eigen/eigen-3.4.0-r3.ebuild | 458 | ||||
-rw-r--r-- | dev-cpp/eigen/files/eigen-3.4.0-ppc-no-vsx.patch | 195 |
3 files changed, 655 insertions, 0 deletions
diff --git a/dev-cpp/eigen/Manifest b/dev-cpp/eigen/Manifest index 99e3e0d4e34e..530d9bf67e93 100644 --- a/dev-cpp/eigen/Manifest +++ b/dev-cpp/eigen/Manifest @@ -4,11 +4,13 @@ AUX eigen-3.4.0-buildstring.patch 716 BLAKE2B f9453cab7a7e4609b5801b7f8470bac2ed AUX eigen-3.4.0-cxxstandard.patch 4274 BLAKE2B cd837966150b4cdd6a4080aba0b58785401adf03e3273b83cd03b4b999795b8d87419e31ed27e018feefda659627a3d62b538f7379de13c85fabfbcbdf9fa9f4 SHA512 473ea735425534403f6f66d1e3601e1fcaf6e1f2558f6b1b9695a69e05a4769d0951d4174d99f8853f3a0176d7c7722cbfb9942459da07bbe1636fd4cc847f95 AUX eigen-3.4.0-doc-nocompress.patch 873 BLAKE2B 0458b8e4c03fb8ef3f4ecd74d9f285ca8aa3787a0fd466922f45cb96386c8c5cd35116db4ab2caddc841e47cbf2678594ebf727153804878761dc455f08c2c81 SHA512 a4763cb037a16c12dc3d6a6ac075c7ff130ea9d2913f76472e61d821e45cfcce446ad11e43426227e7b60268a14cd952ee81104ca594c3710bde56d655f910b0 AUX eigen-3.4.0-noansi.patch 729 BLAKE2B 60088bddb6d79992e1f559f4977e6f51082cb6e382b6f481ef54b65d4db9c8042422ad3b26479f67151bf4455d448a59bebeada2cb651a32e7eafe86165ee1bf SHA512 a07851b377da8d927f27dd624a071a17176e76667bc2a38ef54820b7515fb7b0dffdb11200b7e85e10008b7bb69adafa3f4cae7fa237a1cb4c97f2b9ea2a9247 +AUX eigen-3.4.0-ppc-no-vsx.patch 6739 BLAKE2B 9b61a58c671353de4a8675af62d4168c8ec90164c58d159342c81cbd9d5823b08da7235ae5cbd9d316dcf4f3e200e61c3f61cb747b33d53e78b2f595b51c154b SHA512 f1788bc2893b2bc6929d564f0e7fa420e5c8b2829092c247bf9f38289d8f745e6c1f6a7a43bcb2ca8a6a5a0a1067acd20751506fc09e5b996f9aca9b700b5ab3 AUX eigen-9999-please_protect_your_min_with_parentheses.patch 1979 BLAKE2B 50da0559d66338af6d27b8fd8ec5b1273e27bda992e40db62044c1d6a8cc4a066f0d9c9ca2061af4384decaaa7ebe4a4964c8c7dfb4e1b2abca10a1c9e9e2715 SHA512 a0ecb745768e2118af687c6b316520c782f23e43fc33f603b06c5bd9bea141161d9547eacdd16f0038ba49c0307670a7549d3ba570b54b8d44d3a96a94895ff0 DIST eigen-3.4.0.tar.bz2 2143091 BLAKE2B a32aac13cbab68cfaaa252d8a406e6a36ecfd1239361412b1f9baa08284a94467479c08ffae10cb847e9916472b46b1c1af4efbf81f957c8200a4379acd42c42 SHA512 cc488eb111e0e248744d2bc4475b345b5fb82361dff226a5b73a33bd0388de8c219cff8cffcf8f476b672fc0e223f339e8c6a1cfb6293840a4a6abf232438a89 DIST eigen-3.4.0.tar.gz 2705005 BLAKE2B ae5f774a6ed36f52cf9fc3206e50796abacbba69fd0f67cd5759b4e04d847aa656861d5e06e6cd0d798a17f2b06abdb70b16f795a626bdd29edcc872c33821f8 SHA512 ba75ecb760e32acf4ceaf27115468e65d4f77c44f8d519b5a13e7940af2c03a304ad433368cb6d55431f307c5c39e2666ab41d34442db3cf441638e51f5c3b6a DIST eigen-lapack_addons-3.4.1.tgz 6215074 BLAKE2B 564c3398de1f4ea249b58957a482cda0b5eb99e5021e1f18abf3b4d2893fed48912bfa8386681fcae03dd933eea91644f7429d47a53684d64462209a6ae76f30 SHA512 5a827d0befb521cb430f0d63f5000e7955359bc637cdb7292d942712e98c0702570a5b650a72fc609bf5b43633661c0e51de7761ae892df6ff0aab667f436edf EBUILD eigen-3.4.0-r1.ebuild 2588 BLAKE2B b24a464408f8f03282db44144e07080a0bac0b71a38d0847af12f8e506d218f437ebfba0b8ba5ccb654c4d317ecb8006ed02f0b63673038a5f91ed35968762ca SHA512 be51f2e62f6f954365dadefb1e33d7dd5bb094ff33d954b75ab1bbd2a1d0d8e54a673bb44040608668bbe5d936dd16e169cd5b16e9a3fdbe61fdc11a21ccc870 EBUILD eigen-3.4.0-r2.ebuild 12325 BLAKE2B d1ca7a402652d4e02573bed1e752b41308b8e96e86259cbf6238a514602d848bd50b1da806b3eca71d42cfecc153ebaf8dc498adb1c171e3a4dd64312350ca17 SHA512 30d8749e5ce808e8c70fdd6ce5d82a2c0d16eb1be303dbf4da0ed93743b7874549d1ec7700205d2b3c7712eb8d0cfa91d093155ac2f602400fd5202c0c552de8 +EBUILD eigen-3.4.0-r3.ebuild 12384 BLAKE2B 20fac08e54380979ab413ac4d9a6939298c38130a06131d0dddf9ae72bd7b63a47a9effb3296eaf047ad885874bb53ff9853af5720be12dc0a7efc9a5a8c14cd SHA512 a7891132bffb927458c0505d551437c6e6d5cd2b6866a2fbc0c7b190eb28ae5b33936088fdf119a613eb1d1e07d48ec5b97fcb312a0b6c3bf436855c47a63c30 EBUILD eigen-9999.ebuild 11683 BLAKE2B 405987f4e22b99670a07c7a593f1f33317e6b3d8e44f111757145f63ead1a36247e4c4feb6a4078590c277e0d46ce04a305771221ac64ac75e7daaa14c25f95d SHA512 60d8ead0d69e9cebb415e2682f89dda1be3bce484c18505ba7bec1ea38653663b58d3d729b3ac5e34d3d11d0c958a6050bc4d19faf51fbeab2e13b9914952532 MISC metadata.xml 2122 BLAKE2B ce2287db5f80ce761bc100cc0f6fe3dd549dda68853f0fc40d362e9dce72d5a5398b3d2b9562aa8feafc5b869adaab78a87b65499404df072c35d353ec2f5cd8 SHA512 446fe2316a72f8c058445f4c14bfe4683476f1a041d9af55ab3d1f76b4e2b6e83d0f7aad4a7febcd7c4c5bdfdf1efc30483aaa276ace6ac941488ee3d137c5c7 diff --git a/dev-cpp/eigen/eigen-3.4.0-r3.ebuild b/dev-cpp/eigen/eigen-3.4.0-r3.ebuild new file mode 100644 index 000000000000..91904f16f7ab --- /dev/null +++ b/dev-cpp/eigen/eigen-3.4.0-r3.ebuild @@ -0,0 +1,458 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +FORTRAN_NEEDED="test" +inherit cmake cuda fortran-2 llvm toolchain-funcs + +DESCRIPTION="C++ template library for linear algebra" +HOMEPAGE="https://eigen.tuxfamily.org/index.php?title=Main_Page" + +if [[ ${PV} = *9999* ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.com/lib${PN}/${PN}.git" + if [[ ${PV} = 3.4.9999* ]] ; then + EGIT_COMMIT="3.4" + fi +else + SRC_URI=" + https://gitlab.com/lib${PN}/${PN}/-/archive/${PV}/${P}.tar.bz2 + test? ( lapack? ( https://downloads.tuxfamily.org/${PN}/lapack_addons_3.4.1.tgz -> ${PN}-lapack_addons-3.4.1.tgz ) ) + " + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~x64-macos" +fi + +LICENSE="MPL-2.0" +SLOT="3" + +# The following lines are shamelessly stolen from ffmpeg-9999.ebuild with modifications +ARM_CPU_FEATURES=( + neon:NEON +) +PPC_CPU_FEATURES=( + altivec:ALTIVEC + vsx:VSX +) +X86_CPU_FEATURES=( + avx:AVX + avx2:AVX2 + avx512f:AVX512 + avx512dq:AVX512DQ + f16c:FP16C + fma3:FMA + popcnt:POPCNT + sse:SSE + sse2:SSE2 + sse3:SSE3 + ssse3:SSSE3 + sse4_1:SSE4_1 + sse4_2:SSE4_2 +) +# MIPS_CPU_FEATURES=( +# msa:MSA +# ) +# S390_CPU_FEATURES=( +# z13:Z13 +# z14:Z14 +# ) + +CPU_FEATURES_MAP=( + "${ARM_CPU_FEATURES[@]/#/cpu_flags_arm_}" + "${PPC_CPU_FEATURES[@]/#/cpu_flags_ppc_}" + "${X86_CPU_FEATURES[@]/#/cpu_flags_x86_}" + # "${MIPS_CPU_FEATURES[@]/#/cpu_flags_mips_}" + # "${S390_CPU_FEATURES[@]/#/cpu_flags_s390_}" +) + +IUSE_TEST_BACKENDS=( + "adolc" + "boost" + "cholmod" + "fftw" + "klu" + "opengl" + "openmp" + "pastix" + "sparsehash" + "spqr" + "superlu" + "umfpack" +) + +IUSE="${CPU_FEATURES_MAP[*]%:*} clang cuda hip debug doc lapack mathjax test ${IUSE_TEST_BACKENDS[*]}" #zvector + +# Tests failing again because of compiler issues +RESTRICT="!test? ( test )" + +BDEPEND=" + doc? ( + app-text/doxygen[dot] + dev-texlive/texlive-bibtexextra + dev-texlive/texlive-fontsextra + dev-texlive/texlive-fontutils + dev-texlive/texlive-latex + dev-texlive/texlive-latexextra + mathjax? ( dev-libs/mathjax ) + ) + test? ( virtual/pkgconfig ) +" + +# METIS +# MPREAL +# dev-libs/mpfr:0 +# dev-libs/gmp:0 + +TEST_BACKENDS=" + boost? ( dev-libs/boost ) + adolc? ( sci-libs/adolc[sparse] ) + cholmod? ( sci-libs/cholmod:= ) + fftw? ( sci-libs/fftw ) + spqr? ( sci-libs/spqr ) + klu? ( sci-libs/klu ) + opengl? ( + media-libs/freeglut + media-libs/glew + media-libs/libglvnd + ) + pastix? ( sci-libs/pastix[-mpi] ) + sparsehash? ( + amd64? ( dev-cpp/sparsehash ) + arm64? ( dev-cpp/sparsehash ) + ppc64? ( dev-cpp/sparsehash ) + x86? ( dev-cpp/sparsehash ) + ) + superlu? ( sci-libs/superlu ) + umfpack? ( sci-libs/umfpack ) +" +DEPEND=" + test? ( + cuda? ( + !clang? ( + dev-util/nvidia-cuda-toolkit + ) + clang? ( + sys-devel/clang[llvm_targets_NVPTX] + openmp? ( sys-libs/libomp[llvm_targets_NVPTX,offload] ) + ) + ) + hip? ( dev-util/hip ) + lapack? ( virtual/lapacke ) + ${TEST_BACKENDS} + ) +" + +REQUIRED_USE=" + test? ( !lapack ) + || ( ${IUSE_TEST_BACKENDS[*]} ) +" + +PATCHES=( + "${FILESDIR}/${PN}-3.3.9-max-macro.patch" + "${FILESDIR}/${PN}-3.4.0-doc-nocompress.patch" # bug 830064 + "${FILESDIR}/${PN}-3.4.0-buildstring.patch" + "${FILESDIR}/${PN}-3.4.0-noansi.patch" + "${FILESDIR}/${PN}-3.4.0-cxxstandard.patch" + "${FILESDIR}/${PN}-3.4.0-ppc-no-vsx.patch" # bug 936107 +) + +# TODO should be in cuda.eclass +cuda_set_CUDAHOSTCXX() { + local compiler + tc-is-gcc && compiler="gcc" + tc-is-clang && compiler="clang" + [[ -z "$compiler" ]] && die "no compiler specified" + + local package="sys-devel/${compiler}" + local version="${package}" + local CUDAHOSTCXX_test + while + CUDAHOSTCXX="${CUDAHOSTCXX_test}" + version=$(best_version "${version}") + if [[ -z "${version}" ]]; then + if [[ -z "${CUDAHOSTCXX}" ]]; then + die "could not find supported version of ${package}" + fi + break + fi + CUDAHOSTCXX_test="$( + dirname "$( + realpath "$( + which "${compiler}-$(echo "${version}" | grep -oP "(?<=${package}-)[0-9]*")" + )" + )" + )" + version="<${version}" + do ! echo "int main(){}" | nvcc "-ccbin ${CUDAHOSTCXX_test}" - -x cu &>/dev/null; done + + export CUDAHOSTCXX +} + +pkg_setup() { + use test && use cuda && use clang && llvm_pkg_setup +} + +src_unpack() { + if [[ ${PV} = *9999* ]] ; then + git-r3_src_unpack + else + unpack "${P}.tar.bz2" + + if use test && use lapack; then + cd "${S}/lapack" || die + unpack "${PN}-lapack_addons-3.4.1.tgz" + fi + fi +} + +src_prepare() { + cmake_src_prepare + + sed \ + -e "/add_subdirectory(bench\/spbench/s/^/#DONOTCOMPILE /g" \ + -e "/add_subdirectory(demos/s/^/#DONOTCOMPILE /g" \ + -i CMakeLists.txt || die + + if ! use test; then + sed \ + -e "/add_subdirectory(test/s/^/#DONOTCOMPILE /g" \ + -e "/add_subdirectory(scripts/s/^/#DONOTCOMPILE /g" \ + -e "/add_subdirectory(failtest/s/^/#DONOTCOMPILE /g" \ + -e "/add_subdirectory(blas/s/^/#DONOTCOMPILE /g" \ + -e "/add_subdirectory(lapack/s/^/#DONOTCOMPILE /g" \ + -i CMakeLists.txt || die + fi +} + +src_configure() { + local mycmakeargs=( + -DBUILD_SHARED_LIBS="yes" + -DBUILD_TESTING="$(usex test)" + + -DEIGEN_BUILD_DOC="$(usex doc)" # Enable creation of Eigen documentation + -DEIGEN_BUILD_PKGCONFIG="yes" # Build pkg-config .pc file for Eigen + ) + if use doc || use test; then + mycmakeargs+=( + # needs Qt4 + -DEIGEN_TEST_NOQT="yes" # Disable Qt support in unit tests + ) + fi + + if use doc; then + mycmakeargs+=( + -DEIGEN_DOC_USE_MATHJAX="$(usex mathjax)" # Use MathJax for rendering math in HTML docs + -DEIGEN_INTERNAL_DOCUMENTATION=no # Build internal documentation + ) + fi + + if use test; then + mycmakeargs+=( + # the OpenGL testsuite is extremely brittle, bug #712808 + -DOpenGL_GL_PREFERENCE="GLVND" + -DEIGEN_TEST_OPENGL="$(usex opengl)" # Enable OpenGL support in unit tests + -DEIGEN_TEST_OPENMP="$(usex openmp)" # Enable/Disable OpenMP in tests/examples + + -DCMAKE_DISABLE_FIND_PACKAGE_MPREAL=ON + + -DEIGEN_TEST_CXX11=yes + + # -DEIGEN_TEST_CUSTOM_CXX_FLAGS= # Additional compiler flags when compiling unit tests. + # -DEIGEN_TEST_CUSTOM_LINKER_FLAGS= # Additional linker flags when linking unit tests. + # -DEIGEN_TEST_BUILD_FLAGS= # Options passed to the build command of unit tests + + # -DEIGEN_BUILD_BTL=yes # Build benchmark suite + + -DEIGEN_TEST_BUILD_DOCUMENTATION="$(usex doc)" # Test building the doxygen documentation + + # -DEIGEN_COVERAGE_TESTING=no # Enable/disable gcov + # -DEIGEN_CTEST_ERROR_EXCEPTION= # Regular expression for build error messages to be filtered out + # -DEIGEN_DEBUG_ASSERTS=no # Enable advanced debugging of assertions + # -DEIGEN_NO_ASSERTION_CHECKING=no # Disable checking of assertions using exceptions + # -DEIGEN_TEST_NO_EXCEPTIONS=no # Disables C++ exceptions + # -DEIGEN_TEST_NO_EXPLICIT_ALIGNMENT=no # Disable explicit alignment (hence vectorization) in tests/examples + # -DEIGEN_TEST_NO_EXPLICIT_VECTORIZATION=no # Disable explicit vectorization in tests/examples + + # -DEIGEN_DASHBOARD_BUILD_TARGET=buildtests # Target to be built in dashboard mode, default is buildtests + + # -DEIGEN_DEFAULT_TO_ROW_MAJOR=no # Use row-major as default matrix storage order + + # -DEIGEN_TEST_MATRIX_DIR=yes # Enable testing of realword sparse matrices contained in the specified path + # -DEIGEN_TEST_MAX_SIZE=320 # Maximal matrix/vector size, default is 320 + # -DEIGEN_SPLIT_LARGE_TESTS=no # Split large tests into smaller executables + ) + + use !adolc && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Adolc="TRUE" ) + use !boost && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Boost="TRUE" ) + use !cholmod && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_CHOLMOD="TRUE" ) + use !fftw && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_FFTW="TRUE" ) + use !sparsehash && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_GoogleHash="TRUE" ) + use !klu && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_KLU="TRUE" ) + use !opengl && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_OpenGL="TRUE" ) + use !openmp && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_OpenMP="TRUE" ) + use !pastix && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_PASTIX="TRUE" ) + use !spqr && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_SPQR="TRUE" ) + use !superlu && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_SuperLU="TRUE" ) + use !umfpack && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_UMFPACK="TRUE" ) + + if use lapack; then + mycmakeargs+=( + -DEIGEN_ENABLE_LAPACK_TESTS=yes + -DEIGEN_TEST_EXTERNAL_BLAS=yes # Use external BLAS library for testsuite + -DCMAKE_DISABLE_FIND_PACKAGE_SuperLU=ON + ) + fi + + if use arm; then + mycmakeargs+=( + -DEIGEN_TEST_NEON="$(usex cpu_flags_arm_neon)" + ) + fi + + if use arm64; then + mycmakeargs+=( + -DEIGEN_TEST_NEON64="$(usex cpu_flags_arm_neon)" + ) + fi + + if use ppc || use ppc64; then + mycmakeargs+=( + -DEIGEN_TEST_ALTIVEC="$(usex cpu_flags_ppc_altivec)" + -DEIGEN_TEST_VSX="$(usex cpu_flags_ppc_vsx)" + ) + fi + + if use amd64 || use x86; then + mycmakeargs+=( + # -DEIGEN_TEST_32BIT=no # Force generating 32bit code. + # -DEIGEN_TEST_X87=no # Force using X87 instructions. Implies no vectorization. + -DEIGEN_TEST_SSE2="$(usex cpu_flags_x86_sse2)" + -DEIGEN_TEST_SSE3="$(usex cpu_flags_x86_sse3)" + -DEIGEN_TEST_SSSE3="$(usex cpu_flags_x86_ssse3)" + -DEIGEN_TEST_FMA="$(usex cpu_flags_x86_fma3)" + -DEIGEN_TEST_SSE4_1="$(usex cpu_flags_x86_sse4_1)" + -DEIGEN_TEST_SSE4_2="$(usex cpu_flags_x86_sse4_2)" + -DEIGEN_TEST_AVX="$(usex cpu_flags_x86_avx)" + -DEIGEN_TEST_F16C="$(usex cpu_flags_x86_f16c)" + -DEIGEN_TEST_AVX2="$(usex cpu_flags_x86_avx2)" + -DEIGEN_TEST_AVX512="$(usex cpu_flags_x86_avx512f)" + -DEIGEN_TEST_AVX512DQ="$(usex cpu_flags_x86_avx512dq)" + ) + fi + + if use mips; then + mycmakeargs+=( + # -DEIGEN_TEST_MSA=no # Enable/Disable MSA in tests/examples + ) + fi + + if use s390; then + mycmakeargs+=( + # -DEIGEN_TEST_Z13=no # Enable/Disable S390X(zEC13) ZVECTOR in tests/examples + # -DEIGEN_TEST_Z14=no # Enable/Disable S390X(zEC14) ZVECTOR in tests/examples + ) + fi + + mycmakeargs+=( + -DEIGEN_TEST_CUDA="$(usex cuda)" # Enable CUDA support in unit tests + -DEIGEN_TEST_CUDA_CLANG="$(usex cuda "$(usex clang)")" # Use clang instead of nvcc to compile the CUDA tests + + -DEIGEN_TEST_HIP="$(usex hip)" # Add HIP support. + + # -DEIGEN_TEST_SYCL=no # Add Sycl support. + # -DEIGEN_SYCL_TRISYCL=no # Use the triSYCL Sycl implementation (ComputeCPP by default). + ) + + if use cuda; then + cuda_add_sandbox -w + if use clang; then + local llvm_prefix + llvm_prefix="$(get_llvm_prefix -b)" + export CC="${llvm_prefix}/bin/clang" + export CXX="${llvm_prefix}/bin/clang++" + export LIBRARY_PATH="${ESYSROOT}/usr/$(get_libdir)" + else + cuda_set_CUDAHOSTCXX + mycmakeargs+=( + -DCUDA_HOST_COMPILER="${CUDAHOSTCXX}" + ) + fi + if [[ "${CUDA_VERBOSE}" == true ]]; then + mycmakeargs+=( + -DCUDA_VERBOSE_BUILD=yes + ) + NVCCFLAGS+=" -v" + fi + + export CUDAFLAGS="${NVCCFLAGS}" + + [[ -z "${CUDAARCHS}" ]] && einfo "trying to determine host CUDAARCHS" + : "${CUDAARCHS:=$(__nvcc_device_query)}" + export CUDAARCHS + + mycmakeargs+=( + -DEIGEN_CUDA_COMPUTE_ARCH="${CUDAARCHS}" + ) + fi + fi + + cmake_src_configure +} + +src_compile() { + local targets=() + if use doc; then + targets+=( doc ) + HTML_DOCS=( "${BUILD_DIR}"/doc/html/. ) + fi + if use test; then + targets+=( buildtests ) + if ! use lapack; then + targets+=( blas ) + fi + # tests generate random data, which + # obviously fails for some seeds + export EIGEN_SEED=712808 + fi + + if use doc || use test; then + cmake_src_compile "${targets[@]}" + fi +} + +src_test() { + CMAKE_SKIP_TESTS=( + product_small_32 # 143 (Subprocess aborted) + product_small_33 # 144 (Subprocess aborted) + + eigensolver_selfadjoint_13 # 452 (Subprocess aborted) + + cholmod_support_21 # 726 (Subprocess aborted) + cholmod_support_22 # 727 (Subprocess aborted) + + NonLinearOptimization # 930 (Subprocess aborted) + openglsupport # 990 (Failed) + levenberg_marquardt # 1020 (Subprocess aborted) + ) + + if use cuda ; then + cuda_add_sandbox -w + + CMAKE_SKIP_TESTS+=( + cxx11_tensor_cast_float16_gpu + cxx11_tensor_gpu_5 + ) + fi + + if use lapack ; then + CMAKE_SKIP_TESTS+=( + "^LAPACK-.*$" + ) + fi + + local myctestargs=( + -j1 # otherwise breaks due to cmake reruns + ) + + cmake_src_test +} diff --git a/dev-cpp/eigen/files/eigen-3.4.0-ppc-no-vsx.patch b/dev-cpp/eigen/files/eigen-3.4.0-ppc-no-vsx.patch new file mode 100644 index 000000000000..7cfeaaf129ff --- /dev/null +++ b/dev-cpp/eigen/files/eigen-3.4.0-ppc-no-vsx.patch @@ -0,0 +1,195 @@ +https://gitlab.com/libeigen/eigen/-/merge_requests/1028 +https://bugs.gentoo.org/936107 +--- a/Eigen/Core ++++ b/Eigen/Core +@@ -346,7 +346,7 @@ + #include "src/Core/CoreIterators.h" + #include "src/Core/ConditionEstimator.h" + +-#if defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX) ++#if defined(EIGEN_VECTORIZE_VSX) + #include "src/Core/arch/AltiVec/MatrixProduct.h" + #elif defined EIGEN_VECTORIZE_NEON + #include "src/Core/arch/NEON/GeneralBlockPanelKernel.h" +--- a/Eigen/src/Core/arch/AltiVec/Complex.h ++++ b/Eigen/src/Core/arch/AltiVec/Complex.h +@@ -100,6 +100,7 @@ + HasAbs2 = 0, + HasMin = 0, + HasMax = 0, ++ HasSqrt = 1, + #ifdef __VSX__ + HasBlend = 1, + #endif +@@ -320,6 +321,7 @@ + HasAbs2 = 0, + HasMin = 0, + HasMax = 0, ++ HasSqrt = 1, + HasSetLinear = 0 + }; + }; +--- a/Eigen/src/Core/arch/AltiVec/MathFunctions.h ++++ b/Eigen/src/Core/arch/AltiVec/MathFunctions.h +@@ -40,16 +40,14 @@ + return pcos_float(_x); + } + ++#ifdef __VSX__ + #ifndef EIGEN_COMP_CLANG + template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED + Packet4f prsqrt<Packet4f>(const Packet4f& x) + { + return vec_rsqrt(x); + } +-#endif + +-#ifdef __VSX__ +-#ifndef EIGEN_COMP_CLANG + template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED + Packet2d prsqrt<Packet2d>(const Packet2d& x) + { +@@ -74,6 +72,26 @@ + { + return pexp_double(_x); + } ++ ++template<> EIGEN_STRONG_INLINE Packet8bf psqrt<Packet8bf> (const Packet8bf& a){ ++ BF16_TO_F32_UNARY_OP_WRAPPER(psqrt<Packet4f>, a); ++} ++ ++#ifndef EIGEN_COMP_CLANG ++template<> EIGEN_STRONG_INLINE Packet8bf prsqrt<Packet8bf> (const Packet8bf& a){ ++ BF16_TO_F32_UNARY_OP_WRAPPER(prsqrt<Packet4f>, a); ++} ++#endif ++#else ++template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS ++Packet4f psqrt<Packet4f>(const Packet4f& x) ++{ ++ Packet4f a; ++ for (Index i = 0; i < packet_traits<float>::size; i++) { ++ a[i] = numext::sqrt(x[i]); ++ } ++ return a; ++} + #endif + + // Hyperbolic Tangent function. +--- a/Eigen/src/Core/arch/AltiVec/PacketMath.h ++++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h +@@ -175,16 +175,19 @@ + #else + HasRsqrt = 0, + #endif ++ HasTanh = EIGEN_FAST_MATH, ++ HasErf = EIGEN_FAST_MATH, ++ HasRint = 1, + #else + HasSqrt = 0, + HasRsqrt = 0, +- HasTanh = EIGEN_FAST_MATH, +- HasErf = EIGEN_FAST_MATH, ++ HasTanh = 0, ++ HasErf = 0, ++ HasRint = 0, + #endif + HasRound = 1, + HasFloor = 1, + HasCeil = 1, +- HasRint = 1, + HasNegate = 1, + HasBlend = 1 + }; +@@ -217,16 +220,17 @@ + #else + HasRsqrt = 0, + #endif ++ HasRint = 1, + #else + HasSqrt = 0, + HasRsqrt = 0, +- HasTanh = EIGEN_FAST_MATH, +- HasErf = EIGEN_FAST_MATH, ++ HasRint = 0, + #endif ++ HasTanh = 0, ++ HasErf = 0, + HasRound = 1, + HasFloor = 1, + HasCeil = 1, +- HasRint = 1, + HasNegate = 1, + HasBlend = 1 + }; +@@ -872,19 +876,29 @@ + return vec_nor(c,c); + } + ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet4i pcmp_le(const Packet4i& a, const Packet4i& b) { return reinterpret_cast<Packet4i>(vec_cmple(a,b)); } ++#endif + template<> EIGEN_STRONG_INLINE Packet4i pcmp_lt(const Packet4i& a, const Packet4i& b) { return reinterpret_cast<Packet4i>(vec_cmplt(a,b)); } + template<> EIGEN_STRONG_INLINE Packet4i pcmp_eq(const Packet4i& a, const Packet4i& b) { return reinterpret_cast<Packet4i>(vec_cmpeq(a,b)); } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet8s pcmp_le(const Packet8s& a, const Packet8s& b) { return reinterpret_cast<Packet8s>(vec_cmple(a,b)); } ++#endif + template<> EIGEN_STRONG_INLINE Packet8s pcmp_lt(const Packet8s& a, const Packet8s& b) { return reinterpret_cast<Packet8s>(vec_cmplt(a,b)); } + template<> EIGEN_STRONG_INLINE Packet8s pcmp_eq(const Packet8s& a, const Packet8s& b) { return reinterpret_cast<Packet8s>(vec_cmpeq(a,b)); } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet8us pcmp_le(const Packet8us& a, const Packet8us& b) { return reinterpret_cast<Packet8us>(vec_cmple(a,b)); } ++#endif + template<> EIGEN_STRONG_INLINE Packet8us pcmp_lt(const Packet8us& a, const Packet8us& b) { return reinterpret_cast<Packet8us>(vec_cmplt(a,b)); } + template<> EIGEN_STRONG_INLINE Packet8us pcmp_eq(const Packet8us& a, const Packet8us& b) { return reinterpret_cast<Packet8us>(vec_cmpeq(a,b)); } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet16c pcmp_le(const Packet16c& a, const Packet16c& b) { return reinterpret_cast<Packet16c>(vec_cmple(a,b)); } ++#endif + template<> EIGEN_STRONG_INLINE Packet16c pcmp_lt(const Packet16c& a, const Packet16c& b) { return reinterpret_cast<Packet16c>(vec_cmplt(a,b)); } + template<> EIGEN_STRONG_INLINE Packet16c pcmp_eq(const Packet16c& a, const Packet16c& b) { return reinterpret_cast<Packet16c>(vec_cmpeq(a,b)); } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet16uc pcmp_le(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast<Packet16uc>(vec_cmple(a,b)); } ++#endif + template<> EIGEN_STRONG_INLINE Packet16uc pcmp_lt(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast<Packet16uc>(vec_cmplt(a,b)); } + template<> EIGEN_STRONG_INLINE Packet16uc pcmp_eq(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast<Packet16uc>(vec_cmpeq(a,b)); } + +@@ -937,6 +951,7 @@ + } + template<> EIGEN_STRONG_INLINE Packet4f pceil<Packet4f>(const Packet4f& a) { return vec_ceil(a); } + template<> EIGEN_STRONG_INLINE Packet4f pfloor<Packet4f>(const Packet4f& a) { return vec_floor(a); } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet4f print<Packet4f>(const Packet4f& a) + { + Packet4f res; +@@ -947,6 +962,7 @@ + + return res; + } ++#endif + + template<typename Packet> EIGEN_STRONG_INLINE Packet ploadu_common(const __UNPACK_TYPE__(Packet)* from) + { +@@ -1341,12 +1357,6 @@ + BF16_TO_F32_BINARY_OP_WRAPPER(psub<Packet4f>, a, b); + } + +-template<> EIGEN_STRONG_INLINE Packet8bf psqrt<Packet8bf> (const Packet8bf& a){ +- BF16_TO_F32_UNARY_OP_WRAPPER(vec_sqrt, a); +-} +-template<> EIGEN_STRONG_INLINE Packet8bf prsqrt<Packet8bf> (const Packet8bf& a){ +- BF16_TO_F32_UNARY_OP_WRAPPER(prsqrt<Packet4f>, a); +-} + template<> EIGEN_STRONG_INLINE Packet8bf pexp<Packet8bf> (const Packet8bf& a){ + BF16_TO_F32_UNARY_OP_WRAPPER(pexp_float, a); + } +@@ -1390,9 +1400,11 @@ + template<> EIGEN_STRONG_INLINE Packet8bf pround<Packet8bf> (const Packet8bf& a){ + BF16_TO_F32_UNARY_OP_WRAPPER(pround<Packet4f>, a); + } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet8bf print<Packet8bf> (const Packet8bf& a){ + BF16_TO_F32_UNARY_OP_WRAPPER(print<Packet4f>, a); + } ++#endif + template<> EIGEN_STRONG_INLINE Packet8bf pmadd(const Packet8bf& a, const Packet8bf& b, const Packet8bf& c) { + Packet4f a_even = Bf16ToF32Even(a); + Packet4f a_odd = Bf16ToF32Odd(a); |