12 #include "MooseRevision.h" 14 #include "libmesh/libmesh_config.h" 19 #ifdef LIBMESH_HAVE_LOCALE 28 std::stringstream oss;
29 oss << std::left <<
"Framework Information:\n" 30 << std::setw(25) <<
"MOOSE Version: " << MOOSE_REVISION <<
'\n' 31 << std::setw(25) <<
"LibMesh Version: " << LIBMESH_BUILD_VERSION <<
'\n';
32 #ifdef LIBMESH_DETECTED_PETSC_VERSION_MAJOR 33 oss << std::setw(25) <<
"PETSc Version: " << LIBMESH_DETECTED_PETSC_VERSION_MAJOR <<
'.' 34 << LIBMESH_DETECTED_PETSC_VERSION_MINOR <<
'.' << LIBMESH_DETECTED_PETSC_VERSION_SUBMINOR
37 #ifdef LIBMESH_DETECTED_SLEPC_VERSION_MAJOR 38 oss << std::setw(25) <<
"SLEPc Version: " << LIBMESH_DETECTED_SLEPC_VERSION_MAJOR <<
'.' 39 << LIBMESH_DETECTED_SLEPC_VERSION_MINOR <<
'.' << LIBMESH_DETECTED_SLEPC_VERSION_SUBMINOR
44 oss << std::setw(25) <<
"Current Time: " <<
getTimeStamp() <<
"\n";
49 if (!executable_time.empty())
50 oss << std::setw(25) <<
"Executable Timestamp: " << executable_time <<
"\n";
60 struct tm * tm_struct;
61 std::time_t local_time;
63 #ifdef LIBMESH_HAVE_LOCALE 66 const std::time_put<char> & tp = std::use_facet<std::time_put<char>>(loc);
71 local_time = time(NULL);
72 time_stamp = &local_time;
74 tm_struct = std::localtime(time_stamp);
77 std::ostringstream date_stream;
96 return date_stream.str();
101 const unsigned int time_size = 40;
102 char time_buffer[time_size];
106 local_time = time(NULL);
107 time_stamp = &local_time;
109 tm_struct = std::localtime(time_stamp);
117 size_t len = strftime(time_buffer, time_size,
"%c", tm_struct);
120 return std::string(time_buffer);
123 libMesh::out <<
"Error formatting time buffer, returning empty string!" << std::endl;
124 return std::string(
"");
127 #endif // LIBMESH_HAVE_LOCALE 133 std::string executable(
_argv[0]);
134 size_t last_slash = executable.find_last_of(
"/");
135 if (last_slash != std::string::npos)
136 executable = executable.substr(last_slash + 1);
152 if (!stat(exe.c_str(), &attrib))
SystemInfo(int argc, char *argv[])
std::string getExecutable() const
std::string getExecutablePath()
This function returns the PATH of the running executable.
std::string getTimeStamp(std::time_t *time_stamp=NULL) const
std::string getExecutableTimeStamp() const
std::string getInfo() const
OStreamProxy out(std::cout)