MFEM  v4.5.2
Finite element discretization library
version.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #include "../config/config.hpp"
13 #include "version.hpp"
14 
15 #define QUOTE(str) #str
16 #define EXPAND_AND_QUOTE(str) QUOTE(str)
17 
18 namespace mfem
19 {
20 
21 
23 {
24  return MFEM_VERSION;
25 }
26 
27 
29 {
30  return MFEM_VERSION_MAJOR;
31 }
32 
33 
35 {
36  return MFEM_VERSION_MINOR;
37 }
38 
39 
41 {
42  return MFEM_VERSION_PATCH;
43 }
44 
45 
46 const char *GetVersionStr()
47 {
48 #if MFEM_VERSION_TYPE == MFEM_VERSION_TYPE_RELEASE
49 #define MFEM_VERSION_TYPE_STR " (release)"
50 #elif MFEM_VERSION_TYPE == MFEM_VERSION_TYPE_DEVELOPMENT
51 #define MFEM_VERSION_TYPE_STR " (development)"
52 #endif
53  static const char *version_str =
54  "MFEM v" MFEM_VERSION_STRING MFEM_VERSION_TYPE_STR;
55  return version_str;
56 }
57 
58 
59 const char *GetGitStr()
60 {
61  static const char *git_str = MFEM_GIT_STRING;
62  return git_str;
63 }
64 
65 
66 const char *GetConfigStr()
67 {
68  static const char *config_str =
69  ""
70 #ifdef MFEM_USE_ADIOS2
71  "MFEM_USE_ADIOS2\n"
72 #endif
73 #ifdef MFEM_USE_AMGX
74  "MFEM_USE_AMGX\n"
75 #endif
76 #ifdef MFEM_USE_CEED
77  "MFEM_USE_CEED\n"
78 #endif
79 #ifdef MFEM_USE_CONDUIT
80  "MFEM_USE_CONDUIT\n"
81 #endif
82 #ifdef MFEM_USE_CUDA
83  "MFEM_USE_CUDA\n"
84 #endif
85 #ifdef MFEM_USE_EXCEPTIONS
86  "MFEM_USE_EXCEPTIONS\n"
87 #endif
88 #ifdef MFEM_USE_GINKGO
89  "MFEM_USE_GINKGO\n"
90 #endif
91 #ifdef MFEM_USE_GNUTLS
92  "MFEM_USE_GNUTLS\n"
93 #endif
94 #ifdef MFEM_USE_GSLIB
95  "MFEM_USE_GSLIB\n"
96 #endif
97 #ifdef MFEM_USE_HIOP
98  "MFEM_USE_HIOP\n"
99 #endif
100 #ifdef MFEM_USE_HIP
101  "MFEM_USE_HIP\n"
102 #endif
103 #ifdef MFEM_USE_LAPACK
104  "MFEM_USE_LAPACK\n"
105 #endif
106 #ifdef MFEM_USE_LEGACY_OPENMP
107  "MFEM_USE_LEGACY_OPENMP\n"
108 #endif
109 #ifdef MFEM_USE_LIBUNWIND
110  "MFEM_USE_LIBUNWIND\n"
111 #endif
112 #ifdef MFEM_USE_MEMALLOC
113  "MFEM_USE_MEMALLOC\n"
114 #endif
115 #ifdef MFEM_USE_METIS
116  "MFEM_USE_METIS\n"
117 #endif
118 #ifdef MFEM_USE_METIS_5
119  "MFEM_USE_METIS_5\n"
120 #endif
121 #ifdef MFEM_USE_MKL_CPARDISO
122  "MFEM_USE_MKL_CPARDISO\n"
123 #endif
124 #ifdef MFEM_USE_MPFR
125  "MFEM_USE_MPFR\n"
126 #endif
127 #ifdef MFEM_USE_MPI
128  "MFEM_USE_MPI\n"
129 #endif
130 #ifdef MFEM_USE_NETCDF
131  "MFEM_USE_NETCDF\n"
132 #endif
133 #ifdef MFEM_USE_OCCA
134  "MFEM_USE_OCCA\n"
135 #endif
136 #ifdef MFEM_USE_OPENMP
137  "MFEM_USE_OPENMP\n"
138 #endif
139 #ifdef MFEM_USE_PETSC
140  "MFEM_USE_PETSC\n"
141 #endif
142 #ifdef MFEM_USE_PUMI
143  "MFEM_USE_PUMI\n"
144 #endif
145 #ifdef MFEM_USE_RAJA
146  "MFEM_USE_RAJA\n"
147 #endif
148 #ifdef MFEM_USE_SIDRE
149  "MFEM_USE_SIDRE\n"
150 #endif
151 #ifdef MFEM_USE_SIMD
152  "MFEM_USE_SIMD\n"
153 #endif
154 #ifdef MFEM_USE_SLEPC
155  "MFEM_USE_SLEPC\n"
156 #endif
157 #ifdef MFEM_USE_STRUMPACK
158  "MFEM_USE_STRUMPACK\n"
159 #endif
160 #ifdef MFEM_USE_SUITESPARSE
161  "MFEM_USE_SUITESPARSE\n"
162 #endif
163 #ifdef MFEM_USE_SUNDIALS
164  "MFEM_USE_SUNDIALS\n"
165 #endif
166 #ifdef MFEM_USE_SUPERLU
167  "MFEM_USE_SUPERLU\n"
168 #endif
169 #ifdef MFEM_USE_SUPERLU5
170  "MFEM_USE_SUPERLU5\n"
171 #endif
172 #ifdef MFEM_USE_UMPIRE
173  "MFEM_USE_UMPIRE\n"
174 #endif
175 #ifdef MFEM_USE_ZLIB
176  "MFEM_USE_ZLIB\n"
177 #endif
178  "MFEM_TIMER_TYPE = " EXPAND_AND_QUOTE(MFEM_TIMER_TYPE)
179  ;
180 
181  return config_str;
182 }
183 
184 }
int GetVersionMajor()
Return the MFEM major version number as an integer.
Definition: version.cpp:28
const char * GetConfigStr()
Return the MFEM configuration as a string.
Definition: version.cpp:66
const char * GetVersionStr()
Return the MFEM version number as a string.
Definition: version.cpp:46
const char * GetGitStr()
Return the MFEM Git hash as a string.
Definition: version.cpp:59
int GetVersion()
Return the MFEM version number as a single integer.
Definition: version.cpp:22
int GetVersionMinor()
Return the MFEM minor version number as an integer.
Definition: version.cpp:34
int GetVersionPatch()
Return the MFEM version patch number as an integer.
Definition: version.cpp:40