diff options
| author | Paul Zander <negril.nx+gentoo@gmail.com> | 2023-12-10 14:30:23 +0100 |
|---|---|---|
| committer | Sam James <sam@gentoo.org> | 2024-01-20 13:02:02 +0000 |
| commit | b450729745055e29dd0a75346cf209a4a2e17a0b (patch) | |
| tree | 787418867a2422806abb73bb17991c85c828bd0c /dev-cpp/eigen/files | |
| parent | d9d675eacf52ef7ba2d980478780453b2c8b7f60 (diff) | |
| download | gentoo-b450729745055e29dd0a75346cf209a4a2e17a0b.tar.gz gentoo-b450729745055e29dd0a75346cf209a4a2e17a0b.tar.bz2 gentoo-b450729745055e29dd0a75346cf209a4a2e17a0b.zip | |
dev-cpp/eigen: add 3.4.0-r2, 3.4.9999, 9999 with fixed cuda tests
Automatically detects working compiler.
Automatically detects host CUDA arch, can be overriden by setting CUDAARCHS env var.
Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/34547
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-cpp/eigen/files')
4 files changed, 207 insertions, 0 deletions
diff --git a/dev-cpp/eigen/files/eigen-3.4.0-buildstring.patch b/dev-cpp/eigen/files/eigen-3.4.0-buildstring.patch new file mode 100644 index 000000000000..cb3671dc0100 --- /dev/null +++ b/dev-cpp/eigen/files/eigen-3.4.0-buildstring.patch @@ -0,0 +1,27 @@ +--- a/cmake/EigenTesting.cmake ++++ b/cmake/EigenTesting.cmake +@@ -559,14 +559,22 @@ macro(ei_get_cxxflags VAR) + set(${VAR} VSX) + elseif(EIGEN_TEST_ALTIVEC) + set(${VAR} ALVEC) +- elseif(EIGEN_TEST_FMA) +- set(${VAR} FMA) ++ elseif(EIGEN_TEST_AVX512DQ) ++ set(${VAR} AVX512DQ) ++ elseif(EIGEN_TEST_AVX512) ++ set(${VAR} AVX512) ++ elseif(EIGEN_TEST_AVX2) ++ set(${VAR} AVX2) ++ elseif(EIGEN_TEST_F16C) ++ set(${VAR} F16C) + elseif(EIGEN_TEST_AVX) + set(${VAR} AVX) + elseif(EIGEN_TEST_SSE4_2) + set(${VAR} SSE42) + elseif(EIGEN_TEST_SSE4_1) + set(${VAR} SSE41) ++ elseif(EIGEN_TEST_FMA) ++ set(${VAR} FMA) + elseif(EIGEN_TEST_SSSE3) + set(${VAR} SSSE3) + elseif(EIGEN_TEST_SSE3) diff --git a/dev-cpp/eigen/files/eigen-3.4.0-cxxstandard.patch b/dev-cpp/eigen/files/eigen-3.4.0-cxxstandard.patch new file mode 100644 index 000000000000..826aa78d05aa --- /dev/null +++ b/dev-cpp/eigen/files/eigen-3.4.0-cxxstandard.patch @@ -0,0 +1,108 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -74,19 +74,9 @@ macro(ei_add_cxx_compiler_flag FLAG) + endif() + endmacro() + +-check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CPP11) +- +-if(EIGEN_TEST_CXX11) +- set(CMAKE_CXX_STANDARD 11) +- set(CMAKE_CXX_EXTENSIONS OFF) +- if(EIGEN_COMPILER_SUPPORT_CPP11) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +- endif() +-else() +- #set(CMAKE_CXX_STANDARD 03) +- #set(CMAKE_CXX_EXTENSIONS OFF) +- ei_add_cxx_compiler_flag("-std=c++03") +-endif() ++set(CMAKE_CXX_STANDARD 14) ++set(CMAKE_CXX_STANDARD_REQUIRED TRUE) ++set(CMAKE_CXX_EXTENSIONS OFF) + + # Determine if we should build shared libraries on this platform. + get_cmake_property(EIGEN_BUILD_SHARED_LIBS TARGET_SUPPORTS_SHARED_LIBS) +@@ -157,7 +157,6 @@ if(NOT MSVC) + ei_add_cxx_compiler_flag("-Wshorten-64-to-32") + ei_add_cxx_compiler_flag("-Wlogical-op") + ei_add_cxx_compiler_flag("-Wenum-conversion") +- ei_add_cxx_compiler_flag("-Wc++11-extensions") + ei_add_cxx_compiler_flag("-Wdouble-promotion") + # ei_add_cxx_compiler_flag("-Wconversion") + +--- a/Eigen/src/Core/util/Macros.h ++++ b/Eigen/src/Core/util/Macros.h +@@ -37,7 +37,7 @@ + // Expected values are 03, 11, 14, 17, etc. + // By default, let's use an arbitrarily large C++ version. + #ifndef EIGEN_MAX_CPP_VER +-#define EIGEN_MAX_CPP_VER 99 ++#define EIGEN_MAX_CPP_VER 14 + #endif + + /** Allows to disable some optimizations which might affect the accuracy of the result. +--- a/doc/examples/CMakeLists.txt ++++ b/doc/examples/CMakeLists.txt +@@ -14,7 +14,3 @@ foreach(example_src ${examples_SRCS}) + ) + add_dependencies(all_examples ${example}) + endforeach() +- +-if(EIGEN_COMPILER_SUPPORT_CPP11) +-ei_add_target_property(nullary_indexing COMPILE_FLAGS "-std=c++11") +-endif() +\ No newline at end of file +diff --git a/doc/snippets/CMakeLists.txt b/doc/snippets/CMakeLists.txt +index 65f195a..4cb18c8 100644 +--- a/doc/snippets/CMakeLists.txt ++++ b/doc/snippets/CMakeLists.txt +@@ -15,9 +15,6 @@ foreach(snippet_src ${snippets_SRCS}) + if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) + target_link_libraries(${compile_snippet_target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) + endif() +- if(${snippet_src} MATCHES "cxx11") +- set_target_properties(${compile_snippet_target} PROPERTIES COMPILE_FLAGS "-std=c++11") +- endif() + if(${snippet_src} MATCHES "deprecated") + set_target_properties(${compile_snippet_target} PROPERTIES COMPILE_FLAGS "-DEIGEN_NO_DEPRECATED_WARNING") + endif() +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -399,7 +399,6 @@ if(CUDA_FOUND) + set(CUDA_NVCC_FLAGS "-ccbin ${CMAKE_C_COMPILER}" CACHE STRING "nvcc flags" FORCE) + endif() + if(EIGEN_TEST_CUDA_CLANG) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + string(APPEND CMAKE_CXX_FLAGS " --cuda-path=${CUDA_TOOLKIT_ROOT_DIR}") + foreach(GPU IN LISTS EIGEN_CUDA_COMPUTE_ARCH) + string(APPEND CMAKE_CXX_FLAGS " --cuda-gpu-arch=sm_${GPU}") +--- a/unsupported/test/CMakeLists.txt ++++ b/unsupported/test/CMakeLists.txt +@@ -59,7 +59,7 @@ find_package(MPREAL) + if(MPREAL_FOUND AND EIGEN_COMPILER_SUPPORT_CPP11) + ei_add_property(EIGEN_TESTED_BACKENDS "MPFR C++, ") + include_directories(${MPREAL_INCLUDES}) +- ei_add_test(mpreal_support "-std=c++11" "${MPREAL_LIBRARIES}" ) ++ ei_add_test(mpreal_support "-std=c++14" "${MPREAL_LIBRARIES}" ) + else() + ei_add_property(EIGEN_MISSING_BACKENDS "MPFR C++, ") + endif() +@@ -308,7 +308,6 @@ if(CUDA_FOUND AND EIGEN_TEST_CUDA) + set(CUDA_NVCC_FLAGS "-ccbin ${CMAKE_C_COMPILER}" CACHE STRING "nvcc flags" FORCE) + endif() + if(EIGEN_TEST_CUDA_CLANG) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + string(APPEND CMAKE_CXX_FLAGS " --cuda-path=${CUDA_TOOLKIT_ROOT_DIR}") + foreach(ARCH IN LISTS EIGEN_CUDA_COMPUTE_ARCH) + string(APPEND CMAKE_CXX_FLAGS " --cuda-gpu-arch=sm_${ARCH}") +--- a/doc/special_examples/CMakeLists.txt ++++ b/doc/special_examples/CMakeLists.txt +@@ -23,7 +23,6 @@ if(EIGEN_COMPILER_SUPPORT_CPP11) + add_executable(random_cpp11 random_cpp11.cpp) + target_link_libraries(random_cpp11 ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) + add_dependencies(all_examples random_cpp11) +- ei_add_target_property(random_cpp11 COMPILE_FLAGS "-std=c++11") + + add_custom_command( + TARGET random_cpp11 diff --git a/dev-cpp/eigen/files/eigen-3.4.0-noansi.patch b/dev-cpp/eigen/files/eigen-3.4.0-noansi.patch new file mode 100644 index 000000000000..c0ce44445c1d --- /dev/null +++ b/dev-cpp/eigen/files/eigen-3.4.0-noansi.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -184,6 +184,7 @@ if(NOT MSVC) + ei_add_cxx_compiler_flag("-wd2304") # disable ICC's "warning #2304: non-explicit constructor with single argument may cause implicit type conversion" produced by -Wnon-virtual-dtor + + ++ if(NOT EIGEN_TEST_CXX11) + # The -ansi flag must be added last, otherwise it is also used as a linker flag by check_cxx_compiler_flag making it fails + # Moreover we should not set both -strict-ansi and -ansi + check_cxx_compiler_flag("-strict-ansi" COMPILER_SUPPORT_STRICTANSI) +@@ -194,6 +195,7 @@ if(NOT MSVC) + else() + ei_add_cxx_compiler_flag("-ansi") + endif() ++ endif() + + if(ANDROID_NDK) + ei_add_cxx_compiler_flag("-pie") diff --git a/dev-cpp/eigen/files/eigen-9999-please_protect_your_min_with_parentheses.patch b/dev-cpp/eigen/files/eigen-9999-please_protect_your_min_with_parentheses.patch new file mode 100644 index 000000000000..0453fd33a8ae --- /dev/null +++ b/dev-cpp/eigen/files/eigen-9999-please_protect_your_min_with_parentheses.patch @@ -0,0 +1,54 @@ +diff --git a/test/main.h b/test/main.h +index 771725f06..df22e12f6 100644 +--- a/test/main.h ++++ b/test/main.h +@@ -86,32 +86,6 @@ + #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int + #endif + +-// To test that all calls from Eigen code to std::min() and std::max() are +-// protected by parenthesis against macro expansion, the min()/max() macros +-// are defined here and any not-parenthesized min/max call will cause a +-// compiler error. +-#if !defined(__HIPCC__) && !defined(EIGEN_USE_SYCL) && !defined(EIGEN_POCKETFFT_DEFAULT) +-// +-// HIP header files include the following files +-// <thread> +-// <regex> +-// <unordered_map> +-// which seem to contain not-parenthesized calls to "max"/"min", triggering the following check and causing the compile +-// to fail +-// +-// Including those header files before the following macro definition for "min" / "max", only partially resolves the +-// issue This is because other HIP header files also define "isnan" / "isinf" / "isfinite" functions, which are needed +-// in other headers. +-// +-// So instead choosing to simply disable this check for HIP +-// +-#define min(A, B) please_protect_your_min_with_parentheses +-#define max(A, B) please_protect_your_max_with_parentheses +-#define isnan(X) please_protect_your_isnan_with_parentheses +-#define isinf(X) please_protect_your_isinf_with_parentheses +-#define isfinite(X) please_protect_your_isfinite_with_parentheses +-#endif +- + // test possible conflicts + struct real {}; + struct imag {}; +diff --git a/test/main.h b/test/main.h +index df22e12f6..5ca40424e 100644 +--- a/test/main.h ++++ b/test/main.h +@@ -95,12 +95,6 @@ struct imag {}; + #endif + #define M_PI please_use_EIGEN_PI_instead_of_M_PI + +-#define FORBIDDEN_IDENTIFIER \ +- (this_identifier_is_forbidden_to_avoid_clashes) this_identifier_is_forbidden_to_avoid_clashes +-// B0 is defined in POSIX header termios.h +-#define B0 FORBIDDEN_IDENTIFIER +-#define I FORBIDDEN_IDENTIFIER +- + // _res is defined by resolv.h + #define _res FORBIDDEN_IDENTIFIER + |
