Skip to content

Commit 31e82e8

Browse files
committed
set project version and shared library soname
Set the ScaLAPACK project version in a single place, at the project command in CMakeLists.txt. This defines SCALAPACK_VERSION, from which cmake derives SCALAPACK_VERSION_MAJOR, SCALAPACK_VERSION_MINOR, SCALAPACK_VERSION_PATCH Use SCALAPACK_VERSION as the shared library VERSION (defining the shared library file as libscalapack.so.2.2.1) and use SCALAPACK_VERSION_MAJOR.SCALAPACK_VERSION_MINOR as the shared library SOVERSION (defining the soname as libscalapack.so.2.2) That is, assume that the ABI updates with each MINOR release and reflect that in the soname. An API update (and therefore an ABI update) would be expected with any MAJOR release. No ABI update should occur with a PATCH release. Closes: #46
1 parent 0128dc2 commit 31e82e8

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

CMakeLists.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
cmake_minimum_required(VERSION 3.2)
2-
project(SCALAPACK C Fortran)
2+
3+
project(SCALAPACK VERSION 2.2.1 LANGUAGES C Fortran)
4+
35
# Configure the warning and code coverage suppression file
46
configure_file(
57
"${SCALAPACK_SOURCE_DIR}/CMAKE/CTestCustom.cmake.in"
@@ -232,13 +234,22 @@ append_subdir_files(src-C "SRC")
232234

233235
if (UNIX)
234236
add_library(scalapack ${blacs} ${tools} ${tools-C} ${extra_lapack} ${pblas} ${pblas-F} ${ptzblas} ${ptools} ${pbblas} ${redist} ${src} ${src-C})
237+
set_target_properties(scalapack PROPERTIES
238+
VERSION ${SCALAPACK_VERSION}
239+
SOVERSION ${SCALAPACK_VERSION_MAJOR}.${SCALAPACK_VERSION_MINOR})
235240
target_link_libraries( scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
236241
scalapack_install_library(scalapack)
237242
else (UNIX) # Need to separate Fortran and C Code
238243
OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON )
239244
add_library(scalapack ${blacs} ${tools-C} ${pblas} ${ptools} ${redist} ${src-C})
245+
set_target_properties(scalapack PROPERTIES
246+
VERSION ${SCALAPACK_VERSION}
247+
SOVERSION ${SCALAPACK_VERSION_MAJOR}.${SCALAPACK_VERSION_MINOR})
240248
target_link_libraries( scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
241249
add_library(scalapack-F ${pblas-F} ${pbblas} ${ptzblas} ${tools} ${src} ${extra_lapack} )
250+
set_target_properties(scalapack-F PROPERTIES
251+
VERSION ${SCALAPACK_VERSION}
252+
SOVERSION ${SCALAPACK_VERSION_MAJOR}.${SCALAPACK_VERSION_MINOR})
242253
target_link_libraries( scalapack-F ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
243254
scalapack_install_library(scalapack)
244255
scalapack_install_library(scalapack-F)
@@ -255,10 +266,9 @@ endif()
255266
SET(CPACK_PACKAGE_NAME "ScaLAPACK")
256267
SET(CPACK_PACKAGE_VENDOR "University of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd")
257268
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ScaLAPACK- Linear Algebra Package")
258-
set(SCALAPACK_VERSION 2.1.0)
259-
set(CPACK_PACKAGE_VERSION_MAJOR 2)
260-
set(CPACK_PACKAGE_VERSION_MINOR 1)
261-
set(CPACK_PACKAGE_VERSION_PATCH 0)
269+
set(CPACK_PACKAGE_VERSION_MAJOR ${SCALAPACK_VERSION_MAJOR})
270+
set(CPACK_PACKAGE_VERSION_MINOR ${SCALAPACK_VERSION_MINOR})
271+
set(CPACK_PACKAGE_VERSION_PATCH ${SCALAPACK_VERSION_PATCH})
262272
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
263273
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "SCALAPACK")
264274
IF(WIN32 AND NOT UNIX)

0 commit comments

Comments
 (0)