ValeevGroup / mpqc

The Massively Parallel Quantum Chemistry program, MPQC, computes properties of atoms and molecules from first principles using the time independent Schrödinger equation.
66 stars 24 forks source link

Build fails with clang-6: error: 'xsgetn' is a protected member of 'std::__1::basic_streambuf<char>' #56

Closed yurivict closed 6 years ago

yurivict commented 6 years ago

Getting these errors on FreeBSD 12:

/usr/local/include -O2 -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -c mstate.cc  -fPIC -DPIC -o .libs/mstate.o
mstate.cc:577:28: error: 'xsgetn' is a protected member of 'std::__1::basic_streambuf<char>'
      *nbuf_buffer = buf_->xsgetn(buffer,bufsize);
                           ^
/usr/include/c++/v1/streambuf:281:24: note: declared protected here
    virtual streamsize xsgetn(char_type* __s, streamsize __n);
                       ^
yurivict commented 6 years ago

There are also errors like this:

disprep.cc:29:44: error: use of undeclared identifier 'endl'; did you mean 'std::endl'?
           << " dispersion coefficient" << endl;
                                           ^~~~
                                           std::endl
yurivict commented 6 years ago

USING_NAMESPACE_STD and HAVE_SGETN are unset, this causes this problem. I don't know of any situations when use std; can be optional depending on something. And xsgetn is always protected, see here https://en.cppreference.com/w/cpp/io/basic_streambuf/sgetn

evaleev commented 6 years ago

this is version 2.3.1?

yurivict commented 6 years ago

I'll try the version 3.X and will get back to you.

evaleev commented 6 years ago

@yurivict version 3.X is abandoned and will not be maintained. Version 4 is live in master and will be released (as 4.0.0-beta.1) any day now. I'd like to fix 2.3.1 though, if that version is giving you trouble.

yurivict commented 6 years ago

2.3.1 builds fine. I may have tried version 3, not sure now. I will wait for the version 4 then. Please feel free to close these bug reports then.