Commit 65807009 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

print C++ standard in use message with help page and "info config" command

parent bb4dc598
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -281,6 +281,7 @@ void Info::command(int narg, char **arg)
    infobuf = get_compiler_info();
    fprintf(out,"\nCompiler: %s with %s\n",infobuf,get_openmp_info());
    delete[] infobuf;
    fprintf(out,"C++ standard: %s\n",get_cxx_info());

    fputs("\nActive compile time flags:\n\n",out);
    if (has_gzip_support()) fputs("-DLAMMPS_GZIP\n",out);
@@ -1208,6 +1209,23 @@ const char *Info::get_openmp_info()
#endif
}

const char *Info::get_cxx_info()
{
#if __cplusplus > 201703L
  return (const char *)"newer than C++17";
#elif __cplusplus == 201703L
  return (const char *)"C++17";
#elif __cplusplus == 201402L
  return (const char *)"C++14";
#elif __cplusplus == 201103L
  return (const char *)"C++11";
#elif __cplusplus == 199711L
  return (const char *)"C++98";
#else
  return (const char *)"unknown";
#endif
}

/* ---------------------------------------------------------------------- */

char **Info::get_variable_names(int &num) {
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ class Info : protected Pointers {
  static char *get_os_info();
  static char *get_compiler_info();
  static const char *get_openmp_info();
  static const char *get_cxx_info();

  char **get_variable_names(int &num);

+2 −1
Original line number Diff line number Diff line
@@ -1276,8 +1276,9 @@ void LAMMPS::print_config(FILE *fp)
  delete[] infobuf;

  infobuf = Info::get_compiler_info();
  fprintf(fp,"Compiler: %s with %s\n\n",infobuf,Info::get_openmp_info());
  fprintf(fp,"Compiler: %s with %s\n",infobuf,Info::get_openmp_info());
  delete[] infobuf;
  fprintf(fp,"C++ standard: %s\n\n",Info::get_cxx_info());

  fputs("Active compile time flags:\n\n",fp);
  if (Info::has_gzip_support()) fputs("-DLAMMPS_GZIP\n",fp);