Skip to content

Commit

Permalink
Merge pull request #39 from Pressio/rename-version-macros
Browse files Browse the repository at this point in the history
Clean up versioning
  • Loading branch information
fnrizzi authored Mar 5, 2025
2 parents 5074f92 + ca774bd commit abb0a03
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
12 changes: 6 additions & 6 deletions docs/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
:format: html

Configuration and Dependencies
=============================
==============================

Configuration
------------
-------------

.. tip::

Expand Down Expand Up @@ -34,16 +34,16 @@ Currently, the list of TPLs supported is shown below:
- Version Known to Work/run in CI
* - Eigen
- Required
- 3.3.7
- 3.4.0
* - Trilinos
- Optional
- commit: ef73d14babf6e7556b0420add98cce257ccaa56b
- commits: 0dc4553, 5bbda25
* - MPI
- Optional
- --
* - Kokkos
- Optional
- 3.1.0
- 4.4.01
* - BLAS
- Optional
- --
Expand All @@ -52,7 +52,7 @@ Currently, the list of TPLs supported is shown below:
- --
* - GoogleTest
- Optional
- 1.10.0
- 1.14.0

Eigen is the only required dependency because it is the
default choice for instantiating the ROM data structures
Expand Down
6 changes: 3 additions & 3 deletions include/pressio/ops_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
#ifndef PRESSIOOPS_OPS_MACROS_HPP
#define PRESSIOOPS_OPS_MACROS_HPP

#define PRESSIO_MAJOR_VERSION 0
#define PRESSIO_MINOR_VERSION 14
#define PRESSIO_PATCH_VERSION 0
#define PRESSIO_OPS_MAJOR_VERSION 0
#define PRESSIO_OPS_MINOR_VERSION 14
#define PRESSIO_OPS_PATCH_VERSION 0

// ----------------------------------------
// compiler version
Expand Down
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(macrosForCreatingUnitTests)
include(options)
include(colors)
include(version)

# ---------------------------------
# 1. find or get gtest
Expand Down
14 changes: 14 additions & 0 deletions tests/cmake/version.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# versioning
#=====================================================================
# adapted from Eigen
file(READ "${CMAKE_SOURCE_DIR}/include/pressio/ops_macros.hpp" _pressio_ops_macros)

string(REGEX MATCH "define[ \t]+PRESSIO_OPS_MAJOR_VERSION[ \t]+([0-9]+)" _pressio_major_version_match "${_pressio_ops_macros}")
set(PRESSIO_OPS_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+PRESSIO_OPS_MINOR_VERSION[ \t]+([0-9]+)" _pressio_minor_version_match "${_pressio_ops_macros}")
set(PRESSIO_OPS_MINOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+PRESSIO_OPS_PATCH_VERSION[ \t]+([0-9]+)" _pressio_patch_version_match "${_pressio_ops_macros}")
set(PRESSIO_OPS_PATCH_VERSION "${CMAKE_MATCH_1}")
set(PRESSIO_OPS_VERSION_NUMBER ${PRESSIO_OPS_MAJOR_VERSION}.${PRESSIO_OPS_MINOR_VERSION}.${PRESSIO_OPS_PATCH_VERSION})
message("${Magenta}>> PRESSIO-OPS: version = ${PRESSIO_OPS_VERSION_NUMBER} ${ColourReset}")
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version is defined in lines 52-54 of pressio/include/pressio/ops_macros.hpp
Version is defined in lines 52-54 of pressio-ops/include/pressio/ops_macros.hpp

0 comments on commit abb0a03

Please sign in to comment.