File: CMakeLists.txt

package info (click to toggle)
sundials 6.4.1%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 79,368 kB
  • sloc: ansic: 218,700; f90: 62,503; cpp: 61,511; fortran: 5,166; python: 4,642; sh: 4,114; makefile: 562; perl: 123
file content (134 lines) | stat: -rw-r--r-- 3,482 bytes parent folder | download
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# ---------------------------------------------------------------
# Programmer(s): David J. Gardner and Slaven Peles @ LLNL
# ---------------------------------------------------------------
# SUNDIALS Copyright Start
# Copyright (c) 2002-2022, Lawrence Livermore National Security
# and Southern Methodist University.
# All rights reserved.
#
# See the top-level LICENSE and NOTICE files for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# SUNDIALS Copyright End
# ---------------------------------------------------------------
# examples level CMakeLists.txt for SUNDIALS
# ---------------------------------------------------------------

# Set variables used in generating CMake and Makefiles for examples
if(EXAMPLES_INSTALL)

  set(SHELL "sh")
  set(prefix "${CMAKE_INSTALL_PREFIX}")
  set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
  set(includedir "${prefix}/include")
  set(libdir "${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
  set(CPP "${_EXAMPLES_C_COMPILER}")
  set(CPPFLAGS "${CMAKE_C_FLAGS_RELEASE}")
  set(CC "${_EXAMPLES_C_COMPILER}")
  set(CFLAGS "${CMAKE_C_FLAGS_RELEASE}")
  set(LDFLAGS "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
  list2string(EXE_EXTRA_LINK_LIBS LIBS)
  list2string(EXE_EXTRA_LINK_LIBS EXAMPLES_EXTRA_LIBS)

  if(CXX_FOUND)
    set(CXX "${_EXAMPLES_CXX_COMPILER}")
    set(CXX_LNKR "${_EXAMPLES_CXX_COMPILER}")
    set(CXXFLAGS "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}")
    set(CXX_LDFLAGS "${CMAKE_CXX_FLAGS_RELEASE}")
    list2string(EXE_EXTRA_LINK_LIBS CXX_LIBS)
  endif()

  if(SUPERLUMT_FOUND)
    list2string(SUPERLUMT_LIBRARIES SUPERLUMT_LIBS)
    set(SUPERLUMT_LIBS "${SUPERLUMT_LINKER_FLAGS} ${SUPERLUMT_LIBS}")
  endif()

  if(KLU_FOUND)
    list2string(KLU_LIBRARIES KLU_LIBS)
    set(KLU_LIBS "${KLU_LINKER_FLAGS} ${KLU_LIBS}")
  endif()

  if(LAPACK_FOUND)
    list2string(LAPACK_LIBRARIES LAPACK_LIBS)
  endif()

  if(MPI_C_FOUND)
    if(MPI_C_COMPILER)
      set(MPICC "${MPI_C_COMPILER}")
      set(MPI_INC_DIR ".")
      set(MPI_LIB_DIR ".")
      set(MPI_LIBS "")
      set(MPI_FLAGS "")
    else()
      set(MPICC "${_EXAMPLES_C_COMPILER}")
      set(MPI_INC_DIR "${MPI_INCLUDE_PATH}")
      set(MPI_LIB_DIR ".")
      list2string(MPI_LIBRARIES MPI_LIBS)
    endif()
    set(HYPRE_INC_DIR "${HYPRE_INCLUDE_DIR}")
    set(HYPRE_LIB_DIR "${HYPRE_LIBRARY_DIR}")
    set(HYPRE_LIBS "${HYPRE_LIBRARIES}")
  endif()

  if(MPI_CXX_FOUND)
    if(MPI_CXX_COMPILER)
      set(MPICXX "${MPI_CXX_COMPILER}")
    else()
      set(MPICXX "${_EXAMPLEX_CXX_COMPILER}")
      list2string(MPI_LIBRARIES MPI_LIBS)
    endif()
  endif()

endif()


#----------------------------------------
# Add specific examples
#----------------------------------------

# Add ARKode examples
if(BUILD_ARKODE)
  add_subdirectory(arkode)
endif()

# Add CVODE examples
if(BUILD_CVODE)
  add_subdirectory(cvode)
endif()

# Add CVODES Examples
if(BUILD_CVODES)
  add_subdirectory(cvodes)
endif()

# Add IDA examples
if(BUILD_IDA)
  add_subdirectory(ida)
endif()

# Add IDAS examples
if(BUILD_IDAS)
  add_subdirectory(idas)
endif()

# Add KINSOL examples
if(BUILD_KINSOL)
  add_subdirectory(kinsol)
endif()

# Add CPODES examples
if(BUILD_CPODES)
  add_subdirectory(cpodes)
endif()

# Add the nvector examples
add_subdirectory(nvector)

# Add the sunmatrix examples
add_subdirectory(sunmatrix)

# Add the sunlinearsolver examples
add_subdirectory(sunlinsol)

# Add the sunnonlinearsolver examples
add_subdirectory(sunnonlinsol)