HDF5 compilation issue
Im getting:
[ 22%] Linking CXX shared library libeverybeam-oskar.so
CMakeFiles/hamaker.dir/hamakercoeff.cc.o: In function `GetComplexDoubleType()':
hamakercoeff.cc:(.text+0x4ab): undefined reference to `H5::CompType::CompType(unsigned long)'
hamakercoeff.cc:(.text+0x4bd): undefined reference to `H5::PredType::NATIVE_DOUBLE'
hamakercoeff.cc:(.text+0x4dc): undefined reference to `H5::CompType::insertMember(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, H5::DataType const&) const'
hamakercoeff.cc:(.text+0x514): undefined reference to `H5::CompType::insertMember(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, H5::DataType const&) const'
CMakeFiles/hamaker.dir/hamakercoeff.cc.o: In function `HamakerCoefficients::ReadCoefficients(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
hamakercoeff.cc:(.text+0x59c): undefined reference to `H5::FileAccPropList::DEFAULT'
hamakercoeff.cc:(.text+0x5a6): undefined reference to `H5::FileCreatPropList::DEFAULT'
hamakercoeff.cc:(.text+0x5d5): undefined reference to `H5::H5File::H5File(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, H5::FileCreatPropList const&, H5::FileAccPropList const&)'
hamakercoeff.cc:(.text+0x5dc): undefined reference to `H5::DSetAccPropList::DEFAULT'
hamakercoeff.cc:(.text+0x5f3): undefined reference to `H5::H5Location::openDataSet(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, H5::DSetAccPropList const&) const'
hamakercoeff.cc:(.text+0x60a): undefined reference to `H5::H5Object::openAttribute(char const*) const'
hamakercoeff.cc:(.text+0x621): undefined reference to `H5::H5Object::openAttribute(char const*) const'
hamakercoeff.cc:(.text+0x628): undefined reference to `H5::PredType::NATIVE_DOUBLE'
hamakercoeff.cc:(.text+0x639): undefined reference to `H5::Attribute::read(H5::DataType const&, void*) const'
hamakercoeff.cc:(.text+0x648): undefined reference to `H5::Attribute::read(H5::DataType const&, void*) const'
hamakercoeff.cc:(.text+0x658): undefined reference to `H5::DataSet::getSpace() const'
hamakercoeff.cc:(.text+0x660): undefined reference to `H5::DataSpace::getSimpleExtentNdims() const'
hamakercoeff.cc:(.text+0x69a): undefined reference to `H5::DataSpace::getSimpleExtentDims(unsigned long long*, unsigned long long*) const'
hamakercoeff.cc:(.text+0x6f2): undefined reference to `H5::AbstractDs::getDataType() const'
hamakercoeff.cc:(.text+0x6f9): undefined reference to `H5::DSetMemXferPropList::DEFAULT'
hamakercoeff.cc:(.text+0x712): undefined reference to `H5::DataSpace::ALL'
hamakercoeff.cc:(.text+0x71d): undefined reference to `H5::DataSet::read(void*, H5::DataType const&, H5::DataSpace const&, H5::DataSpace const&, H5::DSetMemXferPropList const&) const'
hamakercoeff.cc:(.text+0x725): undefined reference to `H5::DataType::~DataType()'
hamakercoeff.cc:(.text+0x735): undefined reference to `H5::DataSpace::~DataSpace()'
hamakercoeff.cc:(.text+0x73d): undefined reference to `H5::Attribute::~Attribute()'
hamakercoeff.cc:(.text+0x745): undefined reference to `H5::Attribute::~Attribute()'
hamakercoeff.cc:(.text+0x74d): undefined reference to `H5::DataSet::~DataSet()'
hamakercoeff.cc:(.text+0x756): undefined reference to `H5::H5File::~H5File()'
hamakercoeff.cc:(.text+0x7c0): undefined reference to `H5::DataSpace::getSimpleExtentDims(unsigned long long*, unsigned long long*) const'
CMakeFiles/hamaker.dir/hamakercoeff.cc.o: In function `HamakerCoefficients::WriteCoefficients(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
hamakercoeff.cc:(.text+0x8e1): undefined reference to `H5::FileAccPropList::DEFAULT'
hamakercoeff.cc:(.text+0x8eb): undefined reference to `H5::FileCreatPropList::DEFAULT'
hamakercoeff.cc:(.text+0x90e): undefined reference to `H5::H5File::H5File(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, H5::FileCreatPropList const&, H5::FileAccPropList const&)'
hamakercoeff.cc:(.text+0x959): undefined reference to `H5::DataSpace::DataSpace(int, unsigned long long const*, unsigned long long const*)'
hamakercoeff.cc:(.text+0x973): undefined reference to `H5::LinkCreatPropList::DEFAULT'
hamakercoeff.cc:(.text+0x99a): undefined reference to `H5::DSetAccPropList::DEFAULT'
hamakercoeff.cc:(.text+0x9a3): undefined reference to `H5::DSetCreatPropList::DEFAULT'
hamakercoeff.cc:(.text+0x9ab): undefined reference to `H5::H5Location::createDataSet(char const*, H5::DataType const&, H5::DataSpace const&, H5::DSetCreatPropList const&, H5::DSetAccPropList const&, H5::LinkCreatPropList const&) const'
hamakercoeff.cc:(.text+0x9b9): undefined reference to `H5::DataSpace::ALL'
hamakercoeff.cc:(.text+0x9c7): undefined reference to `H5::DSetMemXferPropList::DEFAULT'
hamakercoeff.cc:(.text+0x9d2): undefined reference to `H5::DataSet::write(void const*, H5::DataType const&, H5::DataSpace const&, H5::DataSpace const&, H5::DSetMemXferPropList const&) const'
hamakercoeff.cc:(.text+0x9e3): undefined reference to `H5::DataSpace::DataSpace(H5S_class_t)'
hamakercoeff.cc:(.text+0x9ea): undefined reference to `H5::PropList::DEFAULT'
hamakercoeff.cc:(.text+0xa12): undefined reference to `H5::PredType::NATIVE_DOUBLE'
hamakercoeff.cc:(.text+0xa2e): undefined reference to `H5::H5Object::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
hamakercoeff.cc:(.text+0xa44): undefined reference to `H5::Attribute::write(H5::DataType const&, void const*) const'
hamakercoeff.cc:(.text+0xa75): undefined reference to `H5::H5Object::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
hamakercoeff.cc:(.text+0xa8f): undefined reference to `H5::Attribute::write(H5::DataType const&, void const*) const'
hamakercoeff.cc:(.text+0xa99): undefined reference to `H5::H5Location::flush(H5F_scope_t) const'
hamakercoeff.cc:(.text+0xaa1): undefined reference to `H5::Attribute::~Attribute()'
hamakercoeff.cc:(.text+0xaad): undefined reference to `H5::Attribute::~Attribute()'
hamakercoeff.cc:(.text+0xab5): undefined reference to `H5::DataSpace::~DataSpace()'
hamakercoeff.cc:(.text+0xabd): undefined reference to `H5::DataSet::~DataSet()'
hamakercoeff.cc:(.text+0xac5): undefined reference to `H5::CompType::~CompType()'
hamakercoeff.cc:(.text+0xad1): undefined reference to `H5::DataSpace::~DataSpace()'
hamakercoeff.cc:(.text+0xad9): undefined reference to `H5::H5File::~H5File()'
CMakeFiles/hamaker.dir/hamakercoeff.cc.o: In function `GetComplexDoubleType() [clone .cold]':
hamakercoeff.cc:(.text.unlikely+0x15): undefined reference to `H5::CompType::~CompType()'
CMakeFiles/hamaker.dir/hamakercoeff.cc.o: In function `HamakerCoefficients::ReadCoefficients(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) [clone .cold]':
hamakercoeff.cc:(.text.unlikely+0x2f): undefined reference to `H5::DataType::~DataType()'
hamakercoeff.cc:(.text.unlikely+0x42): undefined reference to `H5::DataSpace::~DataSpace()'
hamakercoeff.cc:(.text.unlikely+0x4a): undefined reference to `H5::Attribute::~Attribute()'
hamakercoeff.cc:(.text.unlikely+0x52): undefined reference to `H5::Attribute::~Attribute()'
hamakercoeff.cc:(.text.unlikely+0x5a): undefined reference to `H5::DataSet::~DataSet()'
hamakercoeff.cc:(.text.unlikely+0x63): undefined reference to `H5::H5File::~H5File()'
CMakeFiles/hamaker.dir/hamakercoeff.cc.o: In function `HamakerCoefficients::WriteCoefficients(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) [clone .cold]':
hamakercoeff.cc:(.text.unlikely+0xa7): undefined reference to `H5::Attribute::~Attribute()'
hamakercoeff.cc:(.text.unlikely+0xb3): undefined reference to `H5::Attribute::~Attribute()'
hamakercoeff.cc:(.text.unlikely+0xbb): undefined reference to `H5::DataSpace::~DataSpace()'
hamakercoeff.cc:(.text.unlikely+0xc6): undefined reference to `H5::DataSet::~DataSet()'
hamakercoeff.cc:(.text.unlikely+0xce): undefined reference to `H5::CompType::~CompType()'
hamakercoeff.cc:(.text.unlikely+0xda): undefined reference to `H5::DataSpace::~DataSpace()'
hamakercoeff.cc:(.text.unlikely+0xe2): undefined reference to `H5::H5File::~H5File()'
collect2: error: ld returned 1 exit status
cpp/hamaker/CMakeFiles/hamaker.dir/build.make:115: recipe for target 'cpp/hamaker/libeverybeam-hamaker.so' failed
make[2]: *** [cpp/hamaker/libeverybeam-hamaker.so] Error 1
CMakeFiles/Makefile2:430: recipe for target 'cpp/hamaker/CMakeFiles/hamaker.dir/all' failed
make[1]: *** [cpp/hamaker/CMakeFiles/hamaker.dir/all] Error 2
Ubuntu 18, manually installed HDF5 1.10.4. Cmake seems to find it correctly:
-- Found HDF5: /opt/HDF5-1.10.4/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/opt/HDF5-1.10.4/lib/libhdf5_cpp.so;/opt/HDF5-1.10.4/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.10.4") found components: C CXX
HDF5 1.8.21 (form Ubuntu 16), 1.10.0-patch1 (Ubuntu 18) and 1.12.0 also crashes.