Fix failing builds and update CI on push.

Specifically:
- Fixed ctz on 32-bit arm (where `uint64_t` is `unsigned long long`)
- Fixed build of random_cpp11 snippet when C++11 is disabled
- Updated CI scripts to run windows on push, and added a no-c++11 test
This commit is contained in:
C. Antonio Sanchez 2025-02-16 22:13:29 -08:00
parent ab92609cad
commit 57c8d7c93f
7 changed files with 26 additions and 8 deletions

View File

@ -338,7 +338,7 @@ if (EIGEN_BUILD_TESTING)
check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CPP11) check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CPP11)
option(EIGEN_TEST_CXX11 "Enable testing with C++11 and C++11 features (e.g. Tensor module)." EIGEN_COMPILER_SUPPORT_CPP11) option(EIGEN_TEST_CXX11 "Enable testing with C++11 and C++11 features (e.g. Tensor module)." ${EIGEN_COMPILER_SUPPORT_CPP11})
if(EIGEN_TEST_CXX11) if(EIGEN_TEST_CXX11)
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)

View File

@ -170,10 +170,8 @@ template<> struct is_integral<signed int> { enum { value = true }; }
template<> struct is_integral<unsigned int> { enum { value = true }; }; template<> struct is_integral<unsigned int> { enum { value = true }; };
template<> struct is_integral<signed long> { enum { value = true }; }; template<> struct is_integral<signed long> { enum { value = true }; };
template<> struct is_integral<unsigned long> { enum { value = true }; }; template<> struct is_integral<unsigned long> { enum { value = true }; };
#if EIGEN_COMP_MSVC template<> struct is_integral<signed long long> { enum { value = true }; };
template<> struct is_integral<signed __int64> { enum { value = true }; }; template<> struct is_integral<unsigned long long> { enum { value = true }; };
template<> struct is_integral<unsigned __int64> { enum { value = true }; };
#endif
#endif #endif
#if EIGEN_HAS_CXX11 #if EIGEN_HAS_CXX11

View File

@ -48,6 +48,11 @@ build:linux:cross:x86-64:gcc-10:default:
EIGEN_CI_CROSS_C_COMPILER: x86_64-linux-gnu-gcc-10 EIGEN_CI_CROSS_C_COMPILER: x86_64-linux-gnu-gcc-10
EIGEN_CI_CROSS_CXX_COMPILER: x86_64-linux-gnu-g++-10 EIGEN_CI_CROSS_CXX_COMPILER: x86_64-linux-gnu-g++-10
build:linux:cross:x86-64:gcc-10:cxx03:
extends: build:linux:cross:x86-64:gcc-10:default
variables:
EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_CXX11=off"
build:linux:cross:x86-64:gcc-10:avx: build:linux:cross:x86-64:gcc-10:avx:
extends: build:linux:cross:x86-64:gcc-10:default extends: build:linux:cross:x86-64:gcc-10:default
variables: variables:

View File

@ -16,6 +16,7 @@
rules: rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_NAMESPACE == "libeigen" - if: $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_NAMESPACE == "libeigen"
- if: $CI_PIPELINE_SOURCE == "web" && $CI_PROJECT_NAMESPACE == "libeigen" - if: $CI_PIPELINE_SOURCE == "web" && $CI_PROJECT_NAMESPACE == "libeigen"
- if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_NAMESPACE == "libeigen"
cache: cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG-BUILD" key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG-BUILD"
paths: paths:
@ -37,6 +38,11 @@ build:windows:x86-64:msvc-14.29:default:
variables: variables:
EIGEN_CI_MSVC_VER: "14.29" EIGEN_CI_MSVC_VER: "14.29"
build:windows:x86-64:msvc-14.29:cxx03:
extends: build:windows:x86-64:msvc-14.29:default
variables:
EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_CXX11=off"
build:windows:x86-64:msvc-14.29:avx2: build:windows:x86-64:msvc-14.29:avx2:
extends: build:windows:x86-64:msvc-14.29:default extends: build:windows:x86-64:msvc-14.29:default
variables: variables:

View File

@ -46,6 +46,10 @@ test:linux:x86-64:gcc-6:default:unsupported:
variables: variables:
EIGEN_CI_INSTALL: g++-10 EIGEN_CI_INSTALL: g++-10
test:linux:x86-64:gcc-10:cxx03:
extends: .test:linux:x86-64:gcc-10:default
needs: [ build:linux:cross:x86-64:gcc-10:cxx03 ]
test:linux:x86-64:gcc-10:default:official: test:linux:x86-64:gcc-10:default:official:
extends: .test:linux:x86-64:gcc-10:default extends: .test:linux:x86-64:gcc-10:default
variables: variables:

View File

@ -6,8 +6,9 @@
after_script: after_script:
- ./ci/scripts/test.windows.after_script.ps1 - ./ci/scripts/test.windows.after_script.ps1
rules: rules:
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_NAMESPACE == "libeigen"
- if: $CI_PIPELINE_SOURCE == "web" - if: $CI_PIPELINE_SOURCE == "web" && $CI_PROJECT_NAMESPACE == "libeigen"
- if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_NAMESPACE == "libeigen"
tags: tags:
- eigen-runner - eigen-runner
- windows - windows
@ -35,6 +36,10 @@ test:windows:x86-64:msvc-14.16:default:unsupported:
extends: .test:windows extends: .test:windows
needs: [ build:windows:x86-64:msvc-14.29:default ] needs: [ build:windows:x86-64:msvc-14.29:default ]
test:windows:x86-64:msvc-14.29:default:official:
extends: .test:windows:x86-64:msvc-14.29:default
needs: [ build:windows:x86-64:msvc-14.29:cxx03 ]
test:windows:x86-64:msvc-14.29:default:official: test:windows:x86-64:msvc-14.29:default:official:
extends: .test:windows:x86-64:msvc-14.29:default extends: .test:windows:x86-64:msvc-14.29:default
variables: variables:

View File

@ -21,7 +21,7 @@ endif()
if(EIGEN_COMPILER_SUPPORT_CPP11) if(EIGEN_COMPILER_SUPPORT_CPP11)
add_executable(random_cpp11 random_cpp11.cpp) add_executable(random_cpp11 random_cpp11.cpp)
target_link_libraries(random_cpp11 ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) target_link_libraries(random_cpp11 ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO} Eigen3::Eigen)
add_dependencies(all_examples random_cpp11) add_dependencies(all_examples random_cpp11)
target_compile_options(random_cpp11 PRIVATE "-std=c++11") target_compile_options(random_cpp11 PRIVATE "-std=c++11")