Skip to content

Commit

Permalink
Bump Eigen dependency to 3.4.0 (#176)
Browse files Browse the repository at this point in the history
* Bump Eigen dependency to 3.4.0

* Delete eigen-config-cmake.patch

Not needed anymore in version 3.4.0

* Bump CMake version

* Bump CMake version

* Use newer Docker image on CircleCI

* Fix CircleCI configuration
  • Loading branch information
robertodr committed Oct 8, 2021
1 parent 438926a commit 268d238
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 81 deletions.
45 changes: 10 additions & 35 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
version: 2

variables:
ubuntu-1804: &ubuntu-1804
ubuntu-2004: &ubuntu-2004
docker:
- image: mrchemsoft/circleci_ubuntu-18.04:0f3e70749f6e
- image: ghcr.io/mrchemsoft/metamr/circleci_ubuntu-20.04:sha-343e011
name: tsubame
user: merzbow
working_directory: ~/mrcpp
setup: &setup
run:
name: Set Python dependencies
command: |
if [[ "$PYTHON_VER" == "2" ]] ; then
pipenv install --two
else
pipenv install --three
fi
report: &report
run:
name: Report
command: |
pipenv run python --version
configure-serial: &configure-serial
run:
name: Configuring serial
shell: /bin/bash
command: |
pipenv run python setup \
python setup \
--type=release \
--cxx=g++ \
--cmake-options="-DCMAKE_C_COMPILER=gcc" \
Expand All @@ -36,7 +22,7 @@ variables:
name: Configuring OpenMP parallel
shell: /bin/bash
command: |
pipenv run python setup \
python setup \
--type=release \
--cxx=g++ \
--omp \
Expand All @@ -47,7 +33,7 @@ variables:
name: Configuring MPI parallel
shell: /bin/bash
command: |
pipenv run python setup \
python setup \
--type=release \
--cxx=mpicxx \
--mpi \
Expand All @@ -58,47 +44,36 @@ variables:
name: Building and installing
shell: /bin/bash
command: |
pipenv run cmake --build build --target install -- VERBOSE=1
cmake --build build --target install -- VERBOSE=1
tests: &tests
run:
name: Testing
shell: /bin/bash
command: |
cd build
pipenv run ctest --output-on-failure --verbose
ctest --output-on-failure --verbose
jobs:
serial-py3:
<<: *ubuntu-1804
environment:
- PYTHON_VER: '3'
<<: *ubuntu-2004
steps:
- checkout
- *setup
- *report
- *configure-serial
- *build
- *tests
omp-py3:
<<: *ubuntu-1804
<<: *ubuntu-2004
environment:
- PYTHON_VER: '3'
- OMP_NUM_THREADS: '2'
steps:
- checkout
- *setup
- *report
- *configure-omp
- *build
- *tests
mpi-py3:
<<: *ubuntu-1804
environment:
- PYTHON_VER: "3"
<<: *ubuntu-2004
steps:
- checkout
- *setup
- *report
- *configure-mpi
- *build
- *tests
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2015-2020 by Radovan Bast, Roberto Di Remigio, Jonas Juselius, and contributors.

# set minimum cmake version
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

# project name
project(MRCPP LANGUAGES CXX)
Expand Down
2 changes: 1 addition & 1 deletion cmake/autocmake.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: MRCPP
language: CXX
min_cmake_version: 3.11
min_cmake_version: 3.14
setup_script: setup
default_build_type: release

Expand Down
26 changes: 0 additions & 26 deletions external/upstream/eigen-config-cmake.patch

This file was deleted.

23 changes: 5 additions & 18 deletions external/upstream/fetch_eigen3.cmake
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
find_package(Eigen3 3.3 CONFIG QUIET
find_package(Eigen3 3.4 CONFIG QUIET
NO_CMAKE_PATH
NO_CMAKE_PACKAGE_REGISTRY
)

if(TARGET Eigen3::Eigen)
message(STATUS "Using Eigen3: ${EIGEN3_ROOT_DIR} (version ${Eigen3_VERSION})")
else()
message(STATUS "Suitable Eigen3 could not be located. Fetching and building!")
include(FetchContent)

FetchContent_Declare(eigen3_sources
FetchContent_Declare(eigen3
QUIET
URL
https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_LIST_DIR}/eigen-config-cmake.patch
https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz
)

FetchContent_GetProperties(eigen3_sources)

set(BUILD_TESTING OFF CACHE BOOL "" FORCE)

if(NOT eigen3_sources_POPULATED)
FetchContent_Populate(eigen3_sources)

add_subdirectory(
${eigen3_sources_SOURCE_DIR}
${eigen3_sources_BINARY_DIR}
)
endif()
# Provide an alias, so linking to Eigen looks the same regardless if it was
# found on the system or if it was fetched at configuration
add_library(Eigen3::Eigen ALIAS eigen)
FetchContent_MakeAvailable(eigen3)
endif()

0 comments on commit 268d238

Please sign in to comment.