diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f27eb42 --- /dev/null +++ b/.gitignore @@ -0,0 +1,48 @@ +*~ +Makefile + +libvotca*.a +libvotca*.so +libvotca*.so.* + +share/doc/html +share/doc/Doxyfile + +include/votca/xtp/votca_config.h +src/libxtp/gitversion.h +include/votca/xtp/votca_config.h + +src/tools/xtp_dump +src/tools/xtp_parallel +src/tools/xtp_map +src/tools/xtp_run +src/tools/xtp_tools +src/tools/xtp_overlap +src/tools/xtp_kmc_run +src/dipro/*.mod +src/dipro/*.x +src/tools/*.man + +scripts/xtp_dipro.out +scripts/xtp_dipro +scripts/xtp_update +scripts/xtp_update.out +scripts/xtp_testsuite +scripts/xtp_testsuite.out +scripts/xtp_update_exciton +scripts/xtp_update_exciton.out +scripts/xtp_basisset +scripts/xtp_basisset.out +scripts/xtp_makeauxbasis +scripts/xtp_makeauxbasis.out + +netbeans +.dep.inc +*/nbproject/private + +CMakeFiles +cmake_install.cmake +CMakeCache.txt +install_manifest.txt + +/build diff --git a/CHANGELOG.md b/CHANGELOG.md index 3621fc7..dd885e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ For more detailed information about the changes see the history of the [repository](https://github.com/votca/xtp/commits/master). + +## Version 1.6.4 (released 12.01.21) +* fix build on openSUSE (#622) +* Refactored logger (#625) ## Version 1.6.3 (released 09.12.20) * switch to ghcr.io for CI (#555) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02109e7..9e981f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project(votca-xtp) -set(PROJECT_VERSION "1.6.3") +set(PROJECT_VERSION "1.6.4") set(PROJECT_CONTACT "bugs@votca.org") string(REGEX REPLACE "^[1-9]+\\.([1-9]+).*$" "\\1" SOVERSION "${PROJECT_VERSION}") if (NOT ${SOVERSION} MATCHES "[1-9]+") diff --git a/include/votca/xtp/logger.h b/include/votca/xtp/logger.h index 51cabd4..b1857f3 100644 --- a/include/votca/xtp/logger.h +++ b/include/votca/xtp/logger.h @@ -42,7 +42,7 @@ /* * Custom buffer to store messages */ -class LogBuffer : public std::stringbuf { +class LogBuffer final : public std::stringbuf { public: LogBuffer() : std::stringbuf() { _LogLevel = Log::current_level; } @@ -105,7 +105,7 @@ bool _writePreface = true; protected: - int sync() override { + int sync() { std::ostringstream _message; @@ -165,35 +165,30 @@ } public: - Logger() : std::ostream(new LogBuffer()), _ReportLevel(Log::current_level) { + Logger() : std::ostream(&_buffer), _ReportLevel(Log::current_level) { setMultithreading(_maverick); } Logger(Log::Level ReportLevel) - : std::ostream(new LogBuffer()), _ReportLevel(ReportLevel) { + : std::ostream(&_buffer), _ReportLevel(ReportLevel) { setMultithreading(_maverick); } - ~Logger() final { - delete rdbuf(); - rdbuf(nullptr); - } - Logger &operator()(Log::Level LogLevel) { - dynamic_cast(rdbuf())->setLogLevel(LogLevel); + _buffer.setLogLevel(LogLevel); return *this; } void setReportLevel(Log::Level ReportLevel) { _ReportLevel = ReportLevel; } void setMultithreading(bool maverick) { _maverick = maverick; - dynamic_cast(rdbuf())->setMultithreading(_maverick); + _buffer.setMultithreading(_maverick); } bool isMaverick() const { return _maverick; } Log::Level getReportLevel() const { return _ReportLevel; } void setPreface(Log::Level level, const std::string &preface) { - dynamic_cast(rdbuf())->setPreface(level, preface); + _buffer.setPreface(level, preface); } void setCommonPreface(const std::string &preface) { @@ -203,22 +198,19 @@ setPreface(Log::warning, preface); } - void EnablePreface() { dynamic_cast(rdbuf())->EnablePreface(); } - - void DisablePreface() { - dynamic_cast(rdbuf())->DisablePreface(); - } + void EnablePreface() { _buffer.EnablePreface(); } + + void DisablePreface() { _buffer.DisablePreface(); } private: + LogBuffer _buffer; // at what level of detail output messages Log::Level _ReportLevel = Log::error; // if true, only a single processor job is executed bool _maverick = false; - std::string Messages() { - return dynamic_cast(rdbuf())->Messages(); - } + std::string Messages() { return _buffer.Messages(); } }; /** diff --git a/src/libxtp/dftengine/dftengine.cc b/src/libxtp/dftengine/dftengine.cc index c698cc1..33510b6 100644 --- a/src/libxtp/dftengine/dftengine.cc +++ b/src/libxtp/dftengine/dftengine.cc @@ -23,6 +23,7 @@ #include "votca/xtp/qmmolecule.h" #include #include +#include #include #include #include diff --git a/src/libxtp/polarregion.cc b/src/libxtp/polarregion.cc index fb40e41..a654c8d 100644 --- a/src/libxtp/polarregion.cc +++ b/src/libxtp/polarregion.cc @@ -18,6 +18,7 @@ */ #include "votca/xtp/eeinteractor.h" +#include #include #include #include diff --git a/src/libxtp/qmpackages/nwchem.cc b/src/libxtp/qmpackages/nwchem.cc index 3a32ec5..7c79c04 100644 --- a/src/libxtp/qmpackages/nwchem.cc +++ b/src/libxtp/qmpackages/nwchem.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/src/libxtp/tools/apdft.cc b/src/libxtp/tools/apdft.cc index 4599ebe..05efbf8 100644 --- a/src/libxtp/tools/apdft.cc +++ b/src/libxtp/tools/apdft.cc @@ -16,6 +16,7 @@ */ #include "apdft.h" +#include #include #include #include diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index b81966d..780aa08 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -2,7 +2,7 @@ project(xtp-tutorials) -set(PROJECT_VERSION "1.6.3") +set(PROJECT_VERSION "1.6.4") set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules) include(GNUInstallDirs) diff --git a/tutorials/GROMACS/Methane/QC_FILES/g09/anion_geo/polar/molpol.xml~ b/tutorials/GROMACS/Methane/QC_FILES/g09/anion_geo/polar/molpol.xml~ new file mode 100644 index 0000000..d29b493 --- /dev/null +++ b/tutorials/GROMACS/Methane/QC_FILES/g09/anion_geo/polar/molpol.xml~ @@ -0,0 +1,20 @@ + + + + CH4_i.mps + CH4_i.mps + output.xml + + + 0.39000 + 0.35000 + 1024 + 0.00001 + + + true + 2.3191 0.0 0.0 2.3199 0.0 2.3204 + 0.00001 + + + diff --git a/tutorials/GROMACS/Methane/QC_FILES/g09/cation_geo/polar/molpol.xml~ b/tutorials/GROMACS/Methane/QC_FILES/g09/cation_geo/polar/molpol.xml~ new file mode 100644 index 0000000..6f9757e --- /dev/null +++ b/tutorials/GROMACS/Methane/QC_FILES/g09/cation_geo/polar/molpol.xml~ @@ -0,0 +1,20 @@ + + + + CH4_h.mps + CH4_h.mps + output.xml + + + 0.39000 + 0.35000 + 1024 + 0.00001 + + + true + 1.4451 0.0 0.0 2.0267 0.0 2.0267 + 0.00001 + + + diff --git a/tutorials/GROMACS/Methane/QC_FILES/g09/neutral_geo/polar/molpol.xml~ b/tutorials/GROMACS/Methane/QC_FILES/g09/neutral_geo/polar/molpol.xml~ new file mode 100644 index 0000000..b1444a7 --- /dev/null +++ b/tutorials/GROMACS/Methane/QC_FILES/g09/neutral_geo/polar/molpol.xml~ @@ -0,0 +1,20 @@ + + + + CH4_n.mps + CH4_n.mps + output.xml + + + 0.39000 + 0.35000 + 1024 + 0.00001 + + + true + 2.3191 0.0 0.0 2.3199 0.0 2.3204 + 0.00001 + + +