@@ -87,38 +87,47 @@ else()
87
87
endif ()
88
88
endif ()
89
89
90
-
91
- include (CheckFortranSourceCompiles.cmake )
90
+ if (gfortran_compiler )
91
+ set (CMAKE_REQUIRED_FLAGS "-fcoarray=single" )
92
+ endif ()
93
+ include (CheckFortranSourceCompiles )
92
94
CHECK_Fortran_SOURCE_COMPILES ("
93
95
program main
94
96
implicit none
95
97
integer :: i
96
98
i = this_image()
97
99
end program
98
100
" Check_Simple_Coarray_Fortran_Source_Compiles )
101
+ if (gfortran_compiler )
102
+ unset (CMAKE_REQUIRED_FLAGS )
103
+ endif ()
99
104
100
105
include_directories (${CMAKE_CURRENT_SOURCE_DIR} /src )
101
106
102
107
add_subdirectory (src )
103
108
add_subdirectory (install_prerequisites )
104
109
110
+ #-----------------------------------------------------
111
+ # Publicize installed location to other CMake projects
112
+ #-----------------------------------------------------
105
113
install (EXPORT OpenCoarraysTargets
106
114
NAMESPACE
107
115
OpenCoarrays::
108
116
DESTINATION
109
117
lib/cmake/opencoarrays
110
118
)
111
- include (CMakePackageConfigHelpers )
119
+ include (CMakePackageConfigHelpers ) # standard CMake module
112
120
write_basic_package_version_file (
113
121
"${CMAKE_CURRENT_BINARY_DIR} /OpenCoarraysConfigVersion.cmake"
114
- VERSION 1.0
122
+ VERSION " ${opencoarrays_VERSION} "
115
123
COMPATIBILITY AnyNewerVersion
116
124
)
117
- configure_file (OpenCoarraysConfig.cmake.in CMakeFiles/OpenCoarraysConfig.cmake @ONLY )
125
+ configure_file ("${CMAKE_SOURCE_DIR} /cmake/pkg/OpenCoarraysConfig.cmake.in"
126
+ "${CMAKE_CURRENT_BINARY_DIR} /CMakeFiles/OpenCoarraysConfig.cmake" @ONLY )
118
127
119
128
install (
120
129
FILES
121
- ${CMAKE_CURRENT_BINARY_DIR} /CMakeFiles/OpenCoarraysConfig.cmake
130
+ " ${CMAKE_CURRENT_BINARY_DIR} /CMakeFiles/OpenCoarraysConfig.cmake"
122
131
"${CMAKE_CURRENT_BINARY_DIR} /OpenCoarraysConfigVersion.cmake"
123
132
DESTINATION
124
133
lib/cmake/opencoarrays
@@ -130,6 +139,17 @@ target_link_libraries(OpenCoarrays INTERFACE caf_mpi)
130
139
131
140
install (DIRECTORY ${CMAKE_BINARY_DIR} /mod DESTINATION . )
132
141
142
+ #------------------------------------------
143
+ # Add portable unistall command to makefile
144
+ #------------------------------------------
145
+ # Adapted from the CMake Wiki FAQ
146
+ configure_file ( "${CMAKE_SOURCE_DIR} /cmake/uninstall.cmake.in" "${CMAKE_BINARY_DIR} /uninstall.cmake"
147
+ @ONLY )
148
+
149
+ add_custom_target ( uninstall
150
+ COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR} /uninstall.cmake" )
151
+
152
+
133
153
enable_testing ()
134
154
135
155
function (add_mpi_test name num_mpi_proc path )
@@ -169,15 +189,10 @@ if(opencoarrays_aware_compiler)
169
189
add_mpi_test (hello_multiverse 2 ${tests_root} /integration/coarrayHelloWorld/hello_multiverse )
170
190
add_mpi_test (coarray_burgers_pde 2 ${tests_root} /integration/pde_solvers/coarrayBurgers/coarray_burgers_pde )
171
191
add_mpi_test (co_heat 2 ${tests_root} /integration/pde_solvers/coarrayHeatSimplified/co_heat )
172
-
173
- execute_process (COMMAND uname -m
174
- OUTPUT_VARIABLE MACHINE_TYPE )
175
- if ("${CMAKE_SYSTEM_NAME} " MATCHES "Linux" )
176
- if ("${MACHINE_TYPE} " MATCHES "x86_64" )
177
- if ( NOT (DEFINED ENV{TRAVIS} ))
178
- add_mpi_test (coarray_navier_stokes 2 ${tests_root} /integration/pde_solvers/navier-stokes/coarray_navier_stokes )
179
- set_property (TEST coarray_navier_stokes PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
180
- endif ()
192
+ if ( ("${CMAKE_SYSTEM_PROCESSOR} " MATCHES "x86_64" ) AND ("${CMAKE_SYSTEM_NAME} " MATCHES "Linux" ) )
193
+ if ( NOT (DEFINED ENV{TRAVIS} ))
194
+ add_mpi_test (coarray_navier_stokes 2 ${tests_root} /integration/pde_solvers/navier-stokes/coarray_navier_stokes )
195
+ set_property (TEST coarray_navier_stokes PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
181
196
endif ()
182
197
endif ()
183
198
else ()
0 commit comments