Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trunk does not build with CheMPS2 #414

Closed
susilehtola opened this issue Jun 19, 2016 · 3 comments · Fixed by #427
Closed

Trunk does not build with CheMPS2 #414

susilehtola opened this issue Jun 19, 2016 · 3 comments · Fixed by #427

Comments

@susilehtola
Copy link
Member

I just tried to build the present trunk using the instructions in the wiki
https://github.com/psi4/psi4/wiki/1_Obtaining#clonepsi4public

but the compilation fails in a bunch of unresolved symbols

/tmp/ccVe3Y02.ltrans0.ltrans.o: In function main': /home/work/psi4/psi4/objdir/interfaces/chemps2/src/interface_chemps2/CheMPS2/executable.cpp:512: undefined reference toCheMPS2::Irreps::Irreps(int)'
/home/work/psi4/psi4/objdir/interfaces/chemps2/src/interface_chemps2/CheMPS2/executable.cpp:513: undefined reference to CheMPS2::Irreps::getNumberOfIrreps() const' /home/work/psi4/psi4/objdir/interfaces/chemps2/src/interface_chemps2/CheMPS2/executable.cpp:541: undefined reference toCheMPS2::Irreps::symm_psi2molpro(int*) const'
/home/work/psi4/psi4/objdir/interfaces/chemps2/src/interface_chemps2/CheMPS2/executable.cpp:512: undefined reference to CheMPS2::Irreps::~Irreps()' /home/work/psi4/psi4/objdir/interfaces/chemps2/src/interface_chemps2/CheMPS2/executable.cpp:611: undefined reference toCheMPS2::Irreps::getGroupNameabi:cxx11 const'
/home/work/psi4/psi4/objdir/interfaces/chemps2/src/interface_chemps2/CheMPS2/executable.cpp:614: undefined reference to CheMPS2::Irreps::getIrrepName[abi:cxx11](int) const' /home/work/psi4/psi4/objdir/interfaces/chemps2/src/interface_chemps2/CheMPS2/executable.cpp:646: undefined reference toCheMPS2::Initialize::Init()'

When I look at the log file, it looks like the addition of the -flto flag in the CheMPS2 makefile breaks the CheMPS2 compile, in that when CMake creates the static archive there's a big bunch of messages like

[ 96%] Linking CXX static library libchemps2.a
BFD: CMakeFiles/chemps2-base.dir/CASPT2.cpp.o: plugin needed to handle lto object
BFD: CMakeFiles/chemps2-base.dir/CASSCF.cpp.o: plugin needed to handle lto object
BFD: CMakeFiles/chemps2-base.dir/CASSCFdebug.cpp.o: plugin needed to handle lto object
BFD: CMakeFiles/chemps2-base.dir/CASSCFnewtonraphson.cpp.o: plugin needed to handle lto object
BFD: CMakeFiles/chemps2-base.dir/CASSCFpt2.cpp.o: plugin needed to handle lto object

Commenting out the FLTO stuff in the CheMPS2 CMakeLists.txt results in a succesful compile.

$ gcc --version
gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
$ cmake --version
cmake version 3.4.3
$ git rev-parse --verify HEAD
b162ed1

@loriab
Copy link
Member

loriab commented Jun 19, 2016

Sounds like gcc-ar and gcc-ranlib are needed instead of the usual ar and ranlib. Either the flto needs to be specified in CMake by INTERPROCEDURAL_OPTIMIZATION property or CMake just isn't fully ready to support it for Gnu compilers. Do you want to try adding CMAKE_RANLIB and CMAKE_AR around here and if that works, we'll get @SebWouters to alter CheMPS2's CMake accordingly?

@susilehtola
Copy link
Member Author

As directed, I added
-DCMAKE_RANLIB=${CMAKE_RANLIB}
-DCMAKE_AR=${CMAKE_AR}
to ConfigChemps2.cmake, and added -DCMAKE_AR=/usr/bin/gcc-ar -D CMAKE_RANLIB=/usr/bin/gcc-ranlib to the setup command. Now it builds with the -flto flag in the CheMPS2 CMakeLists.txt.

@loriab
Copy link
Member

loriab commented Jun 28, 2016

I couldn't find a settled CMake way to handle this, so just noted the problem in the forthcoming CheMPS2 docs, added a FAQ in the Psi4 docs (https://github.com/psi4/psi4/wiki/9_CheMPS2#chemps2gccflto), and the changes to ConfigChemps2 will go in later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants