Skip to content

Commit

Permalink
Print library path in log file
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanniBussi committed Dec 4, 2023
1 parent ab83708 commit 91d56cb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/config/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ bool hasExternalMolfile();

bool hasZlib();

std::string getLibraryPath();

}
}

Expand Down
13 changes: 13 additions & 0 deletions src/config/Config.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "version.h"
#include <cstdlib>
#include <cstring>
#include <dlfcn.h>

namespace PLMD {
namespace config {
Expand Down Expand Up @@ -177,6 +178,18 @@ std::string getCompilationTime() {
return __TIME__;
}

std::string getLibraryPath() {
#ifdef __PLUMED_HAS_DLADDR
Dl_info info;
if(dladdr((void*)getLibraryPath,&info)) {
return info.dli_fname;
} else {
return "";
}
#endif

}


}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/PlumedMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
#include <variant>
#include <filesystem>


namespace PLMD {

/// Small utility just used in this file to throw arbitrary exceptions
Expand Down Expand Up @@ -757,6 +756,7 @@ void PlumedMain::init() {
log<<"\n";
log<<"For further information see the PLUMED web page at http://www.plumed.org\n";
log<<"Root: "<<config::getPlumedRoot()<<"\n";
log<<"LibraryPath: "<<config::getLibraryPath()<<"\n";
log<<"For installed feature, see "<<config::getPlumedRoot() + "/src/config/config.txt\n";
log.printf("Molecular dynamics engine: %s\n",MDEngine.c_str());
log.printf("Precision of reals: %d\n",atoms.getRealPrecision());
Expand Down

1 comment on commit 91d56cb

@PlumedBot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found broken examples in automatic/a-masterclass-22-09.txt
Found broken examples in automatic/a-masterclass-22-11.txt
Found broken examples in automatic/a-masterclass-22-12.txt
Found broken examples in automatic/performance-optimization.txt
Found broken examples in automatic/a-trieste-6.txt
Found broken examples in automatic/munster.txt
Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/ENVIRONMENTSIMILARITY.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GHBFIX.tmp
Found broken examples in automatic/INCLUDE.tmp
Found broken examples in automatic/MAZE_MEMETIC_SAMPLING.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_RANDOM_WALK.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PLUMED.tmp
Found broken examples in MiscelaneousPP.md

Please sign in to comment.