Skip to content

Commit e8b917a

Browse files
committed
Set SOVERSION based on GFortran version
- Fixes #381 - No evidence of SONAME in CMake documentation... so not sure if/how/why to set this
1 parent d96e799 commit e8b917a

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/mpi/CMakeLists.txt

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,26 @@ add_library(caf_mpi_static STATIC mpi_caf.c ../common/caf_auxiliary.c $<TARGET_
132132
target_link_libraries(caf_mpi PRIVATE ${MPI_C_LIBRARIES} ${MPI_Fortran_LIBRARIES})
133133
target_link_libraries(caf_mpi_static PRIVATE ${MPI_C_LIBRARIES} ${MPI_Fortran_LIBRARIES})
134134

135+
set(CAF_SO_VERSION 0)
136+
if(gfortran_compiler)
137+
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)
138+
set(CAF_SO_VERSION 2)
139+
elseif(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0.0)
140+
set(CAF_SO_VERSION 1)
141+
endif()
142+
endif()
143+
135144
set_target_properties ( caf_mpi
136145
PROPERTIES
137-
SOVERSION ${PROJECT_VERSION.MAJOR}.${PROJECT_VERSION.MINOR}
138-
VERSION ${PROJECT_VERSION}
139-
)
146+
SOVERSION ${CAF_SO_VERSION}
147+
# VERSION ${PROJECT_VERSION}
148+
)
140149

150+
set_target_properties( caf_mpi_static
151+
PROPERTIES
152+
SOVERSION ${CAF_SO_VERSION}
153+
# VERSION ${PROJECT_VERSION}
154+
)
141155

142156
if (gfortran_compiler)
143157
target_compile_options(caf_mpi INTERFACE -fcoarray=lib)
@@ -154,9 +168,6 @@ install(TARGETS caf_mpi_static EXPORT OpenCoarraysTargets
154168
)
155169

156170

157-
############### FIXME!!!!! set_target_properties(caf_mpi PROPERTIES SOVERSION 1 SONAME "libcaf_mpi.so.${OpenCoarraysVersion}")
158-
159-
160171
##############################################
161172
# Configure `caf` and `cafrun` wrapper scripts
162173
##############################################

0 commit comments

Comments
 (0)