From e3a528a49353541ca6e6b281d78353c6e16e52a9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 9 May 2018 13:06:34 -0400 Subject: [PATCH] report compile time options (-DLAMMPS_XXX) in help output and info config --- src/info.cpp | 1 + src/lammps.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/lammps.h | 1 + 3 files changed, 66 insertions(+) diff --git a/src/info.cpp b/src/info.cpp index 65c0cd9b53..1a5bc21209 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -262,6 +262,7 @@ void Info::command(int narg, char **arg) fprintf(out,"\nLAMMPS version: %s / %s\n", universe->version, universe->num_ver); + lmp->print_config(out); fprintf(out,"sizeof(smallint): %3d-bit\n",(int)sizeof(smallint)*8); fprintf(out,"sizeof(imageint): %3d-bit\n",(int)sizeof(imageint)*8); fprintf(out,"sizeof(tagint): %3d-bit\n",(int)sizeof(tagint)*8); diff --git a/src/lammps.cpp b/src/lammps.cpp index 56af95767b..6a326e2abb 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -31,6 +31,7 @@ #include "style_region.h" #include "universe.h" #include "input.h" +#include "info.h" #include "atom.h" #include "update.h" #include "neighbor.h" @@ -823,6 +824,8 @@ void LAMMPS::help() "-var varname value : set index style variable (-v)\n\n", exename); + + print_config(fp); fprintf(fp,"List of style options included in this LAMMPS executable\n\n"); int pos = 80; @@ -974,3 +977,64 @@ void print_style(FILE *fp, const char *str, int &pos) pos += 80; } } + +static const char lammps_config_options[] += "LAMMPS compile time settings:\n" + "Integer sizes setting: " +#if defined(LAMMPS_SMALLSMALL) + " -DLAMMPS_SMALLSMALL" +#elif defined(LAMMPS_SMALLBIG) + " -DLAMMPS_SMALLBIG" +#elif defined(LAMMPS_BIGBIG) + " -DLAMMPS_BIGBIG" +#else + " (unkown)" +#endif + "\nExternal commands support:" +#if defined(LAMMPS_GZIP) + " -DLAMMPS_GZIP" +#endif +#if defined(LAMMPS_FFMPEG) + " -DLAMMPS_FFMPEG" +#endif + "\nImage library support: " +#if defined(LAMMPS_JPEG) + " -DLAMMPS_JPEG" +#endif +#if defined(LAMMPS_PNG) + " -DLAMMPS_PNG" +#endif + "\nFFT library support: " +#if defined(FFT_SINGLE) + " -DFFT_SINGLE" +#endif +#if defined(FFT_FFTW) || defined(FFT_FFTW3) + " -DFFT_FFTW3" +#elif defined(FFT_FFTW2) + " -DFFT_FFTW2" +#elif defined(FFT_MKL) + " -DFFT_MKL" +#else + " -DFFT_KISSFFT" +#endif + "\nMemory alignment: " +#if defined(LAMMPS_MEMALIGN) +#define lmp_str(s) #s +#define lmp_xstr(s) lmp_str(s) + " -DLAMMPS_MEMALIGN=" lmp_xstr(LAMMPS_MEMALIGN) +#else + " (default)" +#endif + + "\nException support: " +#if defined(LAMMPS_EXCEPTIONS) + " -DLAMMPS_EXCEPTIONS\n" +#else + " (not enabled)\n" +#endif + "\n"; + +void LAMMPS::print_config(FILE *fp) +{ + fputs(lammps_config_options,fp); +} diff --git a/src/lammps.h b/src/lammps.h index 1323dcccc8..6473985736 100644 --- a/src/lammps.h +++ b/src/lammps.h @@ -65,6 +65,7 @@ class LAMMPS { void post_create(); void init(); void destroy(); + void print_config(FILE *); // print compile time settings private: void help();