-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
120 lines (89 loc) · 3.34 KB
/
Copy pathCMakeLists.txt
File metadata and controls
120 lines (89 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
set_property(DIRECTORY PROPERTY LABELS standalone_libraries)
if(gemini3d_matlab)
include(${PROJECT_SOURCE_DIR}/cmake/matlab.cmake)
endif()
add_compile_options(${gemini3d_flags})
# scope is this directory on down
# Libraries such as MPI, HDF5, Scalapack, MUMPS, are so important
# we test each standalone to mitigate confusing build or runtime errors
# if a particular library isn't working.
# --- HDF5
add_executable(test_hdf5_standalone_C test_hdf5.c)
target_link_libraries(test_hdf5_standalone_C PRIVATE h5fortran::h5fortran)
add_test(HDF5_standalone_C test_hdf5_standalone_C)
add_executable(test_hdf5_standalone_Fortran test_hdf5.f90)
target_link_libraries(test_hdf5_standalone_Fortran PRIVATE h5fortran::h5fortran)
add_test(HDF5_standalone_Fortran test_hdf5_standalone_Fortran)
# --- MPI
add_executable(gemini_mpi_standalone test_mpi.f90)
target_link_libraries(gemini_mpi_standalone PRIVATE MPI::MPI_Fortran)
add_test(NAME GeminiMPIstandalone COMMAND gemini_mpi_standalone ${Ncpu})
test_mpi_launcher(gemini_mpi_standalone GeminiMPIstandalone ${Ncpu})
set_tests_properties(GeminiMPIstandalone PROPERTIES
FIXTURES_SETUP mpi_fxt
RESOURCE_LOCK cpu_mpi
)
# --- MUMPS
add_executable(gemini_mumps_standalone test_mumps.f90)
target_link_libraries(gemini_mumps_standalone PRIVATE mumps_interface
MUMPS::MUMPS MPI::MPI_Fortran
)
# same link logic applied to gemini.bin
target_include_directories(gemini_mumps_standalone PRIVATE ${MPI_Fortran_INCLUDE_DIRS})
# this include is for robustness so mpi_f08.mod isn't missed e.g. on Linux systems
add_test(NAME GeminiMUMPSstandalone COMMAND gemini_mumps_standalone)
set_tests_properties(GeminiMUMPSstandalone PROPERTIES
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
REQUIRED_FILES ${CMAKE_CURRENT_SOURCE_DIR}/input_simpletest_real.nml
FIXTURES_REQUIRED mpi_fxt
FIXTURES_SETUP mumps_fxt
RESOURCE_LOCK cpu_mpi
)
test_mpi_launcher(gemini_mumps_standalone GeminiMUMPSstandalone 2)
add_test(NAME gemini_fortran COMMAND gemini.bin -h)
set_tests_properties(gemini_fortran PROPERTIES
PASS_REGULAR_EXPRESSION "EOF: gemini.bin"
FIXTURES_SETUP gemini_exe_fxt
FIXTURES_REQUIRED "mumps_fxt"
LABELS unit
)
if(TARGET gemini_c.bin)
add_test(NAME gemini_cpp COMMAND gemini_c.bin -h)
set_tests_properties(gemini_cpp PROPERTIES
PASS_REGULAR_EXPRESSION "EOF: gemini.bin"
FIXTURES_SETUP gemini_exe_fxt
FIXTURES_REQUIRED "mumps_fxt"
LABELS "unit;Cpp"
)
endif()
add_test(NAME gemini3d_run_ok COMMAND gemini3d.run)
set_tests_properties(gemini3d_run_ok PROPERTIES
PASS_REGULAR_EXPRESSION "EOF: gemini3d.run"
FIXTURES_SETUP gemini_exe_fxt
)
add_subdirectory(compare)
if(gemini3d_BUILD_TESTING)
add_executable(echo_path echo_path.f90)
add_test(NAME EchoEnvVar COMMAND echo_path)
add_test(NAME magcalc_exe_ok COMMAND magcalc.bin)
set_tests_properties(magcalc_exe_ok PROPERTIES
PASS_REGULAR_EXPRESSION "EOF: magcalc.bin"
LABELS unit
)
add_test(NAME magcalc_run_ok COMMAND magcalc.run)
set_tests_properties(magcalc_run_ok PROPERTIES
PASS_REGULAR_EXPRESSION "EOF: magcalc.run"
)
add_subdirectory(coord)
add_subdirectory(diffusion)
add_subdirectory(interpolation)
add_subdirectory(io)
add_subdirectory(ionization)
add_subdirectory(mpi)
add_subdirectory(neutral)
add_subdirectory(potential)
add_subdirectory(temporal)
# self-test simulations -- after all targets for if(TARGET ...)
include(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/sim.cmake)
endif()