Compile Avogadro 1.2 crashes with OpenBabel::OBMol
Closed this issue · 1 comments
Maybe somebody has experienced this before.
I am trying to compile avogadro 1.2 from source. My system is a Fedora 24 and got the OpenBabel and boost-python packages from the repository. When I try the cmake ../ everything seems normal but with the make -j2 command i get ir the end:
usr/include/eigen3/Eigen/src/Core/Matrix.h:127:7: required from ‘class Eigen::Matrix<double, 3, 1>’ /opt/avogadro/avogadro-1.2.0/build/libavogadro/include/avogadro/molecule.h:988:30: required from here /usr/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h:56:30: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits<double>::type {aka __vector(2) double}’ [-Wignored-attributes] >::type PacketReturnType; ^~~~~~~~~~~~~~~~ /opt/avogadro/avogadro-1.2.0/libavogadro/src/python/swig.cpp: In function ‘PyTypeObject* _PySwigObject_type()’: /opt/avogadro/avogadro-1.2.0/libavogadro/src/python/swig.cpp:480:7: warning: missing initializer for member ‘_typeobject::tp_version_tag’ [-Wmissing-field-initializers] }; ^ [ 97%] Linking CXX shared module ../../../lib/Avogadro.so CMakeFiles/python-module.dir/swig.cpp.o: In function
Molecule_OBMol(Avogadro::Molecule&)':
/opt/avogadro/avogadro-1.2.0/libavogadro/src/python/swig.cpp:554: undefined reference to OpenBabel::OBMol::OBMol(OpenBabel::OBMol const&)' /opt/avogadro/avogadro-1.2.0/libavogadro/src/python/swig.cpp:554: undefined reference to
OpenBabel::OBMol::~OBMol()'
/opt/avogadro/avogadro-1.2.0/libavogadro/src/python/swig.cpp:554: undefined reference to OpenBabel::OBMol::~OBMol()' collect2: error: ld returned 1 exit status libavogadro/src/python/CMakeFiles/python-module.dir/build.make:990: recipe for target 'lib/Avogadro.so' failed make[2]: *** [lib/Avogadro.so] Error 1 CMakeFiles/Makefile2:3301: recipe for target 'libavogadro/src/python/CMakeFiles/python-module.dir/all' failed make[1]: *** [libavogadro/src/python/CMakeFiles/python-module.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: *** [all] Error 2
But if I disable python support everything compiles fine.
I read here that if OpenBabel is built without Eigen2, these classes will be missing. But the python test
`
import openbabel
mol = openbabel.OBMol()
print 'Should print 0 (atoms)'
print mol.NumAtoms()
a = mol.NewAtom()
a.SetAtomicNum(6) # carbon atom
a.SetVector(0.0, 1.0, 2.0) # coordinates
b = mol.NewAtom()
mol.AddBond(1, 2, 1) # atoms indexed from 1
print 'Should print 2 (atoms)'
print mol.NumAtoms()
print 'Should print 1 (bond)'
print mol.NumBonds()
mol.Clear();
`
From the python biding documentation works fine. So I should have these classes.
Does anyone know how to solve this?
I apreciate any help
Ok. I "solved this adding the -lopenbabel library in the libavogadro/src/python/CMakeFiles/python-module.dir/link.txt file with the other libraries.