evaleev / libint

Libint: high-performance library for computing Gaussian integrals in quantum mechanics
Other
226 stars 95 forks source link

test HF compile errors when using gcc-7.2 with -std=c++1z flag #103

Closed ajaypanyala closed 6 years ago

ajaypanyala commented 6 years ago

Compiling tests/hartree_fock.cc with a C++ 17 compiler (with -std=c++1z enabled) results in compile errors attached

Compile cmd: g++ -c -std=c++1z -c hartree-fock.cc -I/opt/libint/include -I/opt/eigen3

evaleev commented 6 years ago

does not provide the <any> header? Or header exists but no contents? according to https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2017 <any> should exist and be functional as of 7.1

ajaypanyala commented 6 years ago

One thing I noticed is #include <any> is missing in libint2/util/any.h when __cplusplus >= 201703L

ajaypanyala commented 6 years ago

This is what I had to do in libint2/util/any.h to get it to compile:

#if __cplusplus >= 201703L
#include <any>
#endif

namespace libint2 {

// use C++17 std::any, if available
#if __cplusplus >= 201703L
using std::any;
using std::any_cast;
using std::bad_any_cast;
#else
...
evaleev commented 6 years ago

this issue had been fixed in 2.5.0-beta.1 via https://github.com/evaleev/libint/pull/96