-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
83 lines (62 loc) · 2.65 KB
/
Copy pathCMakeLists.txt
File metadata and controls
83 lines (62 loc) · 2.65 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
cmake_minimum_required(VERSION 3.14) # 3.12 for find_ROOT, 3.13 for a lot of user functions, 3.14 for check_fortran_source_runs & fetchcontent
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug or Release" FORCE)
endif()
project(gemini3d
LANGUAGES C Fortran # MUST include C language for Intel / MKL to work
DESCRIPTION "3-D ionospheric model"
HOMEPAGE_URL https://github.com/gemini3d/gemini)
enable_testing()
if(NOT realbits)
set(realbits 64)
endif()
option(glow "use NCAR GLOW instead of Fang" ON)
option(matlab "enable Matlab tests, which are slow and duplicate fast Octave tests" OFF)
option(hdf5 "use HDF5 file I/O")
option(netcdf "use NetCDF file I/O")
option(metis "use METIS" OFF)
option(scotch "use Scotch" OFF)
if(netcdf AND hdf5)
message(FATAL_ERROR "HDF5 and NetCDF are mutually exclusive")
endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/)
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR})
include(${CMAKE_SOURCE_DIR}/cmake/compilers.cmake)
if(hdf5)
include(${CMAKE_SOURCE_DIR}/cmake/h5fortran.cmake)
elseif(netcdf)
include(${CMAKE_SOURCE_DIR}/cmake/nc4fortran.cmake)
endif()
include(${CMAKE_SOURCE_DIR}/cmake/utils.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/mumps.cmake)
# --- simple tests to help catch broken libs
add_subdirectory(tests)
# --- vendor libraries
add_subdirectory(vendor/msis00)
# --- GEMINI
add_subdirectory(ionization)
add_subdirectory(numerical)
add_subdirectory(io)
add_subdirectory(temporal)
add_library(neutral neutral/neutral.f90)
target_link_libraries(neutral PRIVATE const grid interp mpimod msis timeutils MPI::MPI_Fortran)
add_library(collision collisions/collisions.f90)
target_link_libraries(collision PRIVATE const)
add_library(sources sources/sources.f90)
target_link_libraries(sources PRIVATE calculus collision const grid mpimod)
# --- other libs
add_library(multifluid multifluid/multifluid.f90)
target_link_libraries(multifluid PRIVATE advec calculus collision const diffusion grid ionization mpimod precipBCs sources timeutils)
# --- Main GEMINI executable
add_executable(gemini.bin gemini.f90)
target_link_libraries(gemini.bin PRIVATE const grid io mpimod multifluid neutral potential precipBCs temporal timeutils
${LAPACK_LIBRARIES}) # necessary for self-compiled
#--------magnetic field calculation executable---------------
add_executable(magcalc.bin magcalc.f90)
target_link_libraries(magcalc.bin PRIVATE mpimod const grid io timeutils)
# --- self-tests
include(${CMAKE_SOURCE_DIR}/cmake/test2d.cmake)
#if(NOT DEFINED ENV{CI} OR NOT $ENV{CI})
# need the dollar sign on ENV for IF: save needless downloading
include(${CMAKE_SOURCE_DIR}/cmake/test3d.cmake)
#endif()