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

Compile error with -DMPQC_R12 (but no -DMPQC_NEW_FEATURES) #40

Closed mbanck closed 9 years ago

mbanck commented 9 years ago

If I don't turn on MPQC_NEW_FEATURES, but provide Libint2 (so -DMPQC_R12 is set), I get a compile error in pt2r12.cc:

$ cd "/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/obj-x86_64-linux-gnu/src/lib/chemistry/qc/mbptr12" && /usr/bin/c++   -DHAVE_CONFIG_H -DMPQC_R12 -g -O2 -std=c++11  -I"/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/obj-x86_64-linux-gnu/src/lib" -I"/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib" -I"/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/include" -I/usr/include/eigen3 -I/usr/include/libint2    -o CMakeFiles/mbptr12.dir/pt2r12.cc.o -c "/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc"
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc: In constructor ‘sc::PT2R12::PT2R12(const sc::Ref<sc::KeyVal>&)’:
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc:167:24: error: expected primary-expression before ‘&’ token
 PT2R12::PT2R12(StateIn &s) : Wavefunction(s) {
                        ^
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc:167:25: error: ‘s’ was not declared in this scope
 PT2R12::PT2R12(StateIn &s) : Wavefunction(s) {
                         ^
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc:167:26: error: cannot call constructor ‘sc::PT2R12::PT2R12’ directly [-fpermissive]
 PT2R12::PT2R12(StateIn &s) : Wavefunction(s) {
                          ^
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc:167:26: note: for a function-style cast, remove the redundant ‘::PT2R12’
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc:181:17: error: no matching function for call to ‘sc::PT2R12::~PT2R12()’
 PT2R12::~PT2R12() {
                 ^
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc:181:17: note: candidate is:
In file included from /home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc:31:0:
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.h:253:7: note: virtual sc::PT2R12::~PT2R12()
       ~PT2R12();
       ^
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.h:253:7: note:   candidate expects 2 arguments, 0 provided
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc:187:29: error: qualified-id in declaration before ‘(’ token
 void PT2R12::save_data_state(StateOut &s) {
                             ^
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc:199:17: error: qualified-id in declaration before ‘(’ token
 PT2R12::obsolete() {
                 ^
/home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150911/src/lib/chemistry/qc/mbptr12/pt2r12.cc:1948:1: error: expected ‘}’ at end of input
 }
 ^

Is this a supported configuration, and if so, is this a known issue or am I doing something wrong? MPQC3 builds fine for me if I omit Libint2.

pchong90 commented 9 years ago

Sorry about the inconvenience. There is a bug in pt2r12.cc.(08e982bae3f379b9a8a175d77b598e8070702abe)

I tested with the following options

-DLIBINT=/path_to_libint
-DBOOST=/path_to_boost
-DMPQC_CI=false
-DCMAKE_CXX_FLAGS=-std=c++11
-DMPI_C_COMPILER=clang
-DMPQC_R12=true

Can you pull the newest change and try it again? Let me know if you have other problems.

mbanck commented 9 years ago

Thanks it compiles fine now. I'm seeing various assertion errors at runtime when trying to run some of the f12 testsuite inputs or samples. E.g. src/bin/mpqc/sample/mp2r12.in fails with "keyword corr_param must be given when corrfactor=stg" and if I add "corr_param = 1.5", I get the following at the (I guess) end:

    E(MP2 OBS+CABS singles = (2)_S) =        -0.011248337730678
  Exited (2)_S energy evaluator
terminate called after throwing an instance of 'sc::Exception'
  what():  assertion failed, at /home/mbanck/debian/debichem/packages/mpqc3-0.0~git20150912/src/lib/chemistry/qc/basis/intdescr.h:109

That's a different issue though, so closing this one for now.

mbanck commented 9 years ago

Hrm, I figured out that this is due to 'stdapprox = "A'"' in that file; though I have to say the error message is not useful. If I change it to "stdapprox = C", the input runs fine.