Skip to content

Commit

Permalink
[cmake] Require either TRIQS 3.2 or 3.3
Browse files Browse the repository at this point in the history
Also bump required CMake version to 3.19 as it is needed for version
range specifications in `find_package()`.
  • Loading branch information
krivenko committed Jun 4, 2024
1 parent 141c526 commit ec0f0f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
git clone https://github.com/TRIQS/triqs --branch 3.2.x
git clone https://github.com/TRIQS/triqs --branch 3.3.x
mkdir triqs/build && pushd triqs/build
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
Expand Down
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
# CMake scripts are based on the 'app4triqs' TRIQS application skeleton.
# See https://github.com/TRIQS/app4triqs for more details.

cmake_minimum_required(VERSION 3.12.4 FATAL_ERROR)
cmake_policy(VERSION 3.12.4)
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
cmake_policy(VERSION 3.19)
if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()
Expand All @@ -36,8 +36,11 @@ get_directory_property(IS_SUBPROJECT PARENT_DIRECTORY)

# ############
# Load TRIQS
set(REQUIRED_TRIQS_VERSION 3.2)
find_package(TRIQS ${REQUIRED_TRIQS_VERSION} REQUIRED)
set(REQUIRED_TRIQS_VERSION_MIN 3.2)
set(REQUIRED_TRIQS_VERSION_MAX 3.3)
find_package(TRIQS
${REQUIRED_TRIQS_VERSION_MIN}...${REQUIRED_TRIQS_VERSION_MAX}
REQUIRED)

# Get the git hash & print status
triqs_get_git_hash_of_source_dir(PROJECT_GIT_HASH)
Expand Down Expand Up @@ -185,7 +188,7 @@ if(BUILD_DEBIAN_PACKAGE AND NOT IS_SUBPROJECT)
execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CMAKE_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "triqs (>= ${REQUIRED_TRIQS_VERSION})")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "triqs (>= ${REQUIRED_TRIQS_VERSION_MIN})")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
include(CPack)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM flatironinstitute/triqs:3.2.0 as base
FROM flatironinstitute/triqs:3.3.0 as base
LABEL maintainer="Igor Krivenko <[email protected]>"
LABEL description="Stochastic Optimization Method for Analytic Continuation"
ARG APPNAME=som
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SOM 2.x offers new features, including the more advanced SOCC ([stochastic
optimization with consistent constraints](
https://doi.org/10.1103/PhysRevB.95.014102)) analytic continuation protocol.

SOM uses the TRIQS library version 3.2.x. The TRIQS website is under
SOM uses the TRIQS library version 3.2.x or 3.3.x. The TRIQS website is under
<https://triqs.github.io/triqs/>. Start there to learn about TRIQS.

**Legacy SOM versions 1.x are based on TRIQS 1.4.2. The 1.x source code is still
Expand Down

0 comments on commit ec0f0f5

Please sign in to comment.