libmesh_version.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
19 
20 #include <iostream>
21 #include <iomanip>
22 
24 {
25  std::cout << "--------------------------------------------------------" << std::endl;
26  std::cout << "libMesh Library: Version = " << LIBMESH_LIB_VERSION;
27  std::cout << " (" << get_libmesh_version() << ")" << std::endl << std::endl;
28 
29  std::cout << LIBMESH_LIB_RELEASE << std::endl << std::endl;
30 
31  std::cout << "Build Date = " << LIBMESH_BUILD_DATE << std::endl;
32  std::cout << "Build Host = " << LIBMESH_BUILD_HOST << std::endl;
33  std::cout << "Build User = " << LIBMESH_BUILD_USER << std::endl;
34  std::cout << "Build Arch = " << LIBMESH_BUILD_ARCH << std::endl;
35  std::cout << "Build Rev = " << LIBMESH_BUILD_VERSION << std::endl << std::endl;
36 
37  // CXXFLAGS is ambiguous wth multiple methods - could add all three but why not libmesh-config?
38  //std::cout << "C++ Config = " << LIBMESH_CXX << " " << LIBMESH_CXXFLAGS << std::endl;
39  std::cout << "--------------------------------------------------------" << std::endl;
40 
41  return;
42 }
43 
44 
45 
47 {
48  /* Note: return format follows the versioning convention xx.yy.zz where
49 
50  xx = major version number
51  yy = minor version number
52  zz = micro version number
53 
54  For example:
55  v. 0.23 -> 002300 = 2300
56  v 0.23.1 -> 002301 = 2301
57  v. 10.23.2 -> 102302 */
58 
59  int major_version = 0;
60  int minor_version = 0;
61  int micro_version = 0;
62 
63 #ifdef LIBMESH_MAJOR_VERSION
64  major_version = LIBMESH_MAJOR_VERSION;
65 #endif
66 
67 #ifdef LIBMESH_MINOR_VERSION
68  minor_version = LIBMESH_MINOR_VERSION;
69 #endif
70 
71 #ifdef LIBMESH_MICRO_VERSION
72  micro_version = LIBMESH_MICRO_VERSION;
73 #endif
74 
75  return major_version*10000 + minor_version*100 + micro_version;
76 }
77 
78 
79 
81 {
82  std::string retval(LIBMESH_IO_COMPATIBILITY_VERSION);
83  return retval;
84 }
void libmesh_version_stdout()
std::string get_io_compatibility_version()
int get_libmesh_version()