From 3126b586b8771a3896adbff26f2a28ea8eb1e2a8 Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Mon, 15 Jan 2024 12:28:23 +0100 Subject: [PATCH 1/2] Feature soversion: grab from configuration file --- CMakeLists.txt | 2 +- cmake/config.cmake | 7 +++++++ config/p4est_soversion.in | 7 +++++++ src/Makefile.am | 5 ++++- 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 config/p4est_soversion.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 276cbf987..7a6fbb035 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ include(cmake/compilers.cmake) add_library(p4est) set_property(TARGET p4est PROPERTY EXPORT_NAME P4EST) -set_property(TARGET p4est PROPERTY VERSION ${PROJECT_VERSION}) +set_property(TARGET p4est PROPERTY SOVERSION ${P4EST_SOVERSION}) target_include_directories(p4est PUBLIC $ $ diff --git a/cmake/config.cmake b/cmake/config.cmake index 1cf5a4580..1b7577d52 100644 --- a/cmake/config.cmake +++ b/cmake/config.cmake @@ -2,6 +2,13 @@ include(CheckIncludeFile) include(CheckSymbolExists) include(ProcessorCount) +# --- retrieve library interface version from configuration file +file(STRINGS config/p4est_soversion.in P4EST_SOVERSION_READ + REGEX "^[ \t]*P4EST_SOVERSION *= *[0-9:]+") +string(REGEX REPLACE ".*= *([0-9]+):([0-9]+):([0-9]+)" "\\1.\\2.\\3" + P4EST_SOVERSION ${P4EST_SOVERSION_READ}) +message(STATUS "p4est SOVERSION configured as ${P4EST_SOVERSION}") + # on some platforms e.g. ARM, we have to try a few ways to get CPU count > 1 for multi-core systems cmake_host_system_information(RESULT Ncpu QUERY NUMBER_OF_PHYSICAL_CORES) if(Ncpu LESS 2) diff --git a/config/p4est_soversion.in b/config/p4est_soversion.in new file mode 100644 index 000000000..68a68b634 --- /dev/null +++ b/config/p4est_soversion.in @@ -0,0 +1,7 @@ +# This file contains p4est's .so version in libtool format; see: +# https://www.gnu.org/software/libtool/manual/libtool.html#Versioning +# The format is P4EST_SOVERSION = current:revision:age (note the colons) + +# This file is included by src/Makefile.am and parsed by cmake/config.cmake. + +P4EST_SOVERSION = 2:0:0 diff --git a/src/Makefile.am b/src/Makefile.am index dcf6dfde4..f29ab5128 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -74,6 +74,9 @@ endif # this variable is used for headers that are not publicly installed P4EST_CPPFLAGS = +# read the .so version from configuration file +include config/p4est_soversion.in + justlibs-local: src/libp4est.la lib_LTLIBRARIES += src/libp4est.la src_libp4est_la_SOURCES = \ @@ -82,7 +85,7 @@ src_libp4est_la_SOURCES = \ src_libp4est_la_CPPFLAGS = $(AM_CPPFLAGS) $(P4EST_CPPFLAGS) ## This is the official API versioning scheme of libtool. Please see: ## Read https://www.gnu.org/software/libtool/manual/libtool.html#Versioning -src_libp4est_la_LDFLAGS = -version-info 2:0:0 +src_libp4est_la_LDFLAGS = -version-info $(P4EST_SOVERSION) src_libp4est_la_LIBADD = @P4EST_SC_LIBADD@ EXTRA_src_libp4est_la_DEPENDENCIES = @P4EST_SC_EDEPS@ From 49ef7b14313761ca2abeb9b63a2aad3dc9248638 Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Mon, 15 Jan 2024 12:28:39 +0100 Subject: [PATCH 2/2] p4est CI: increase runtime for cmake/macos matrix --- .github/workflows/ci_cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cmake.yml b/.github/workflows/ci_cmake.yml index 0221adfef..f68a7a6b8 100644 --- a/.github/workflows/ci_cmake.yml +++ b/.github/workflows/ci_cmake.yml @@ -100,7 +100,7 @@ jobs: mac: runs-on: macos-latest name: CMake build on MacOS - timeout-minutes: 20 + timeout-minutes: 25 strategy: matrix: