SebWouters / CheMPS2

CheMPS2: a spin-adapted implementation of DMRG for ab initio quantum chemistry
GNU General Public License v2.0
70 stars 34 forks source link

CASPT2::solve signature trouble #43

Closed loriab closed 8 years ago

loriab commented 8 years ago

So Psi4+CheMPS2 is broken again with 1.7.1. It seems to be down to the CASPT2::solve function signature, which did change from 1.7: https://github.com/SebWouters/CheMPS2/compare/v1.7...v1.7.1 As shown below, when I do a psi4 build where CMake goes off and grabs the 1.7.1 tag, compiles and installs it locally, then psi4 tries linking against the static, it complains about the solve sig, then when I fix it to add the default second arg, it complains anyway. Some preliminary facts:

Any ideas? @ryanmrichard, any reason a static library should be less able to handle signatures with default args? (here's the doxygen for you: http://sebwouters.github.io/CheMPS2/doxygen/classCheMPS2_1_1CASPT2.html#acda216c42c5245d79ae398ec59f2253f) I've looked at the link lines and I don't see anywhere an old 1.7 header could be lurking. I'm at a loss, so seeking ideas.

1 arg

existing code

>>> cat ../src/bin/dmrg/dmrgscf.cc | grep solve
            E_CASPT2 = myCASPT2->solve( dmrg_imag_shift );

compile fails in Internal build against libchemps2.a:

[ 98%] Linking CXX executable ../../../bin/psi4
../../../lib/libdmrg.a(dmrgscf.cc.o): In function `psi::dmrg::dmrg(boost::shared_ptr<psi::Wavefunction>, psi::Options&)':
dmrgscf.cc:(.text+0xa1d9): undefined reference to `CheMPS2::CASPT2::solve(double) const'
make[2]: *** [bin/psi4] Error 1
make[1]: *** [src/bin/psi4/CMakeFiles/psi4.dir/all] Error 2
make: *** [all] Error 2

two arguments in lib sig

>>> nm interfaces/chemps2/install/lib/libchemps2.a --demangle | grep solve
0000000000000000 T CheMPS2::CASPT2::solve(double, bool) const
0000000000000000 T CheMPS2::CASSCF::solve(int, int, int, CheMPS2::ConvergenceScheme*, int, CheMPS2::DMRGSCFoptions*)
                 U CheMPS2::CASPT2::solve(double, bool) const
0000000000000000 T CheMPS2::DMRG::solve_site(int, double, double, int, bool, bool, bool)
0000000000000000 T CheMPS2::DMRG::solve_fock(int, int, double, double)
0000000000000000 T CheMPS2::DMRG::solve_fock_update_helper(int, int, int, bool, CheMPS2::TensorT**, CheMPS2::TensorT**, CheMPS2::SyBookkeeper*, CheMPS2::SyBookkeeper*, CheMPS2::TensorO**, CheMPS2::TensorL**, CheMPS2::TensorL**)

2 arg

so I try to supply the second (supposedly default) arg

>>> cat ../src/bin/dmrg/dmrgscf.cc | grep solve
            E_CASPT2 = myCASPT2->solve( dmrg_imag_shift, false );

compile fails in Internal build against libchemps2.a:

/shortened/psi4/src/bin/dmrg/dmrgscf.cc(1060): error #140: too many arguments in function call
              E_CASPT2 = myCASPT2->solve( dmrg_imag_shift, false );
                                                           ^

compilation aborted for /shortened/psi4/src/bin/dmrg/dmrgscf.cc (code 2)
make[2]: *** [src/bin/dmrg/CMakeFiles/dmrg.dir/dmrgscf.cc.o] Error 2
make[1]: *** [src/bin/dmrg/CMakeFiles/dmrg.dir/all] Error 2
make: *** [all] Error 2

signature shows 2 args

>>> cat interfaces/chemps2/install/include/chemps2/CASPT2.h | grep solve
         double solve( const double imag_shift, const bool CONJUGATE_GRADIENT = false ) const;
SebWouters commented 8 years ago

Hmmm. That's indeed very odd. @wpoely86 : Do you have any idea?

wpoely86 commented 8 years ago

Did you start from a clean build directory?

loriab commented 8 years ago

Yes, a fresh build directory within a well-used clone. And I hid pre-built libchemps files that I thought it might detect. But I hadn't hidden the includes dir that contained a 1.7 chemps2 headers dir because hdf5, etc. headers were also there. With that includes/chemps2 blown away, Psi4+CheMPS2-1.7.1 works fine, yay!