MFEM  v4.1.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
version.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2020, 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_MPI
71  "MFEM_USE_MPI\n"
72 #endif
73 #ifdef MFEM_USE_METIS
74  "MFEM_USE_METIS\n"
75 #endif
76 #ifdef MFEM_USE_METIS_5
77  "MFEM_USE_METIS_5\n"
78 #endif
79 #ifdef MFEM_DEBUG
80  "MFEM_DEBUG\n"
81 #endif
82 #ifdef MFEM_USE_EXCEPTIONS
83  "MFEM_USE_EXCEPTIONS\n"
84 #endif
85 #ifdef MFEM_USE_ZLIB
86  "MFEM_USE_ZLIB\n"
87 #endif
88 #ifdef MFEM_USE_LIBUNWIND
89  "MFEM_USE_LIBUNWIND\n"
90 #endif
91 #ifdef MFEM_USE_LAPACK
92  "MFEM_USE_LAPACK\n"
93 #endif
94 #ifdef MFEM_THREAD_SAFE
95  "MFEM_THREAD_SAFE\n"
96 #endif
97 #ifdef MFEM_USE_LEGACY_OPENMP
98  "MFEM_USE_LEGACY_OPENMP\n"
99 #endif
100 #ifdef MFEM_USE_MEMALLOC
101  "MFEM_USE_MEMALLOC\n"
102 #endif
103 #ifdef MFEM_USE_SUNDIALS
104  "MFEM_USE_SUNDIALS\n"
105 #endif
106 #ifdef MFEM_USE_MESQUITE
107  "MFEM_USE_MESQUITE\n"
108 #endif
109 #ifdef MFEM_USE_SUITESPARSE
110  "MFEM_USE_SUITESPARSE\n"
111 #endif
112 #ifdef MFEM_USE_SUPERLU
113  "MFEM_USE_SUPERLU\n"
114 #endif
115 #ifdef MFEM_USE_STRUMPACK
116  "MFEM_USE_STRUMPACK\n"
117 #endif
118 #ifdef MFEM_USE_GECKO
119  "MFEM_USE_GECKO\n"
120 #endif
121 #ifdef MFEM_USE_GNUTLS
122  "MFEM_USE_GNUTLS\n"
123 #endif
124 #ifdef MFEM_USE_NETCDF
125  "MFEM_USE_NETCDF\n"
126 #endif
127 #ifdef MFEM_USE_PETSC
128  "MFEM_USE_PETSC\n"
129 #endif
130 #ifdef MFEM_USE_MPFR
131  "MFEM_USE_MPFR\n"
132 #endif
133 #ifdef MFEM_USE_CONDUIT
134  "MFEM_USE_CONDUIT\n"
135 #endif
136 #ifdef MFEM_USE_SIDRE
137  "MFEM_USE_SIDRE\n"
138 #endif
139 #ifdef MFEM_USE_PUMI
140  "MFEM_USE_PUMI\n"
141 #endif
142 #ifdef MFEM_USE_CUDA
143  "MFEM_USE_CUDA\n"
144 #endif
145 #ifdef MFEM_USE_RAJA
146  "MFEM_USE_RAJA\n"
147 #endif
148 #ifdef MFEM_USE_UMPIRE
149  "MFEM_USE_UMPIRE\n"
150 #endif
151 #ifdef MFEM_USE_OCCA
152  "MFEM_USE_OCCA\n"
153 #endif
154  "MFEM_TIMER_TYPE = " EXPAND_AND_QUOTE(MFEM_TIMER_TYPE)
155  ;
156 
157  return config_str;
158 }
159 
160 }
int GetVersionMajor()
Definition: version.cpp:28
const char * GetConfigStr()
Definition: version.cpp:66
const char * GetVersionStr()
Definition: version.cpp:46
const char * GetGitStr()
Definition: version.cpp:59
int GetVersion()
Definition: version.cpp:22
int GetVersionMinor()
Definition: version.cpp:34
int GetVersionPatch()
Definition: version.cpp:40