diff --git a/src/config/Config.cpp.in b/src/config/Config.cpp.in index c683fa7bece2248e5ef2882a43d6852b2f5e856e..475d3c79cc9e4bd3ccbb91070ecabed03227dd2a 100644 --- a/src/config/Config.cpp.in +++ b/src/config/Config.cpp.in @@ -41,6 +41,23 @@ std::string getMakefile(){ return std::string(conf,conf+std::strlen(conf)); } +bool hasMatheval(){ +#if __PLUMED_HAS_MATHEVAL + return true; +#else + return false; +#endif +} + +bool hasDlopen(){ +#if __PLUMED_HAS_DLOPEN + return true; +#else + return false; +#endif +} + + } } diff --git a/src/config/Config.h b/src/config/Config.h index 623854ea03896dff6cc1f95388db3999e1a6ec30..c5fd8f75ade668b858496a94087372d87a3abf16 100644 --- a/src/config/Config.h +++ b/src/config/Config.h @@ -33,6 +33,10 @@ std::string getPlumedRoot(); std::string getMakefile(); +bool hasMatheval(); + +bool hasDlopen(); + } } diff --git a/src/core/CLToolMain.cpp b/src/core/CLToolMain.cpp index 902e29a27eb89c88564799f779b19eb785dabd8a..4f678787777fbd8b84d86a5c2081e07cce68693c 100644 --- a/src/core/CLToolMain.cpp +++ b/src/core/CLToolMain.cpp @@ -118,6 +118,8 @@ int CLToolMain::run(int argc, char **argv,FILE*in,FILE*out,Communicator& pc){ } else if(a=="--has-mpi"){ if(Communicator::initialized()) return 0; else return 1; + } else if(a=="--has-matheval"){ + return (config::hasMatheval()?0:1); } else if(a=="--no-mpi"){ // this is ignored, as it is parsed in main if(i>1){ @@ -176,7 +178,8 @@ int CLToolMain::run(int argc, char **argv,FILE*in,FILE*out,Communicator& pc){ " plumed [command] -h : to print help for a specific command\n" "Options:\n" " [help|-h|--help] : to print this help\n" - " [--has-mpi] : fails if plumed is running with MPI\n" + " [--has-mpi] : fails if plumed is running without MPI\n" + " [--has-matheval] : fails if plumed is compiled without matheval\n" " [--load LIB] : loads a shared object (typically a plugin library)\n" " [--standalone-executable] : tells plumed not to look for commands implemented as scripts\n" "Commands:\n";