mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-23 16:49:10 -07:00
dev-cpp/eigen: add 5.0.1 5.0.9999 3.4.1
Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/44994 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -1,2 +1,4 @@
|
||||
DIST eigen-3.4.0.tar.bz2 2143091 BLAKE2B a32aac13cbab68cfaaa252d8a406e6a36ecfd1239361412b1f9baa08284a94467479c08ffae10cb847e9916472b46b1c1af4efbf81f957c8200a4379acd42c42 SHA512 cc488eb111e0e248744d2bc4475b345b5fb82361dff226a5b73a33bd0388de8c219cff8cffcf8f476b672fc0e223f339e8c6a1cfb6293840a4a6abf232438a89
|
||||
DIST eigen-3.4.1.tar.bz2 2157363 BLAKE2B 382fcebd716d81019c4606974f8db22234ff34c415d465eb5cf9dbab34d4fa9bca7a3ae6ef64a7eca627cdbacb35fdac862005b0a14ec2d851831246f879f374 SHA512 806be7536f811eb77898a9431eac4fe446fbdd41c2a33ebe30e56750920c105e24bc41d8cbb4a5c01ee770ded9c58f06ff37058d17c6e2301bc9021a864bb549
|
||||
DIST eigen-5.0.1.tar.bz2 2335713 BLAKE2B a7ccf9fc63b25b0e5ad8940ccf541cf4977a80ded671757ae1965cd0ca480fd11361de8eaf18cae94a74cde68979a76f5a18b47b696cdd6939b6cf30922e5fd4 SHA512 5cb11c7f1945ae7f36c5deb067b8d5a962d2d3cff7d4dbec8a4ee255ee6aae1b7dbe6d5a6dcc6fe77554ef191e4101366bf79cfb34f5cf06a0e4de311afbeaf6
|
||||
DIST eigen-lapack_addons-3.4.1.tgz 6215074 BLAKE2B 564c3398de1f4ea249b58957a482cda0b5eb99e5021e1f18abf3b4d2893fed48912bfa8386681fcae03dd933eea91644f7429d47a53684d64462209a6ae76f30 SHA512 5a827d0befb521cb430f0d63f5000e7955359bc637cdb7292d942712e98c0702570a5b650a72fc609bf5b43633661c0e51de7761ae892df6ff0aab667f436edf
|
||||
|
||||
613
dev-cpp/eigen/eigen-3.4.1.ebuild
Normal file
613
dev-cpp/eigen/eigen-3.4.1.ebuild
Normal file
@@ -0,0 +1,613 @@
|
||||
# Copyright 1999-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
LLVM_COMPAT=( {21..23} )
|
||||
LLVM_OPTIONAL="cuda-clang"
|
||||
|
||||
PYTHON_COMPAT=( python3_{12..13} )
|
||||
|
||||
FORTRAN_NEEDED="no"
|
||||
|
||||
LAPACK_ADDONS_PV="3.4.1"
|
||||
|
||||
inherit cmake cuda flag-o-matic fortran-2 llvm-r2 python-any-r1 toolchain-funcs virtualx
|
||||
|
||||
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} = *.9999* ]] ; then
|
||||
EGIT_BRANCH="$(ver_cut 1-2)"
|
||||
fi
|
||||
else
|
||||
SRC_URI="
|
||||
https://gitlab.com/lib${PN}/${PN}/-/archive/${PV}/${P}.tar.bz2
|
||||
"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos"
|
||||
fi
|
||||
|
||||
SRC_URI+="
|
||||
test? (
|
||||
lapack? (
|
||||
https://downloads.tuxfamily.org/${PN}/lapack_addons_${LAPACK_ADDONS_PV}.tgz
|
||||
-> ${PN}-lapack_addons-${LAPACK_ADDONS_PV}.tgz
|
||||
)
|
||||
)
|
||||
"
|
||||
|
||||
LICENSE="MPL-2.0"
|
||||
SLOT="3/$(ver_cut 1-2)"
|
||||
|
||||
# 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"
|
||||
"metis"
|
||||
"opengl"
|
||||
"pastix"
|
||||
"pocketfft"
|
||||
"sparsehash"
|
||||
"spqr"
|
||||
"superlu"
|
||||
"umfpack"
|
||||
)
|
||||
|
||||
IUSE="
|
||||
debug
|
||||
blas lapack
|
||||
${CPU_FEATURES_MAP[*]%:*}
|
||||
cuda cuda-clang hip
|
||||
doc mathjax
|
||||
openmp
|
||||
test ${IUSE_TEST_BACKENDS[*]}
|
||||
"
|
||||
# zvector
|
||||
|
||||
REQUIRED_USE="
|
||||
lapack? (
|
||||
blas
|
||||
)
|
||||
test? (
|
||||
|| ( ${IUSE_TEST_BACKENDS[*]} )
|
||||
cuda-clang? (
|
||||
!openmp
|
||||
${LLVM_REQUIRED_USE}
|
||||
)
|
||||
)
|
||||
"
|
||||
|
||||
# Tests failing again because of compiler issues; bugs #932646, #943401
|
||||
RESTRICT="!test? ( test )"
|
||||
FORTRAN_DEPEND="virtual/fortran"
|
||||
|
||||
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
|
||||
lapack? (
|
||||
${PYTHON_DEPS}
|
||||
)
|
||||
spqr? (
|
||||
cholmod? (
|
||||
blas? (
|
||||
lapack? (
|
||||
${FORTRAN_DEPEND}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
pastix? ( ${FORTRAN_DEPEND} )
|
||||
)
|
||||
blas? ( ${FORTRAN_DEPEND} )
|
||||
lapack? ( ${FORTRAN_DEPEND} )
|
||||
"
|
||||
|
||||
TEST_BACKENDS="
|
||||
adolc? ( sci-libs/adolc[sparse] )
|
||||
boost? ( dev-libs/boost )
|
||||
cholmod? ( sci-libs/cholmod:=[cuda?] )
|
||||
fftw? ( sci-libs/fftw[openmp?] )
|
||||
klu? ( sci-libs/klu )
|
||||
metis? (
|
||||
sci-libs/metis[openmp?]
|
||||
sci-libs/pastix[metis]
|
||||
)
|
||||
opengl? (
|
||||
media-libs/freeglut
|
||||
media-libs/glew
|
||||
media-libs/libglvnd
|
||||
)
|
||||
pastix? (
|
||||
sci-libs/pastix[-mpi]
|
||||
|| (
|
||||
sci-libs/pastix[scotch]
|
||||
sci-libs/pastix[metis]
|
||||
)
|
||||
)
|
||||
pocketfft? ( dev-libs/pocketfft )
|
||||
sparsehash? (
|
||||
amd64? ( dev-cpp/sparsehash )
|
||||
arm64? ( dev-cpp/sparsehash )
|
||||
ppc64? ( dev-cpp/sparsehash )
|
||||
x86? ( dev-cpp/sparsehash )
|
||||
)
|
||||
spqr? ( sci-libs/spqr )
|
||||
superlu? ( sci-libs/superlu )
|
||||
umfpack? ( sci-libs/umfpack:= )
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
test? (
|
||||
cuda? (
|
||||
!cuda-clang? (
|
||||
dev-util/nvidia-cuda-toolkit
|
||||
)
|
||||
cuda-clang? (
|
||||
$(llvm_gen_dep '
|
||||
llvm-core/clang:${LLVM_SLOT}
|
||||
llvm-runtimes/clang-runtime:${LLVM_SLOT}[llvm_targets_NVPTX,offload,openmp]
|
||||
')
|
||||
)
|
||||
)
|
||||
hip? ( dev-util/hip )
|
||||
!blas? (
|
||||
virtual/blas
|
||||
!lapack? (
|
||||
virtual/lapacke
|
||||
)
|
||||
)
|
||||
${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.1-cxxstandard-17.patch"
|
||||
|
||||
"${FILESDIR}/${PN}-3.4.1-bug1213-link-with-Eigen3-Eigen.patch"
|
||||
|
||||
"${FILESDIR}/${PN}-5.0.1-cmake-GNUInstallDirs.patch"
|
||||
"${FILESDIR}/${PN}-5.0.1-Do-not-show-deprecated-CUDA-device-properties-for-CU.patch"
|
||||
)
|
||||
|
||||
# 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="$(
|
||||
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
|
||||
echo "${CUDAHOSTCXX}"
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
|
||||
tc-check-openmp
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
|
||||
tc-check-openmp
|
||||
fi
|
||||
|
||||
if use lapack; then
|
||||
python-any-r1_pkg_setup
|
||||
fi
|
||||
|
||||
if { use test && { use spqr && use cholmod && use blas && use lapack; } || use pastix; } \
|
||||
|| use blas \
|
||||
|| use lapack \
|
||||
; then
|
||||
fortran-2_pkg_setup
|
||||
fi
|
||||
|
||||
if use test && use cuda && use cuda-clang; then
|
||||
llvm-r2_pkg_setup
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} = *9999* ]] ; then
|
||||
git-r3_src_unpack
|
||||
else
|
||||
unpack "${P}.tar.bz2"
|
||||
fi
|
||||
|
||||
if use test && use lapack; then
|
||||
pushd "${S}/lapack" > /dev/null || die
|
||||
unpack "${PN}-lapack_addons-${LAPACK_ADDONS_PV}.tgz"
|
||||
popd > /dev/null || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
# run patches here as we patch in test/
|
||||
cmake_src_prepare
|
||||
|
||||
if use test && use lapack; then
|
||||
pushd "${S}" > /dev/null || die
|
||||
eapply "${FILESDIR}/${PN}-5.0.1-fix-lapack_testing.py.patch"
|
||||
popd > /dev/null || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
if use lapack; then
|
||||
# bug 878987
|
||||
# multiple definition of `cgesdd_'
|
||||
filter-lto
|
||||
fi
|
||||
|
||||
local mycmakeargs=(
|
||||
-DCMAKE_CXX_STANDARD="20"
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE="yes"
|
||||
|
||||
-DEIGEN_BUILD_TESTING="$(usex test)" # Enable creation of Eigen tests.
|
||||
|
||||
-DEIGEN_BUILD_BLAS="$(usex blas)" # Toggles the building of the Eigen Blas library
|
||||
-DEIGEN_BUILD_LAPACK="$(usex blas "$(usex lapack)")" # Toggles the building of the included Eigen LAPACK library
|
||||
|
||||
-DEIGEN_BUILD_DOC="$(usex doc)" # Enable creation of Eigen documentation
|
||||
-DEIGEN_BUILD_PKGCONFIG="yes" # Build pkg-config .pc file for Eigen
|
||||
)
|
||||
|
||||
append-cxxflags "-DEIGEN_USE_OPENBLAS_BFLOAT16=0"
|
||||
|
||||
if use blas; then
|
||||
mycmakeargs+=(
|
||||
-DBUILD_SHARED_LIBS="yes"
|
||||
-DEIGEN_BUILD_SHARED_LIBS="yes"
|
||||
)
|
||||
|
||||
if use lapack; then
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0148="OLD" # FindPythonInterp
|
||||
-DEIGEN_ENABLE_LAPACK_TESTS="$(usex test)"
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
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+=(
|
||||
-DEIGEN_LEAVE_TEST_IN_ALL_TARGET=yes # Leaves tests in the all target, needed by ctest for automatic building
|
||||
|
||||
# the OpenGL testsuite is extremely brittle, bug #712808
|
||||
-DEIGEN_TEST_OPENGL="$(usex opengl)" # Enable OpenGL support in unit tests
|
||||
-DEIGEN_TEST_OPENMP="$(usex openmp)" # Enable/Disable OpenMP in tests/examples
|
||||
|
||||
-DEIGEN_TEST_EXTERNAL_BLAS="$(usex !blas)" # Use external BLAS library for testsuite
|
||||
|
||||
-DEIGEN_TEST_BUILD_DOCUMENTATION="no" # $(usex doc)" # Test building the doxygen documentation
|
||||
|
||||
-DEIGEN_DEBUG_ASSERTS="$(usex debug)" # Enable advanced debugging of assertions
|
||||
-DEIGEN_SPLIT_LARGE_TESTS="yes" # Split large tests into smaller executables
|
||||
|
||||
-DEIGEN_TEST_CUDA="$(usex cuda)" # Enable CUDA support in unit tests
|
||||
-DEIGEN_TEST_CUDA_CLANG="$(usex cuda "$(usex cuda-clang)")" # Use clang instead of nvcc to compile the CUDA tests
|
||||
|
||||
-DEIGEN_TEST_HIP="$(usex hip)" # Add HIP support.
|
||||
|
||||
# -DEIGEN_TEST_SYCL="$(usex sycl)" # Add Sycl support.
|
||||
# -DEIGEN_SYCL_TRISYCL="no" # Use the triSYCL Sycl implementation (ComputeCPP by default).
|
||||
|
||||
$(cmake_use_find_package adolc Adolc)
|
||||
$(cmake_use_find_package boost Boost)
|
||||
$(cmake_use_find_package cholmod CHOLMOD)
|
||||
$(cmake_use_find_package fftw FFTW )
|
||||
$(cmake_use_find_package klu KLU)
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_MPREAL=yes
|
||||
# $(cmake_use_find_package opengl OpenGL) # EIGEN_TEST_OPENGL
|
||||
# $(cmake_use_find_package openmp OpenMP) # EIGEN_TEST_OPENMP
|
||||
$(cmake_use_find_package pastix PASTIX)
|
||||
# prevent pastix_nompi.h lookup it no longer exists, we enforce this via deps
|
||||
-DPASTIX_pastix_nompi.h_INCLUDE_DIRS="FOUND"
|
||||
|
||||
-DPOCKETFFT="$(usex pocketfft)"
|
||||
$(cmake_use_find_package sparsehash GoogleHash)
|
||||
$(cmake_use_find_package spqr SPQR)
|
||||
$(cmake_use_find_package superlu SuperLU)
|
||||
$(cmake_use_find_package umfpack UMFPACK)
|
||||
)
|
||||
|
||||
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 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 ppc || use ppc64; then
|
||||
mycmakeargs+=(
|
||||
-DEIGEN_TEST_ALTIVEC="$(usex cpu_flags_ppc_altivec)"
|
||||
-DEIGEN_TEST_VSX="$(usex cpu_flags_ppc_vsx)"
|
||||
)
|
||||
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
|
||||
|
||||
if use cuda; then
|
||||
cuda_add_sandbox -w
|
||||
|
||||
if use cuda-clang; then
|
||||
local llvm_prefix
|
||||
llvm_prefix="$(get_llvm_prefix -b)"
|
||||
|
||||
# NVCCFLAGS gets injected into CMAKE_CXX_FLAGS, which means we need to use clang as gcc will fail with
|
||||
# error: unrecognized command-line option
|
||||
if ! tc-is-clang; then
|
||||
export CC="${CHOST}-clang-${LLVM_SLOT}"
|
||||
export CXX="${CHOST}-clang++-${LLVM_SLOT}"
|
||||
fi
|
||||
|
||||
NVCCFLAGS="${NVCCFLAGS:+${NVCCFLAGS} }--libomptarget-nvptx-bc-path=${llvm_prefix}/$(get_libdir)/nvptx64-nvidia-cuda/libomptarget-nvptx.bc"
|
||||
|
||||
mycmakeargs+=(
|
||||
-DCUDA_HOST_COMPILER="${CHOST}-clang++-${LLVM_SLOT}"
|
||||
)
|
||||
else
|
||||
cuda_set_CUDAHOSTCXX
|
||||
|
||||
mycmakeargs+=(
|
||||
-DCUDA_HOST_COMPILER="${CUDAHOSTCXX}"
|
||||
)
|
||||
if [[ -v CUDACXX ]]; then
|
||||
mycmakeargs+=(
|
||||
-DCUDA_NVCC_EXECUTABLE="${CUDACXX}"
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0146="OLD" # FindCUDA
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${CUDA_VERBOSE}" == true ]]; then
|
||||
mycmakeargs+=(
|
||||
-DCUDA_VERBOSE_BUILD="yes"
|
||||
)
|
||||
NVCCFLAGS+=" -v"
|
||||
fi
|
||||
|
||||
if [[ -v CUDAARCHS ]]; then
|
||||
mycmakeargs+=(
|
||||
# TODO this needs to be lowest first for eigen
|
||||
-DEIGEN_CUDA_COMPUTE_ARCH="${CUDAARCHS}"
|
||||
)
|
||||
fi
|
||||
|
||||
# CUDAFLAGS is used by cmake
|
||||
# NVCCFLAGS is used by cuda.eclass
|
||||
mycmakeargs+=(
|
||||
-DEIGEN_CUDA_CXX_FLAGS="${NVCCFLAGS}"
|
||||
|
||||
-DCUDA_USE_STATIC_CUDA_RUNTIME="no"
|
||||
)
|
||||
fi
|
||||
|
||||
if use opengl; then
|
||||
mycmakeargs+=(
|
||||
-DOpenGL_GL_PREFERENCE="GLVND"
|
||||
)
|
||||
fi
|
||||
|
||||
if use pocketfft; then
|
||||
mycmakeargs+=(
|
||||
-DEIGEN_TEST_CXX11=yes
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
local targets=()
|
||||
|
||||
if use blas; then
|
||||
targets+=( blas )
|
||||
if use lapack; then
|
||||
targets+=( lapack )
|
||||
fi
|
||||
fi
|
||||
|
||||
if use test; then
|
||||
targets+=( buildtests )
|
||||
|
||||
if use cuda || use hip; then
|
||||
targets+=( buildtests_gpu )
|
||||
fi
|
||||
|
||||
# tests generate random data, which fails for some seeds
|
||||
# we solve this via test reruns now
|
||||
# export EIGEN_SEED=712808
|
||||
fi
|
||||
|
||||
# we add doc last to capture results for buildtests
|
||||
if use doc; then
|
||||
targets+=( doc )
|
||||
fi
|
||||
|
||||
if [[ -n "${targets[*]}" ]]; then
|
||||
cmake_src_compile "${targets[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
src_test() {
|
||||
local CMAKE_SKIP_TESTS=(
|
||||
"^ref_8$"
|
||||
)
|
||||
|
||||
if use cholmod && use blas && use lapack; then
|
||||
CMAKE_SKIP_TESTS+=(
|
||||
"^cholmod_support_21$"
|
||||
"^cholmod_support_22$"
|
||||
)
|
||||
fi
|
||||
|
||||
if use cuda; then
|
||||
cuda_add_sandbox -w
|
||||
fi
|
||||
|
||||
if use klu && use blas; then
|
||||
CMAKE_SKIP_TESTS+=(
|
||||
"^klu_support_1$"
|
||||
"^klu_support_2$"
|
||||
)
|
||||
fi
|
||||
|
||||
if use lapack; then
|
||||
CMAKE_SKIP_TESTS+=(
|
||||
"^LAPACK-xlintsts_stest_in$"
|
||||
"^LAPACK-xeigtsts_sep_in$"
|
||||
"^LAPACK-xeigtsts_svd_in$"
|
||||
"^LAPACK-xlintstd_dtest_in$"
|
||||
"^LAPACK-xeigtstd_sep_in$"
|
||||
"^LAPACK-xeigtstd_svd_in$"
|
||||
"^LAPACK-xlintstc_ctest_in$"
|
||||
"^LAPACK-xeigtstc_svd_in$"
|
||||
)
|
||||
fi
|
||||
|
||||
local myctestargs=(
|
||||
-j1 # otherwise breaks due to cmake reruns
|
||||
--repeat until-pass:50
|
||||
)
|
||||
|
||||
if use opengl; then
|
||||
virtx \
|
||||
cmake_src_test
|
||||
else
|
||||
cmake_src_test
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local DOCS=()
|
||||
cmake_src_install
|
||||
|
||||
if use doc; then
|
||||
pushd "${BUILD_DIR}/doc" > /dev/null || die
|
||||
dodoc -r html
|
||||
popd > /dev/null || die
|
||||
fi
|
||||
}
|
||||
634
dev-cpp/eigen/eigen-5.0.1.ebuild
Normal file
634
dev-cpp/eigen/eigen-5.0.1.ebuild
Normal file
@@ -0,0 +1,634 @@
|
||||
# Copyright 1999-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
LLVM_COMPAT=( {21..23} )
|
||||
LLVM_OPTIONAL="cuda-clang"
|
||||
|
||||
PYTHON_COMPAT=( python3_{12..13} )
|
||||
|
||||
FORTRAN_NEEDED="no"
|
||||
|
||||
LAPACK_ADDONS_PV="3.4.1"
|
||||
|
||||
inherit cmake cuda flag-o-matic fortran-2 llvm-r2 python-any-r1 toolchain-funcs virtualx
|
||||
|
||||
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} = *.9999* ]] ; then
|
||||
EGIT_BRANCH="$(ver_cut 1-2)"
|
||||
fi
|
||||
else
|
||||
SRC_URI="
|
||||
https://gitlab.com/lib${PN}/${PN}/-/archive/${PV}/${P}.tar.bz2
|
||||
"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos"
|
||||
fi
|
||||
|
||||
SRC_URI+="
|
||||
test? (
|
||||
lapack? (
|
||||
https://downloads.tuxfamily.org/${PN}/lapack_addons_${LAPACK_ADDONS_PV}.tgz
|
||||
-> ${PN}-lapack_addons-${LAPACK_ADDONS_PV}.tgz
|
||||
)
|
||||
)
|
||||
"
|
||||
|
||||
LICENSE="MPL-2.0"
|
||||
SLOT="3/$(ver_cut 1-2)"
|
||||
|
||||
# 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"
|
||||
"metis"
|
||||
"opengl"
|
||||
"pastix"
|
||||
"pocketfft"
|
||||
"sparsehash"
|
||||
"spqr"
|
||||
"superlu"
|
||||
"umfpack"
|
||||
)
|
||||
|
||||
IUSE="
|
||||
debug
|
||||
blas lapack
|
||||
${CPU_FEATURES_MAP[*]%:*}
|
||||
cuda cuda-clang hip
|
||||
doc mathjax
|
||||
openmp
|
||||
test ${IUSE_TEST_BACKENDS[*]}
|
||||
"
|
||||
# zvector
|
||||
|
||||
REQUIRED_USE="
|
||||
lapack? (
|
||||
blas
|
||||
)
|
||||
test? (
|
||||
|| ( ${IUSE_TEST_BACKENDS[*]} )
|
||||
cuda-clang? (
|
||||
!openmp
|
||||
${LLVM_REQUIRED_USE}
|
||||
)
|
||||
)
|
||||
"
|
||||
|
||||
# Tests failing again because of compiler issues; bugs #932646, #943401
|
||||
RESTRICT="!test? ( test )"
|
||||
FORTRAN_DEPEND="virtual/fortran"
|
||||
|
||||
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
|
||||
lapack? (
|
||||
${PYTHON_DEPS}
|
||||
)
|
||||
spqr? (
|
||||
cholmod? (
|
||||
blas? (
|
||||
lapack? (
|
||||
${FORTRAN_DEPEND}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
pastix? ( ${FORTRAN_DEPEND} )
|
||||
)
|
||||
blas? ( ${FORTRAN_DEPEND} )
|
||||
lapack? ( ${FORTRAN_DEPEND} )
|
||||
"
|
||||
|
||||
TEST_BACKENDS="
|
||||
adolc? ( sci-libs/adolc[sparse] )
|
||||
boost? ( dev-libs/boost )
|
||||
cholmod? ( sci-libs/cholmod:=[cuda?] )
|
||||
fftw? ( sci-libs/fftw[openmp?] )
|
||||
klu? ( sci-libs/klu )
|
||||
metis? (
|
||||
sci-libs/metis[openmp?]
|
||||
sci-libs/pastix[metis]
|
||||
)
|
||||
opengl? (
|
||||
media-libs/freeglut
|
||||
media-libs/glew
|
||||
media-libs/libglvnd
|
||||
)
|
||||
pastix? (
|
||||
sci-libs/pastix[-mpi]
|
||||
|| (
|
||||
sci-libs/pastix[scotch]
|
||||
sci-libs/pastix[metis]
|
||||
)
|
||||
)
|
||||
pocketfft? ( dev-libs/pocketfft )
|
||||
sparsehash? (
|
||||
amd64? ( dev-cpp/sparsehash )
|
||||
arm64? ( dev-cpp/sparsehash )
|
||||
ppc64? ( dev-cpp/sparsehash )
|
||||
x86? ( dev-cpp/sparsehash )
|
||||
)
|
||||
spqr? ( sci-libs/spqr )
|
||||
superlu? ( sci-libs/superlu )
|
||||
umfpack? ( sci-libs/umfpack:= )
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
test? (
|
||||
cuda? (
|
||||
!cuda-clang? (
|
||||
dev-util/nvidia-cuda-toolkit
|
||||
)
|
||||
cuda-clang? (
|
||||
$(llvm_gen_dep '
|
||||
llvm-core/clang:${LLVM_SLOT}
|
||||
llvm-runtimes/clang-runtime:${LLVM_SLOT}[llvm_targets_NVPTX,offload,openmp]
|
||||
')
|
||||
)
|
||||
)
|
||||
hip? ( dev-util/hip )
|
||||
!blas? (
|
||||
virtual/blas
|
||||
!lapack? (
|
||||
virtual/lapacke
|
||||
)
|
||||
)
|
||||
${TEST_BACKENDS}
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-3.4.0-doc-nocompress.patch" # bug 830064
|
||||
"${FILESDIR}/${PN}-3.4.0-buildstring.patch"
|
||||
"${FILESDIR}/${PN}-5.0.0-please_protect_your_min_with_parentheses.patch"
|
||||
|
||||
# PRs
|
||||
"${FILESDIR}/${PN}-5.0.0-doxygen-1.14.patch"
|
||||
|
||||
"${FILESDIR}/${PN}-5.0.1-cmake-GNUInstallDirs.patch"
|
||||
"${FILESDIR}/${PN}-5.0.1-make-static-libs-optional.patch"
|
||||
|
||||
"${FILESDIR}/${PN}-5.0.1-Do-not-show-deprecated-CUDA-device-properties-for-CU.patch"
|
||||
)
|
||||
|
||||
# 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="$(
|
||||
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
|
||||
echo "${CUDAHOSTCXX}"
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
|
||||
tc-check-openmp
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
|
||||
tc-check-openmp
|
||||
fi
|
||||
|
||||
if use lapack; then
|
||||
python-any-r1_pkg_setup
|
||||
fi
|
||||
|
||||
if { use test && { use spqr && use cholmod && use blas && use lapack; } || use pastix; } \
|
||||
|| use blas \
|
||||
|| use lapack \
|
||||
; then
|
||||
fortran-2_pkg_setup
|
||||
fi
|
||||
|
||||
if use test && use cuda && use cuda-clang; then
|
||||
llvm-r2_pkg_setup
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} = *9999* ]] ; then
|
||||
git-r3_src_unpack
|
||||
else
|
||||
unpack "${P}.tar.bz2"
|
||||
fi
|
||||
|
||||
if use test && use lapack; then
|
||||
pushd "${S}/lapack" > /dev/null || die
|
||||
unpack "${PN}-lapack_addons-${LAPACK_ADDONS_PV}.tgz"
|
||||
popd > /dev/null || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
# run patches here as we patch in test/
|
||||
cmake_src_prepare
|
||||
|
||||
if use test && use lapack; then
|
||||
pushd "${S}" > /dev/null || die
|
||||
eapply "${FILESDIR}/${PN}-5.0.1-fix-lapack_testing.py.patch"
|
||||
popd > /dev/null || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
if use lapack; then
|
||||
# bug 878987
|
||||
# multiple definition of `cgesdd_'
|
||||
filter-lto
|
||||
fi
|
||||
|
||||
local mycmakeargs=(
|
||||
-DCMAKE_CXX_STANDARD="20"
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE="yes"
|
||||
|
||||
-DEIGEN_BUILD_TESTING="$(usex test)" # Enable creation of Eigen tests.
|
||||
|
||||
-DEIGEN_BUILD_BLAS="$(usex blas)" # Toggles the building of the Eigen Blas library
|
||||
-DEIGEN_BUILD_LAPACK="$(usex blas "$(usex lapack)")" # Toggles the building of the included Eigen LAPACK library
|
||||
|
||||
-DEIGEN_BUILD_DOC="$(usex doc)" # Enable creation of Eigen documentation
|
||||
-DEIGEN_BUILD_PKGCONFIG="yes" # Build pkg-config .pc file for Eigen
|
||||
)
|
||||
|
||||
append-cxxflags "-DEIGEN_USE_OPENBLAS_BFLOAT16=0"
|
||||
|
||||
if use blas; then
|
||||
mycmakeargs+=(
|
||||
-DBUILD_SHARED_LIBS="yes"
|
||||
-DEIGEN_BUILD_SHARED_LIBS="yes"
|
||||
-DEIGEN_BUILD_STATIC_LIBS="yes"
|
||||
-DEIGEN_INSTALL_STATIC_LIBS="yes"
|
||||
)
|
||||
|
||||
if use lapack; then
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0148="OLD" # FindPythonInterp
|
||||
-DEIGEN_ENABLE_LAPACK_TESTS="$(usex test)"
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
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+=(
|
||||
-DEIGEN_LEAVE_TEST_IN_ALL_TARGET=yes # Leaves tests in the all target, needed by ctest for automatic building
|
||||
|
||||
# the OpenGL testsuite is extremely brittle, bug #712808
|
||||
-DEIGEN_TEST_OPENGL="$(usex opengl)" # Enable OpenGL support in unit tests
|
||||
-DEIGEN_TEST_OPENMP="$(usex openmp)" # Enable/Disable OpenMP in tests/examples
|
||||
|
||||
-DEIGEN_TEST_EXTERNAL_BLAS="$(usex !blas)" # Use external BLAS library for testsuite
|
||||
|
||||
-DEIGEN_TEST_BUILD_DOCUMENTATION="no" # $(usex doc)" # Test building the doxygen documentation
|
||||
|
||||
-DEIGEN_DEBUG_ASSERTS="$(usex debug)" # Enable advanced debugging of assertions
|
||||
-DEIGEN_SPLIT_LARGE_TESTS="yes" # Split large tests into smaller executables
|
||||
|
||||
-DEIGEN_TEST_CUDA="$(usex cuda)" # Enable CUDA support in unit tests
|
||||
-DEIGEN_TEST_CUDA_CLANG="$(usex cuda "$(usex cuda-clang)")" # Use clang instead of nvcc to compile the CUDA tests
|
||||
|
||||
-DEIGEN_TEST_HIP="$(usex hip)" # Add HIP support.
|
||||
|
||||
# -DEIGEN_TEST_SYCL="$(usex sycl)" # Add Sycl support.
|
||||
# -DEIGEN_SYCL_TRISYCL="no" # Use the triSYCL Sycl implementation (ComputeCPP by default).
|
||||
|
||||
$(cmake_use_find_package adolc Adolc)
|
||||
$(cmake_use_find_package boost Boost)
|
||||
$(cmake_use_find_package cholmod CHOLMOD)
|
||||
# -DDUCCFFT="$(usex ducc)"
|
||||
-DDUCC_ROOT="DUCCFFT"
|
||||
-DDUCCFFT="NOTFOUND"
|
||||
$(cmake_use_find_package fftw FFTW )
|
||||
$(cmake_use_find_package klu KLU)
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_MPREAL=yes
|
||||
# $(cmake_use_find_package opengl OpenGL) # EIGEN_TEST_OPENGL
|
||||
# $(cmake_use_find_package openmp OpenMP) # EIGEN_TEST_OPENMP
|
||||
$(cmake_use_find_package pastix PASTIX)
|
||||
# prevent pastix_nompi.h lookup it no longer exists, we enforce this via deps
|
||||
-DPASTIX_pastix_nompi.h_INCLUDE_DIRS="FOUND"
|
||||
|
||||
-DPOCKETFFT="$(usex pocketfft)"
|
||||
$(cmake_use_find_package sparsehash GoogleHash)
|
||||
$(cmake_use_find_package spqr SPQR)
|
||||
$(cmake_use_find_package superlu SuperLU)
|
||||
$(cmake_use_find_package umfpack UMFPACK)
|
||||
)
|
||||
|
||||
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 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 ppc || use ppc64; then
|
||||
mycmakeargs+=(
|
||||
-DEIGEN_TEST_ALTIVEC="$(usex cpu_flags_ppc_altivec)"
|
||||
-DEIGEN_TEST_VSX="$(usex cpu_flags_ppc_vsx)"
|
||||
)
|
||||
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
|
||||
|
||||
if use cuda; then
|
||||
cuda_add_sandbox -w
|
||||
|
||||
if use cuda-clang; then
|
||||
local llvm_prefix
|
||||
llvm_prefix="$(get_llvm_prefix -b)"
|
||||
|
||||
# NVCCFLAGS gets injected into CMAKE_CXX_FLAGS, which means we need to use clang as gcc will fail with
|
||||
# error: unrecognized command-line option
|
||||
if ! tc-is-clang; then
|
||||
export CC="${CHOST}-clang-${LLVM_SLOT}"
|
||||
export CXX="${CHOST}-clang++-${LLVM_SLOT}"
|
||||
fi
|
||||
|
||||
NVCCFLAGS="${NVCCFLAGS:+${NVCCFLAGS} }--libomptarget-nvptx-bc-path=${llvm_prefix}/$(get_libdir)/nvptx64-nvidia-cuda/libomptarget-nvptx.bc"
|
||||
|
||||
mycmakeargs+=(
|
||||
-DCUDA_HOST_COMPILER="${CHOST}-clang++-${LLVM_SLOT}"
|
||||
)
|
||||
else
|
||||
cuda_set_CUDAHOSTCXX
|
||||
|
||||
mycmakeargs+=(
|
||||
-DCUDA_HOST_COMPILER="${CUDAHOSTCXX}"
|
||||
)
|
||||
if [[ -v CUDACXX ]]; then
|
||||
mycmakeargs+=(
|
||||
-DCUDA_NVCC_EXECUTABLE="${CUDACXX}"
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0146="OLD" # FindCUDA
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${CUDA_VERBOSE}" == true ]]; then
|
||||
mycmakeargs+=(
|
||||
-DCUDA_VERBOSE_BUILD="yes"
|
||||
)
|
||||
NVCCFLAGS+=" -v"
|
||||
fi
|
||||
|
||||
if [[ -v CUDAARCHS ]]; then
|
||||
mycmakeargs+=(
|
||||
# TODO this needs to be lowest first for eigen
|
||||
-DEIGEN_CUDA_COMPUTE_ARCH="${CUDAARCHS}"
|
||||
)
|
||||
fi
|
||||
|
||||
# CUDAFLAGS is used by cmake
|
||||
# NVCCFLAGS is used by cuda.eclass
|
||||
mycmakeargs+=(
|
||||
-DEIGEN_CUDA_CXX_FLAGS="${NVCCFLAGS}"
|
||||
|
||||
-DCUDA_USE_STATIC_CUDA_RUNTIME="no"
|
||||
)
|
||||
fi
|
||||
|
||||
if use opengl; then
|
||||
mycmakeargs+=(
|
||||
-DOpenGL_GL_PREFERENCE="GLVND"
|
||||
)
|
||||
fi
|
||||
|
||||
if use pocketfft; then
|
||||
mycmakeargs+=(
|
||||
-DEIGEN_TEST_CXX11=yes
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
local targets=()
|
||||
|
||||
if use blas; then
|
||||
targets+=( blas )
|
||||
if use lapack; then
|
||||
targets+=( lapack )
|
||||
fi
|
||||
fi
|
||||
|
||||
if use test; then
|
||||
targets+=( buildtests )
|
||||
|
||||
if use cuda || use hip; then
|
||||
targets+=( buildtests_gpu )
|
||||
fi
|
||||
|
||||
# tests generate random data, which fails for some seeds
|
||||
# we solve this via test reruns now
|
||||
# export EIGEN_SEED=712808
|
||||
fi
|
||||
|
||||
# we add doc last to capture results for buildtests
|
||||
if use doc; then
|
||||
targets+=( doc )
|
||||
fi
|
||||
|
||||
if [[ -n "${targets[*]}" ]]; then
|
||||
cmake_src_compile "${targets[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
src_test() {
|
||||
local CMAKE_SKIP_TESTS=(
|
||||
"^ref_8$"
|
||||
)
|
||||
|
||||
if ! use blas; then
|
||||
CMAKE_SKIP_TESTS+=(
|
||||
"^nomalloc_1$" # smoketest
|
||||
"^nomalloc_2$"
|
||||
"^nomalloc_3$"
|
||||
"^nomalloc_4$"
|
||||
|
||||
"^product_notemporary_1$"
|
||||
"^product_notemporary_2$"
|
||||
"^product_notemporary_3$"
|
||||
"^product_notemporary_4$"
|
||||
)
|
||||
fi
|
||||
|
||||
if use cholmod && use blas && use lapack; then
|
||||
CMAKE_SKIP_TESTS+=(
|
||||
"^cholmod_support_21$"
|
||||
"^cholmod_support_22$"
|
||||
)
|
||||
fi
|
||||
|
||||
if use cuda; then
|
||||
cuda_add_sandbox -w
|
||||
fi
|
||||
|
||||
if use klu && use blas; then
|
||||
CMAKE_SKIP_TESTS+=(
|
||||
"^klu_support_1$"
|
||||
"^klu_support_2$"
|
||||
)
|
||||
fi
|
||||
|
||||
if use lapack; then
|
||||
CMAKE_SKIP_TESTS+=(
|
||||
"^LAPACK-xlintsts_stest_in$"
|
||||
"^LAPACK-xeigtsts_sep_in$"
|
||||
"^LAPACK-xeigtsts_svd_in$"
|
||||
"^LAPACK-xlintstd_dtest_in$"
|
||||
"^LAPACK-xeigtstd_sep_in$"
|
||||
"^LAPACK-xeigtstd_svd_in$"
|
||||
"^LAPACK-xlintstc_ctest_in$"
|
||||
"^LAPACK-xeigtstc_svd_in$"
|
||||
)
|
||||
fi
|
||||
|
||||
local myctestargs=(
|
||||
-j1 # otherwise breaks due to cmake reruns
|
||||
--repeat until-pass:50
|
||||
)
|
||||
|
||||
if use opengl; then
|
||||
virtx \
|
||||
cmake_src_test
|
||||
else
|
||||
cmake_src_test
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local DOCS=()
|
||||
cmake_src_install
|
||||
|
||||
if use doc; then
|
||||
pushd "${BUILD_DIR}/doc" > /dev/null || die
|
||||
dodoc -r html
|
||||
popd > /dev/null || die
|
||||
fi
|
||||
}
|
||||
634
dev-cpp/eigen/eigen-5.0.9999.ebuild
Normal file
634
dev-cpp/eigen/eigen-5.0.9999.ebuild
Normal file
@@ -0,0 +1,634 @@
|
||||
# Copyright 1999-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
LLVM_COMPAT=( {21..23} )
|
||||
LLVM_OPTIONAL="cuda-clang"
|
||||
|
||||
PYTHON_COMPAT=( python3_{12..13} )
|
||||
|
||||
FORTRAN_NEEDED="no"
|
||||
|
||||
LAPACK_ADDONS_PV="3.4.1"
|
||||
|
||||
inherit cmake cuda flag-o-matic fortran-2 llvm-r2 python-any-r1 toolchain-funcs virtualx
|
||||
|
||||
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} = *.9999* ]] ; then
|
||||
EGIT_BRANCH="$(ver_cut 1-2)"
|
||||
fi
|
||||
else
|
||||
SRC_URI="
|
||||
https://gitlab.com/lib${PN}/${PN}/-/archive/${PV}/${P}.tar.bz2
|
||||
"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos"
|
||||
fi
|
||||
|
||||
SRC_URI+="
|
||||
test? (
|
||||
lapack? (
|
||||
https://downloads.tuxfamily.org/${PN}/lapack_addons_${LAPACK_ADDONS_PV}.tgz
|
||||
-> ${PN}-lapack_addons-${LAPACK_ADDONS_PV}.tgz
|
||||
)
|
||||
)
|
||||
"
|
||||
|
||||
LICENSE="MPL-2.0"
|
||||
SLOT="3/$(ver_cut 1-2)"
|
||||
|
||||
# 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"
|
||||
"metis"
|
||||
"opengl"
|
||||
"pastix"
|
||||
"pocketfft"
|
||||
"sparsehash"
|
||||
"spqr"
|
||||
"superlu"
|
||||
"umfpack"
|
||||
)
|
||||
|
||||
IUSE="
|
||||
debug
|
||||
blas lapack
|
||||
${CPU_FEATURES_MAP[*]%:*}
|
||||
cuda cuda-clang hip
|
||||
doc mathjax
|
||||
openmp
|
||||
test ${IUSE_TEST_BACKENDS[*]}
|
||||
"
|
||||
# zvector
|
||||
|
||||
REQUIRED_USE="
|
||||
lapack? (
|
||||
blas
|
||||
)
|
||||
test? (
|
||||
|| ( ${IUSE_TEST_BACKENDS[*]} )
|
||||
cuda-clang? (
|
||||
!openmp
|
||||
${LLVM_REQUIRED_USE}
|
||||
)
|
||||
)
|
||||
"
|
||||
|
||||
# Tests failing again because of compiler issues; bugs #932646, #943401
|
||||
RESTRICT="!test? ( test )"
|
||||
FORTRAN_DEPEND="virtual/fortran"
|
||||
|
||||
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
|
||||
lapack? (
|
||||
${PYTHON_DEPS}
|
||||
)
|
||||
spqr? (
|
||||
cholmod? (
|
||||
blas? (
|
||||
lapack? (
|
||||
${FORTRAN_DEPEND}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
pastix? ( ${FORTRAN_DEPEND} )
|
||||
)
|
||||
blas? ( ${FORTRAN_DEPEND} )
|
||||
lapack? ( ${FORTRAN_DEPEND} )
|
||||
"
|
||||
|
||||
TEST_BACKENDS="
|
||||
adolc? ( sci-libs/adolc[sparse] )
|
||||
boost? ( dev-libs/boost )
|
||||
cholmod? ( sci-libs/cholmod:=[cuda?] )
|
||||
fftw? ( sci-libs/fftw[openmp?] )
|
||||
klu? ( sci-libs/klu )
|
||||
metis? (
|
||||
sci-libs/metis[openmp?]
|
||||
sci-libs/pastix[metis]
|
||||
)
|
||||
opengl? (
|
||||
media-libs/freeglut
|
||||
media-libs/glew
|
||||
media-libs/libglvnd
|
||||
)
|
||||
pastix? (
|
||||
sci-libs/pastix[-mpi]
|
||||
|| (
|
||||
sci-libs/pastix[scotch]
|
||||
sci-libs/pastix[metis]
|
||||
)
|
||||
)
|
||||
pocketfft? ( dev-libs/pocketfft )
|
||||
sparsehash? (
|
||||
amd64? ( dev-cpp/sparsehash )
|
||||
arm64? ( dev-cpp/sparsehash )
|
||||
ppc64? ( dev-cpp/sparsehash )
|
||||
x86? ( dev-cpp/sparsehash )
|
||||
)
|
||||
spqr? ( sci-libs/spqr )
|
||||
superlu? ( sci-libs/superlu )
|
||||
umfpack? ( sci-libs/umfpack:= )
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
test? (
|
||||
cuda? (
|
||||
!cuda-clang? (
|
||||
dev-util/nvidia-cuda-toolkit
|
||||
)
|
||||
cuda-clang? (
|
||||
$(llvm_gen_dep '
|
||||
llvm-core/clang:${LLVM_SLOT}
|
||||
llvm-runtimes/clang-runtime:${LLVM_SLOT}[llvm_targets_NVPTX,offload,openmp]
|
||||
')
|
||||
)
|
||||
)
|
||||
hip? ( dev-util/hip )
|
||||
!blas? (
|
||||
virtual/blas
|
||||
!lapack? (
|
||||
virtual/lapacke
|
||||
)
|
||||
)
|
||||
${TEST_BACKENDS}
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-3.4.0-doc-nocompress.patch" # bug 830064
|
||||
"${FILESDIR}/${PN}-3.4.0-buildstring.patch"
|
||||
"${FILESDIR}/${PN}-5.0.0-please_protect_your_min_with_parentheses.patch"
|
||||
|
||||
# PRs
|
||||
"${FILESDIR}/${PN}-5.0.0-doxygen-1.14.patch"
|
||||
|
||||
"${FILESDIR}/${PN}-5.0.1-cmake-GNUInstallDirs.patch"
|
||||
"${FILESDIR}/${PN}-5.0.1-make-static-libs-optional.patch"
|
||||
|
||||
"${FILESDIR}/${PN}-5.0.1-Do-not-show-deprecated-CUDA-device-properties-for-CU.patch"
|
||||
)
|
||||
|
||||
# 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="$(
|
||||
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
|
||||
echo "${CUDAHOSTCXX}"
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
|
||||
tc-check-openmp
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
|
||||
tc-check-openmp
|
||||
fi
|
||||
|
||||
if use lapack; then
|
||||
python-any-r1_pkg_setup
|
||||
fi
|
||||
|
||||
if { use test && { use spqr && use cholmod && use blas && use lapack; } || use pastix; } \
|
||||
|| use blas \
|
||||
|| use lapack \
|
||||
; then
|
||||
fortran-2_pkg_setup
|
||||
fi
|
||||
|
||||
if use test && use cuda && use cuda-clang; then
|
||||
llvm-r2_pkg_setup
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} = *9999* ]] ; then
|
||||
git-r3_src_unpack
|
||||
else
|
||||
unpack "${P}.tar.bz2"
|
||||
fi
|
||||
|
||||
if use test && use lapack; then
|
||||
pushd "${S}/lapack" > /dev/null || die
|
||||
unpack "${PN}-lapack_addons-${LAPACK_ADDONS_PV}.tgz"
|
||||
popd > /dev/null || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
# run patches here as we patch in test/
|
||||
cmake_src_prepare
|
||||
|
||||
if use test && use lapack; then
|
||||
pushd "${S}" > /dev/null || die
|
||||
eapply "${FILESDIR}/${PN}-5.0.1-fix-lapack_testing.py.patch"
|
||||
popd > /dev/null || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
if use lapack; then
|
||||
# bug 878987
|
||||
# multiple definition of `cgesdd_'
|
||||
filter-lto
|
||||
fi
|
||||
|
||||
local mycmakeargs=(
|
||||
-DCMAKE_CXX_STANDARD="20"
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE="yes"
|
||||
|
||||
-DEIGEN_BUILD_TESTING="$(usex test)" # Enable creation of Eigen tests.
|
||||
|
||||
-DEIGEN_BUILD_BLAS="$(usex blas)" # Toggles the building of the Eigen Blas library
|
||||
-DEIGEN_BUILD_LAPACK="$(usex blas "$(usex lapack)")" # Toggles the building of the included Eigen LAPACK library
|
||||
|
||||
-DEIGEN_BUILD_DOC="$(usex doc)" # Enable creation of Eigen documentation
|
||||
-DEIGEN_BUILD_PKGCONFIG="yes" # Build pkg-config .pc file for Eigen
|
||||
)
|
||||
|
||||
append-cxxflags "-DEIGEN_USE_OPENBLAS_BFLOAT16=0"
|
||||
|
||||
if use blas; then
|
||||
mycmakeargs+=(
|
||||
-DBUILD_SHARED_LIBS="yes"
|
||||
-DEIGEN_BUILD_SHARED_LIBS="yes"
|
||||
-DEIGEN_BUILD_STATIC_LIBS="yes"
|
||||
-DEIGEN_INSTALL_STATIC_LIBS="yes"
|
||||
)
|
||||
|
||||
if use lapack; then
|
||||
mycmakeargs+=(
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0148="OLD" # FindPythonInterp
|
||||
-DEIGEN_ENABLE_LAPACK_TESTS="$(usex test)"
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
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+=(
|
||||
-DEIGEN_LEAVE_TEST_IN_ALL_TARGET=yes # Leaves tests in the all target, needed by ctest for automatic building
|
||||
|
||||
# the OpenGL testsuite is extremely brittle, bug #712808
|
||||
-DEIGEN_TEST_OPENGL="$(usex opengl)" # Enable OpenGL support in unit tests
|
||||
-DEIGEN_TEST_OPENMP="$(usex openmp)" # Enable/Disable OpenMP in tests/examples
|
||||
|
||||
-DEIGEN_TEST_EXTERNAL_BLAS="$(usex !blas)" # Use external BLAS library for testsuite
|
||||
|
||||
-DEIGEN_TEST_BUILD_DOCUMENTATION="no" # $(usex doc)" # Test building the doxygen documentation
|
||||
|
||||
-DEIGEN_DEBUG_ASSERTS="$(usex debug)" # Enable advanced debugging of assertions
|
||||
-DEIGEN_SPLIT_LARGE_TESTS="yes" # Split large tests into smaller executables
|
||||
|
||||
-DEIGEN_TEST_CUDA="$(usex cuda)" # Enable CUDA support in unit tests
|
||||
-DEIGEN_TEST_CUDA_CLANG="$(usex cuda "$(usex cuda-clang)")" # Use clang instead of nvcc to compile the CUDA tests
|
||||
|
||||
-DEIGEN_TEST_HIP="$(usex hip)" # Add HIP support.
|
||||
|
||||
# -DEIGEN_TEST_SYCL="$(usex sycl)" # Add Sycl support.
|
||||
# -DEIGEN_SYCL_TRISYCL="no" # Use the triSYCL Sycl implementation (ComputeCPP by default).
|
||||
|
||||
$(cmake_use_find_package adolc Adolc)
|
||||
$(cmake_use_find_package boost Boost)
|
||||
$(cmake_use_find_package cholmod CHOLMOD)
|
||||
# -DDUCCFFT="$(usex ducc)"
|
||||
-DDUCC_ROOT="DUCCFFT"
|
||||
-DDUCCFFT="NOTFOUND"
|
||||
$(cmake_use_find_package fftw FFTW )
|
||||
$(cmake_use_find_package klu KLU)
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_MPREAL=yes
|
||||
# $(cmake_use_find_package opengl OpenGL) # EIGEN_TEST_OPENGL
|
||||
# $(cmake_use_find_package openmp OpenMP) # EIGEN_TEST_OPENMP
|
||||
$(cmake_use_find_package pastix PASTIX)
|
||||
# prevent pastix_nompi.h lookup it no longer exists, we enforce this via deps
|
||||
-DPASTIX_pastix_nompi.h_INCLUDE_DIRS="FOUND"
|
||||
|
||||
-DPOCKETFFT="$(usex pocketfft)"
|
||||
$(cmake_use_find_package sparsehash GoogleHash)
|
||||
$(cmake_use_find_package spqr SPQR)
|
||||
$(cmake_use_find_package superlu SuperLU)
|
||||
$(cmake_use_find_package umfpack UMFPACK)
|
||||
)
|
||||
|
||||
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 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 ppc || use ppc64; then
|
||||
mycmakeargs+=(
|
||||
-DEIGEN_TEST_ALTIVEC="$(usex cpu_flags_ppc_altivec)"
|
||||
-DEIGEN_TEST_VSX="$(usex cpu_flags_ppc_vsx)"
|
||||
)
|
||||
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
|
||||
|
||||
if use cuda; then
|
||||
cuda_add_sandbox -w
|
||||
|
||||
if use cuda-clang; then
|
||||
local llvm_prefix
|
||||
llvm_prefix="$(get_llvm_prefix -b)"
|
||||
|
||||
# NVCCFLAGS gets injected into CMAKE_CXX_FLAGS, which means we need to use clang as gcc will fail with
|
||||
# error: unrecognized command-line option
|
||||
if ! tc-is-clang; then
|
||||
export CC="${CHOST}-clang-${LLVM_SLOT}"
|
||||
export CXX="${CHOST}-clang++-${LLVM_SLOT}"
|
||||
fi
|
||||
|
||||
NVCCFLAGS="${NVCCFLAGS:+${NVCCFLAGS} }--libomptarget-nvptx-bc-path=${llvm_prefix}/$(get_libdir)/nvptx64-nvidia-cuda/libomptarget-nvptx.bc"
|
||||
|
||||
mycmakeargs+=(
|
||||
-DCUDA_HOST_COMPILER="${CHOST}-clang++-${LLVM_SLOT}"
|
||||
)
|
||||
else
|
||||
cuda_set_CUDAHOSTCXX
|
||||
|
||||
mycmakeargs+=(
|
||||
-DCUDA_HOST_COMPILER="${CUDAHOSTCXX}"
|
||||
)
|
||||
if [[ -v CUDACXX ]]; then
|
||||
mycmakeargs+=(
|
||||
-DCUDA_NVCC_EXECUTABLE="${CUDACXX}"
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0146="OLD" # FindCUDA
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${CUDA_VERBOSE}" == true ]]; then
|
||||
mycmakeargs+=(
|
||||
-DCUDA_VERBOSE_BUILD="yes"
|
||||
)
|
||||
NVCCFLAGS+=" -v"
|
||||
fi
|
||||
|
||||
if [[ -v CUDAARCHS ]]; then
|
||||
mycmakeargs+=(
|
||||
# TODO this needs to be lowest first for eigen
|
||||
-DEIGEN_CUDA_COMPUTE_ARCH="${CUDAARCHS}"
|
||||
)
|
||||
fi
|
||||
|
||||
# CUDAFLAGS is used by cmake
|
||||
# NVCCFLAGS is used by cuda.eclass
|
||||
mycmakeargs+=(
|
||||
-DEIGEN_CUDA_CXX_FLAGS="${NVCCFLAGS}"
|
||||
|
||||
-DCUDA_USE_STATIC_CUDA_RUNTIME="no"
|
||||
)
|
||||
fi
|
||||
|
||||
if use opengl; then
|
||||
mycmakeargs+=(
|
||||
-DOpenGL_GL_PREFERENCE="GLVND"
|
||||
)
|
||||
fi
|
||||
|
||||
if use pocketfft; then
|
||||
mycmakeargs+=(
|
||||
-DEIGEN_TEST_CXX11=yes
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
local targets=()
|
||||
|
||||
if use blas; then
|
||||
targets+=( blas )
|
||||
if use lapack; then
|
||||
targets+=( lapack )
|
||||
fi
|
||||
fi
|
||||
|
||||
if use test; then
|
||||
targets+=( buildtests )
|
||||
|
||||
if use cuda || use hip; then
|
||||
targets+=( buildtests_gpu )
|
||||
fi
|
||||
|
||||
# tests generate random data, which fails for some seeds
|
||||
# we solve this via test reruns now
|
||||
# export EIGEN_SEED=712808
|
||||
fi
|
||||
|
||||
# we add doc last to capture results for buildtests
|
||||
if use doc; then
|
||||
targets+=( doc )
|
||||
fi
|
||||
|
||||
if [[ -n "${targets[*]}" ]]; then
|
||||
cmake_src_compile "${targets[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
src_test() {
|
||||
local CMAKE_SKIP_TESTS=(
|
||||
"^ref_8$"
|
||||
)
|
||||
|
||||
if ! use blas; then
|
||||
CMAKE_SKIP_TESTS+=(
|
||||
"^nomalloc_1$" # smoketest
|
||||
"^nomalloc_2$"
|
||||
"^nomalloc_3$"
|
||||
"^nomalloc_4$"
|
||||
|
||||
"^product_notemporary_1$"
|
||||
"^product_notemporary_2$"
|
||||
"^product_notemporary_3$"
|
||||
"^product_notemporary_4$"
|
||||
)
|
||||
fi
|
||||
|
||||
if use cholmod && use blas && use lapack; then
|
||||
CMAKE_SKIP_TESTS+=(
|
||||
"^cholmod_support_21$"
|
||||
"^cholmod_support_22$"
|
||||
)
|
||||
fi
|
||||
|
||||
if use cuda; then
|
||||
cuda_add_sandbox -w
|
||||
fi
|
||||
|
||||
if use klu && use blas; then
|
||||
CMAKE_SKIP_TESTS+=(
|
||||
"^klu_support_1$"
|
||||
"^klu_support_2$"
|
||||
)
|
||||
fi
|
||||
|
||||
if use lapack; then
|
||||
CMAKE_SKIP_TESTS+=(
|
||||
"^LAPACK-xlintsts_stest_in$"
|
||||
"^LAPACK-xeigtsts_sep_in$"
|
||||
"^LAPACK-xeigtsts_svd_in$"
|
||||
"^LAPACK-xlintstd_dtest_in$"
|
||||
"^LAPACK-xeigtstd_sep_in$"
|
||||
"^LAPACK-xeigtstd_svd_in$"
|
||||
"^LAPACK-xlintstc_ctest_in$"
|
||||
"^LAPACK-xeigtstc_svd_in$"
|
||||
)
|
||||
fi
|
||||
|
||||
local myctestargs=(
|
||||
-j1 # otherwise breaks due to cmake reruns
|
||||
--repeat until-pass:50
|
||||
)
|
||||
|
||||
if use opengl; then
|
||||
virtx \
|
||||
cmake_src_test
|
||||
else
|
||||
cmake_src_test
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local DOCS=()
|
||||
cmake_src_install
|
||||
|
||||
if use doc; then
|
||||
pushd "${BUILD_DIR}/doc" > /dev/null || die
|
||||
dodoc -r html
|
||||
popd > /dev/null || die
|
||||
fi
|
||||
}
|
||||
136
dev-cpp/eigen/files/eigen-5.0.0-doxygen-1.14.patch
Normal file
136
dev-cpp/eigen/files/eigen-5.0.0-doxygen-1.14.patch
Normal file
@@ -0,0 +1,136 @@
|
||||
From cf458c66ee01802d5023fcab78412583b5c73574 Mon Sep 17 00:00:00 2001
|
||||
From: Guilhem Saurel <guilhem.saurel@laas.fr>
|
||||
Date: Tue, 16 Dec 2025 09:40:05 +0100
|
||||
Subject: [PATCH 1/4] doc: add and use \anchor Eigen_placeholders_lastN
|
||||
|
||||
fix for Doxygen >= 1.14:
|
||||
```
|
||||
doc/Manual.dox:177: error: unable to resolve link to 'Eigen::placeholders::lastN(SizeType)' for \link command
|
||||
doc/Manual.dox:178: error: unable to resolve link to 'Eigen::placeholders::lastN(SizeType,IncrType)' for \link command
|
||||
```
|
||||
---
|
||||
Eigen/src/Core/ArithmeticSequence.h | 2 +-
|
||||
doc/TutorialSlicingIndexing.dox | 3 +--
|
||||
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Eigen/src/Core/ArithmeticSequence.h b/Eigen/src/Core/ArithmeticSequence.h
|
||||
index ae6373dda..41617713f 100644
|
||||
--- a/Eigen/src/Core/ArithmeticSequence.h
|
||||
+++ b/Eigen/src/Core/ArithmeticSequence.h
|
||||
@@ -182,7 +182,7 @@ namespace placeholders {
|
||||
* \returns a symbolic ArithmeticSequence representing the last \a size elements with increment \a incr.
|
||||
*
|
||||
* It is a shortcut for: \code seqN(last-(size-fix<1>)*incr, size, incr) \endcode
|
||||
- *
|
||||
+ * \anchor Eigen_placeholders_lastN
|
||||
* \sa lastN(SizeType), seqN(FirstType,SizeType), seq(FirstType,LastType,IncrType) */
|
||||
template <typename SizeType, typename IncrType>
|
||||
auto lastN(SizeType size, IncrType incr)
|
||||
diff --git a/doc/TutorialSlicingIndexing.dox b/doc/TutorialSlicingIndexing.dox
|
||||
index 6ebaa2d6d..a1b00dfc4 100644
|
||||
--- a/doc/TutorialSlicingIndexing.dox
|
||||
+++ b/doc/TutorialSlicingIndexing.dox
|
||||
@@ -114,8 +114,7 @@ Here are some examples for a 2D array/matrix \c A and a 1D array/vector \c v.
|
||||
|
||||
As seen in the last example, referencing the <i> last n </i> elements (or rows/columns) is a bit cumbersome to write.
|
||||
This becomes even more tricky and error prone with a non-default increment.
|
||||
-Here comes \link Eigen::placeholders::lastN(SizeType) Eigen::placeholders::lastN(size) \endlink, and
|
||||
-\link Eigen::placeholders::lastN(SizeType,IncrType) Eigen::placeholders::lastN(size,incr) \endlink:
|
||||
+Here comes \ref Eigen_placeholders_lastN :
|
||||
|
||||
<table class="manual">
|
||||
<tr>
|
||||
--
|
||||
GitLab
|
||||
|
||||
|
||||
From 6be98c166c86a2360177bad9cdccc55ac1ceed7b Mon Sep 17 00:00:00 2001
|
||||
From: Guilhem Saurel <guilhem.saurel@laas.fr>
|
||||
Date: Tue, 16 Dec 2025 10:13:56 +0100
|
||||
Subject: [PATCH 2/4] doc: fix html
|
||||
|
||||
fix for Doxygen >= 1.14:
|
||||
```
|
||||
doc/Manual.dox:656: error: expected <tr> or </table> tag but found token TK_HTMLTAG instead!
|
||||
```
|
||||
---
|
||||
doc/QuickReference.dox | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/doc/QuickReference.dox b/doc/QuickReference.dox
|
||||
index 1fb000fdc..4aece902c 100644
|
||||
--- a/doc/QuickReference.dox
|
||||
+++ b/doc/QuickReference.dox
|
||||
@@ -551,7 +551,6 @@ Read-write access to sub-vectors:
|
||||
<tr>
|
||||
<th>Default versions</th>
|
||||
<th>Optimized versions when the size \n is known at compile time</th></tr>
|
||||
-<th></th>
|
||||
|
||||
<tr><td>\code vec1.head(n)\endcode</td><td>\code vec1.head<n>()\endcode</td><td>the first \c n coeffs </td></tr>
|
||||
<tr><td>\code vec1.tail(n)\endcode</td><td>\code vec1.tail<n>()\endcode</td><td>the last \c n coeffs </td></tr>
|
||||
--
|
||||
GitLab
|
||||
|
||||
|
||||
From ac5d00609f14b7402f1fe8274e4d5db3c61f091e Mon Sep 17 00:00:00 2001
|
||||
From: Guilhem Saurel <guilhem.saurel@laas.fr>
|
||||
Date: Tue, 16 Dec 2025 10:37:35 +0100
|
||||
Subject: [PATCH 3/4] doc: typo
|
||||
|
||||
fix for doxygen 1.15:
|
||||
```
|
||||
doc/UnalignedArrayAssert.dox:134: error: Reached end of file while still searching closing '`' of a verbatim block starting at line 117
|
||||
doc/UnalignedArrayAssert.dox:134: error: Reached end of file while still inside a (nested) comment. Nesting level 1 (possible line reference(s): 3)
|
||||
```
|
||||
---
|
||||
doc/UnalignedArrayAssert.dox | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/doc/UnalignedArrayAssert.dox b/doc/UnalignedArrayAssert.dox
|
||||
index ca674a267..0ed6f8835 100644
|
||||
--- a/doc/UnalignedArrayAssert.dox
|
||||
+++ b/doc/UnalignedArrayAssert.dox
|
||||
@@ -7,7 +7,7 @@ Hello! You are seeing this webpage because your program terminated on an asserti
|
||||
my_program: path/to/eigen/Eigen/src/Core/DenseStorage.h:44:
|
||||
Eigen::internal::matrix_array<T, Size, MatrixOptions, Align>::internal::matrix_array()
|
||||
[with T = double, int Size = 2, int MatrixOptions = 2, bool Align = true]:
|
||||
-Assertion `(reinterpret_cast<size_t>(array) & (sizemask)) == 0 && "this assertion
|
||||
+Assertion (reinterpret_cast<size_t>(array) & (sizemask)) == 0 && "this assertion
|
||||
is explained here: http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html
|
||||
**** READ THIS WEB PAGE !!! ****"' failed.
|
||||
</pre>
|
||||
--
|
||||
GitLab
|
||||
|
||||
|
||||
From ae263fb905b2dd9ff3ad9b47dc44f90466f7b1c8 Mon Sep 17 00:00:00 2001
|
||||
From: Guilhem Saurel <guilhem.saurel@laas.fr>
|
||||
Date: Tue, 16 Dec 2025 10:40:27 +0100
|
||||
Subject: [PATCH 4/4] doc: define eigenAutoToc alias
|
||||
|
||||
Fix for doxygen 1.15:
|
||||
```
|
||||
doc/Manual.dox:95: error: Found unexpanded alias '\cpp17'. Check if number of arguments passed is correct.
|
||||
doc/Manual.dox:98: error: Found unexpanded alias '\eigenAutoToc'. Check if number of arguments passed is correct.
|
||||
```
|
||||
---
|
||||
doc/Doxyfile.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
|
||||
index 25a7e2e9a..445fc0a6f 100644
|
||||
--- a/doc/Doxyfile.in
|
||||
+++ b/doc/Doxyfile.in
|
||||
@@ -32,7 +32,7 @@ ALIASES = "only_for_vectors=This is only for vectors (either row-
|
||||
"cpp14=<span class='cpp14'>[c++14]</span>" \
|
||||
"cpp17=<span class='cpp17'>[c++17]</span>" \
|
||||
"newin{1}=<span class='newin3x'>New in %Eigen \1.</span>" \
|
||||
- eigenAutoToc= \
|
||||
+ "eigenAutoToc=<!-- TOC placeholder -->" \
|
||||
eigenManualPage=\defgroup
|
||||
EXTENSION_MAPPING = .h=C++ \
|
||||
no_extension=C++
|
||||
--
|
||||
GitLab
|
||||
|
||||
Reference in New Issue
Block a user