@@ -26,6 +26,8 @@ target_compile_options(opencoarrays_mod
26
26
target_link_libraries (opencoarrays_mod
27
27
PUBLIC ${MPI_Fortran_LINK_FLAGS}
28
28
PUBLIC ${MPI_Fortran_LIBRARIES} )
29
+ target_link_libraries (opencoarrays_mod
30
+ PUBLIC caf_mpi_static )
29
31
target_include_directories (opencoarrays_mod PUBLIC
30
32
$< $< COMPILE_LANGUAGE:Fortran> :${MPI_Fortran_INCLUDE_PATH} >
31
33
$< BUILD_INTERFACE:${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_INCLUDEDIR} /${mod_dir_tail} >
@@ -35,12 +37,10 @@ add_library(caf_mpi SHARED mpi_caf.c ../common/caf_auxiliary.c)
35
37
add_library (caf_mpi_static STATIC mpi_caf.c ../common/caf_auxiliary.c )
36
38
target_link_libraries (caf_mpi
37
39
PUBLIC ${MPI_C_LINK_FLAGS}
38
- PUBLIC ${MPI_C_LIBRARIES}
39
- PRIVATE opencoarrays_mod )
40
+ PUBLIC ${MPI_C_LIBRARIES} )
40
41
target_link_libraries (caf_mpi_static
41
42
PUBLIC ${MPI_C_LINK_FLAGS}
42
- PUBLIC ${MPI_C_LIBRARIES}
43
- PRIVATE opencoarrays_mod )
43
+ PUBLIC ${MPI_C_LIBRARIES} )
44
44
set_target_properties (caf_mpi_static
45
45
PROPERTIES
46
46
POSITION_INDEPENDENT_CODE TRUE )
@@ -83,7 +83,7 @@ if(UNIX)
83
83
endif ()
84
84
85
85
install (DIRECTORY "${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_INCLUDEDIR} /" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} "
86
- FILES_MATCHING PATTERN "* .mod" )
86
+ FILES_MATCHING PATTERN "opencoarrays .mod" )
87
87
88
88
set_target_properties ( caf_mpi_static
89
89
PROPERTIES
@@ -92,22 +92,15 @@ set_target_properties( caf_mpi_static
92
92
)
93
93
94
94
if (gfortran_compiler )
95
- target_compile_options (caf_mpi INTERFACE $< $< COMPILE_LANGUAGE:Fortran> :" -fcoarray=lib" > )
96
- target_compile_options (caf_mpi_static INTERFACE $< $< COMPILE_LANGUAGE:Fortran> :" -fcoarray=lib" > )
95
+ target_compile_options (caf_mpi INTERFACE $< $< COMPILE_LANGUAGE:Fortran> :-fcoarray=lib> )
96
+ target_compile_options (caf_mpi_static INTERFACE $< $< COMPILE_LANGUAGE:Fortran> :-fcoarray=lib> )
97
97
endif ()
98
98
99
- install (TARGETS opencoarrays_mod EXPORT OpenCoarraysTargets
100
- DESTINATION "${CMAKE_INSTALL_LIBDIR} "
101
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR} "
102
- )
103
- install (TARGETS caf_mpi EXPORT OpenCoarraysTargets
99
+ install (TARGETS opencoarrays_mod caf_mpi caf_mpi_static EXPORT OpenCoarraysTargets
104
100
DESTINATION "${CMAKE_INSTALL_LIBDIR} "
105
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR} "
106
- )
107
- install (TARGETS caf_mpi_static EXPORT OpenCoarraysTargets
108
101
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR} "
109
102
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR} "
110
- )
103
+ )
111
104
112
105
#----------------------------------
113
106
# Determine if we're using Open MPI
@@ -134,12 +127,14 @@ elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "PGI")
134
127
endif ()
135
128
136
129
if (gfortran_compiler AND (NOT opencoarrays_aware_compiler ))
137
- target_compile_definitions (opencoarrays_mod PUBLIC -DCOMPILER_SUPPORTS_CAF_INTRINSICS )
130
+ target_compile_definitions (opencoarrays_mod
131
+ PUBLIC -DCOMPILER_SUPPORTS_CAF_INTRINSICS )
138
132
endif ()
139
133
140
134
option (CAF_EXPOSE_INIT_FINALIZE "Expose caf_init and caf_finalize in opencoarrays module" FALSE )
141
135
if (CAF_EXPOSE_INIT_FINALIZE )
142
- target_compile_definitions (opencoarrays_mod PRIVATE -DEXPOSE_INIT_FINALIZE )
136
+ target_compile_definitions (opencoarrays_mod
137
+ PRIVATE -DEXPOSE_INIT_FINALIZE )
143
138
endif ()
144
139
145
140
include (CheckIncludeFile )
0 commit comments