summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Zander <negril.nx+gentoo@gmail.com>2024-01-20 22:08:52 +0100
committerSam James <sam@gentoo.org>2024-01-21 03:58:41 +0000
commit96605bdaf660d468681de469406ab6f663d5df72 (patch)
treec749a9e47bf5121dac5d9c236c6a4f352cde2538 /dev-cpp
parentapp-shells/starship: Drop 1.15.0 (diff)
downloadgentoo-96605bdaf660d468681de469406ab6f663d5df72.tar.gz
gentoo-96605bdaf660d468681de469406ab6f663d5df72.tar.bz2
gentoo-96605bdaf660d468681de469406ab6f663d5df72.zip
dev-cpp/eigen: bugfix & improvement
Fix llvm_pkg_setup failure when llvm isn't installed. Refactor src_configure to reduce detection steps when not building tests. Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/34927 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-cpp')
-rw-r--r--dev-cpp/eigen/eigen-3.4.0-r2.ebuild61
-rw-r--r--dev-cpp/eigen/eigen-3.4.9999.ebuild61
-rw-r--r--dev-cpp/eigen/eigen-9999.ebuild61
-rw-r--r--dev-cpp/eigen/metadata.xml1
4 files changed, 128 insertions, 56 deletions
diff --git a/dev-cpp/eigen/eigen-3.4.0-r2.ebuild b/dev-cpp/eigen/eigen-3.4.0-r2.ebuild
index 3ecf3d7a3bf7..04a52fe2d8ea 100644
--- a/dev-cpp/eigen/eigen-3.4.0-r2.ebuild
+++ b/dev-cpp/eigen/eigen-3.4.0-r2.ebuild
@@ -58,11 +58,11 @@ X86_CPU_FEATURES=(
# )
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_}
+ "${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=(
@@ -80,7 +80,7 @@ IUSE_TEST_BACKENDS=(
"umfpack"
)
-IUSE="${CPU_FEATURES_MAP[*]%:*} clang cuda hip debug doc lapack test ${IUSE_TEST_BACKENDS[*]}" #zvector
+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 )"
@@ -93,6 +93,7 @@ BDEPEND="
dev-texlive/texlive-fontutils
dev-texlive/texlive-latex
dev-texlive/texlive-latexextra
+ mathjax? ( dev-libs/mathjax )
)
test? ( virtual/pkgconfig )
"
@@ -186,6 +187,10 @@ cuda_set_CUDAHOSTCXX() {
export CUDAHOSTCXX
}
+pkg_setup() {
+ use test && use cuda && use clang && llvm_pkg_setup
+}
+
src_unpack() {
if [[ ${PV} = *9999* ]] ; then
git-r3_src_unpack
@@ -202,18 +207,44 @@ src_unpack() {
src_prepare() {
cmake_src_prepare
- cmake_comment_add_subdirectory demos
+ 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" \
+ 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
@@ -221,9 +252,6 @@ src_configure() {
-DEIGEN_TEST_OPENGL="$(usex opengl)" # Enable OpenGL support in unit tests
-DEIGEN_TEST_OPENMP="$(usex openmp)" # Enable/Disable OpenMP in tests/examples
- # needs Qt4
- -DEIGEN_TEST_NOQT=yes # Disable Qt support in unit tests
-
-DCMAKE_DISABLE_FIND_PACKAGE_MPREAL=ON
-DEIGEN_TEST_CXX11=yes
@@ -234,11 +262,6 @@ src_configure() {
# -DEIGEN_BUILD_BTL=yes # Build benchmark suite
- # -DEIGEN_INTERNAL_DOCUMENTATION=no # Build internal documentation
- # -DEIGEN_BUILD_DOC=yes # Enable creation of Eigen documentation
- # -DEIGEN_BUILD_PKGCONFIG=yes # Build pkg-config .pc file for Eigen
- # -DEIGEN_DOC_USE_MATHJAX=yes # Use MathJax for rendering math in HTML docs
-
-DEIGEN_TEST_BUILD_DOCUMENTATION="$(usex doc)" # Test building the doxygen documentation
# -DEIGEN_COVERAGE_TESTING=no # Enable/disable gcov
@@ -341,12 +364,12 @@ src_configure() {
if use cuda; then
cuda_add_sandbox -w
- export CUDAFLAGS="${NVCCFLAGS}"
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+=(
@@ -360,6 +383,8 @@ src_configure() {
NVCCFLAGS+=" -v"
fi
+ export CUDAFLAGS="${NVCCFLAGS}"
+
[[ -z "${CUDAARCHS}" ]] && einfo "trying to determine host CUDAARCHS"
: "${CUDAARCHS:=$(__nvcc_device_query)}"
export CUDAARCHS
diff --git a/dev-cpp/eigen/eigen-3.4.9999.ebuild b/dev-cpp/eigen/eigen-3.4.9999.ebuild
index 223638535893..e4f1e0613661 100644
--- a/dev-cpp/eigen/eigen-3.4.9999.ebuild
+++ b/dev-cpp/eigen/eigen-3.4.9999.ebuild
@@ -58,11 +58,11 @@ X86_CPU_FEATURES=(
# )
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_}
+ "${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=(
@@ -80,7 +80,7 @@ IUSE_TEST_BACKENDS=(
"umfpack"
)
-IUSE="benchmark ${CPU_FEATURES_MAP[*]%:*} clang cuda hip debug doc lapack test ${IUSE_TEST_BACKENDS[*]}" #zvector
+IUSE="benchmark ${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 )"
@@ -93,6 +93,7 @@ BDEPEND="
dev-texlive/texlive-fontutils
dev-texlive/texlive-latex
dev-texlive/texlive-latexextra
+ mathjax? ( dev-libs/mathjax )
)
test? ( virtual/pkgconfig )
"
@@ -185,6 +186,10 @@ cuda_set_CUDAHOSTCXX() {
export CUDAHOSTCXX
}
+pkg_setup() {
+ use test && use cuda && use clang && llvm_pkg_setup
+}
+
src_unpack() {
if [[ ${PV} = *9999* ]] ; then
git-r3_src_unpack
@@ -201,21 +206,45 @@ src_unpack() {
src_prepare() {
cmake_src_prepare
- cmake_comment_add_subdirectory demos
+ 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" \
+ 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=(
- -DEIGEN_BUILD_BTL="$(usex benchmark)"
+ -DBUILD_SHARED_LIBS="yes"
+ -DBUILD_TESTING="$(usex test)"
+
+ -DEIGEN_BUILD_BTL="$(usex benchmark)" # Build benchmark suite
+ -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
@@ -223,9 +252,6 @@ src_configure() {
-DEIGEN_TEST_OPENGL="$(usex opengl)" # Enable OpenGL support in unit tests
-DEIGEN_TEST_OPENMP="$(usex openmp)" # Enable/Disable OpenMP in tests/examples
- # needs Qt4
- -DEIGEN_TEST_NOQT=yes # Disable Qt support in unit tests
-
-DCMAKE_DISABLE_FIND_PACKAGE_MPREAL=ON
-DEIGEN_TEST_CXX11=yes
@@ -236,11 +262,6 @@ src_configure() {
# -DEIGEN_BUILD_BTL=yes # Build benchmark suite
- # -DEIGEN_INTERNAL_DOCUMENTATION=no # Build internal documentation
- # -DEIGEN_BUILD_DOC=yes # Enable creation of Eigen documentation
- # -DEIGEN_BUILD_PKGCONFIG=yes # Build pkg-config .pc file for Eigen
- # -DEIGEN_DOC_USE_MATHJAX=yes # Use MathJax for rendering math in HTML docs
-
-DEIGEN_TEST_BUILD_DOCUMENTATION="$(usex doc)" # Test building the doxygen documentation
# -DEIGEN_COVERAGE_TESTING=no # Enable/disable gcov
@@ -343,12 +364,12 @@ src_configure() {
if use cuda; then
cuda_add_sandbox -w
- export CUDAFLAGS="${NVCCFLAGS}"
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+=(
@@ -362,6 +383,8 @@ src_configure() {
NVCCFLAGS+=" -v"
fi
+ export CUDAFLAGS="${NVCCFLAGS}"
+
[[ -z "${CUDAARCHS}" ]] && einfo "trying to determine host CUDAARCHS"
: "${CUDAARCHS:=$(__nvcc_device_query)}"
export CUDAARCHS
diff --git a/dev-cpp/eigen/eigen-9999.ebuild b/dev-cpp/eigen/eigen-9999.ebuild
index 6e17f2f00d02..219f6dba7d1c 100644
--- a/dev-cpp/eigen/eigen-9999.ebuild
+++ b/dev-cpp/eigen/eigen-9999.ebuild
@@ -58,11 +58,11 @@ X86_CPU_FEATURES=(
# )
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_}
+ "${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=(
@@ -80,7 +80,7 @@ IUSE_TEST_BACKENDS=(
"umfpack"
)
-IUSE="benchmark ${CPU_FEATURES_MAP[*]%:*} clang cuda hip debug doc lapack test ${IUSE_TEST_BACKENDS[*]}" #zvector
+IUSE="benchmark ${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 )"
@@ -93,6 +93,7 @@ BDEPEND="
dev-texlive/texlive-fontutils
dev-texlive/texlive-latex
dev-texlive/texlive-latexextra
+ mathjax? ( dev-libs/mathjax )
)
test? ( virtual/pkgconfig )
"
@@ -183,6 +184,10 @@ cuda_set_CUDAHOSTCXX() {
export CUDAHOSTCXX
}
+pkg_setup() {
+ use test && use cuda && use clang && llvm_pkg_setup
+}
+
src_unpack() {
if [[ ${PV} = *9999* ]] ; then
git-r3_src_unpack
@@ -199,21 +204,45 @@ src_unpack() {
src_prepare() {
cmake_src_prepare
- cmake_comment_add_subdirectory demos
+ 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" \
+ 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=(
- -DEIGEN_BUILD_BTL="$(usex benchmark)"
+ -DBUILD_SHARED_LIBS="yes"
+ -DBUILD_TESTING="$(usex test)"
+
+ -DEIGEN_BUILD_BTL="$(usex benchmark)" # Build benchmark suite
+ -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
@@ -221,9 +250,6 @@ src_configure() {
-DEIGEN_TEST_OPENGL="$(usex opengl)" # Enable OpenGL support in unit tests
-DEIGEN_TEST_OPENMP="$(usex openmp)" # Enable/Disable OpenMP in tests/examples
- # needs Qt4
- -DEIGEN_TEST_NOQT=yes # Disable Qt support in unit tests
-
-DCMAKE_DISABLE_FIND_PACKAGE_MPREAL=ON
# -DEIGEN_TEST_CUSTOM_CXX_FLAGS= # Additional compiler flags when compiling unit tests.
@@ -232,11 +258,6 @@ src_configure() {
# -DEIGEN_BUILD_BTL=yes # Build benchmark suite
- # -DEIGEN_INTERNAL_DOCUMENTATION=no # Build internal documentation
- # -DEIGEN_BUILD_DOC=yes # Enable creation of Eigen documentation
- # -DEIGEN_BUILD_PKGCONFIG=yes # Build pkg-config .pc file for Eigen
- # -DEIGEN_DOC_USE_MATHJAX=yes # Use MathJax for rendering math in HTML docs
-
-DEIGEN_TEST_BUILD_DOCUMENTATION="$(usex doc)" # Test building the doxygen documentation
# -DEIGEN_COVERAGE_TESTING=no # Enable/disable gcov
@@ -339,12 +360,12 @@ src_configure() {
if use cuda; then
cuda_add_sandbox -w
- export CUDAFLAGS="${NVCCFLAGS}"
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+=(
@@ -358,6 +379,8 @@ src_configure() {
NVCCFLAGS+=" -v"
fi
+ export CUDAFLAGS="${NVCCFLAGS}"
+
[[ -z "${CUDAARCHS}" ]] && einfo "trying to determine host CUDAARCHS"
: "${CUDAARCHS:=$(__nvcc_device_query)}"
export CUDAARCHS
diff --git a/dev-cpp/eigen/metadata.xml b/dev-cpp/eigen/metadata.xml
index 57571f41d055..6a83729afd0b 100644
--- a/dev-cpp/eigen/metadata.xml
+++ b/dev-cpp/eigen/metadata.xml
@@ -25,6 +25,7 @@
<flag name="cholmod">Add test support for CHOLMOD (<pkg>sci-libs/cholmod</pkg>)</flag>
<flag name="fftw">Add test support for fftw (<pkg>sci-libs/fftw</pkg>)</flag>
<flag name="klu">Add test support for KLU (<pkg>sci-libs/klu</pkg>)</flag>
+ <flag name="mathjax">Use MathJax for rendering math in HTML docs (dev-libs/mathjax)</flag>
<flag name="opengl">Add test support for OpenGL</flag>
<flag name="openmp">Add test support for the OpenMP (support parallel computing)</flag>
<flag name="pastix">Add test support for PaStiX (<pkg>sci-libs/pastix</pkg>)</flag>