YuvalNirkin / face_swap

End-to-end, automatic face swapping pipeline
GNU General Public License v3.0
822 stars 203 forks source link

HDF5 compilation issue #17

Closed chrischen closed 6 years ago

chrischen commented 6 years ago

Getting stuck at 90% when HDF5 is referenced. This is on Ubuntu 16.04 with HDF5 v 1.8.20.

cmake . CMake outputs: -- Found HDF5: /usr/local/lib/libhdf5_hl.so;/usr/local/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.8.20")

cmake --build . Build results in this error:

[ 90%] Linking CXX executable face_swap_image
../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function `face_swap::readH5Dataset(H5::H5File const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
basel_3dmm.cpp:(.text+0x604): undefined reference to `H5::CommonFG::openDataSet(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
basel_3dmm.cpp:(.text+0x614): undefined reference to `H5::AbstractDs::getTypeClass() const'
basel_3dmm.cpp:(.text+0x62d): undefined reference to `H5::DataSet::getSpace() const'
basel_3dmm.cpp:(.text+0x645): undefined reference to `H5::DataSpace::getSimpleExtentDims(unsigned long long*, unsigned long long*) const'
basel_3dmm.cpp:(.text+0x67e): undefined reference to `H5::DSetMemXferPropList::DEFAULT'
basel_3dmm.cpp:(.text+0x69c): undefined reference to `H5::DataSpace::DataSpace(int, unsigned long long const*, unsigned long long const*)'
basel_3dmm.cpp:(.text+0x6a3): undefined reference to `H5::PredType::NATIVE_FLOAT'
basel_3dmm.cpp:(.text+0x6d4): undefined reference to `H5::DataSet::read(void*, H5::DataType const&, H5::DataSpace const&, H5::DataSpace const&, H5::DSetMemXferPropList const&) const'
basel_3dmm.cpp:(.text+0x6e0): undefined reference to `H5::DataSpace::~DataSpace()'
basel_3dmm.cpp:(.text+0x6ed): undefined reference to `H5::DataSpace::~DataSpace()'
basel_3dmm.cpp:(.text+0x6f9): undefined reference to `H5::DataSet::~DataSet()'
basel_3dmm.cpp:(.text+0x721): undefined reference to `H5::DataSpace::~DataSpace()'
basel_3dmm.cpp:(.text+0x732): undefined reference to `H5::DataSpace::~DataSpace()'
basel_3dmm.cpp:(.text+0x743): undefined reference to `H5::DataSet::~DataSet()'
../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function `face_swap::Basel3DMM::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
basel_3dmm.cpp:(.text+0x135f): undefined reference to `H5::Exception::dontPrint()'
basel_3dmm.cpp:(.text+0x1366): undefined reference to `H5::FileAccPropList::DEFAULT'
basel_3dmm.cpp:(.text+0x1370): undefined reference to `H5::FileCreatPropList::DEFAULT'
basel_3dmm.cpp:(.text+0x13b3): undefined reference to `H5::H5File::H5File(char const*, unsigned int, H5::FileCreatPropList const&, H5::FileAccPropList const&)'
basel_3dmm.cpp:(.text+0x1a59): undefined reference to `H5::H5File::~H5File()'
basel_3dmm.cpp:(.text+0x1d5c): undefined reference to `H5::H5File::~H5File()'
basel_3dmm.cpp:(.text+0x1dc6): undefined reference to `H5::Exception::getDetailMsg[abi:cxx11]() const'
basel_3dmm.cpp:(.text+0x1e39): undefined reference to `H5::DataSetIException::~DataSetIException()'
../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function `H5::DataSetIException::DataSetIException(H5::DataSetIException const&)':
basel_3dmm.cpp:(.text._ZN2H517DataSetIExceptionC2ERKS0_[_ZN2H517DataSetIExceptionC5ERKS0_]+0x1f): undefined reference to `H5::Exception::Exception(H5::Exception const&)'
basel_3dmm.cpp:(.text._ZN2H517DataSetIExceptionC2ERKS0_[_ZN2H517DataSetIExceptionC5ERKS0_]+0x26): undefined reference to `vtable for H5::DataSetIException'
../face_swap/libface_swap.a(basel_3dmm.cpp.o):(.data.DW.ref._ZTIN2H517DataSetIExceptionE[DW.ref._ZTIN2H517DataSetIExceptionE]+0x0): undefined reference to `typeinfo for H5::DataSetIException'
collect2: error: ld returned 1 exit status
face_swap_image/CMakeFiles/face_swap_image.dir/build.make:172: recipe for target 'face_swap_image/face_swap_image' failed
make[2]: *** [face_swap_image/face_swap_image] Error 1
CMakeFiles/Makefile2:253: recipe for target 'face_swap_image/CMakeFiles/face_swap_image.dir/all' failed
make[1]: *** [face_swap_image/CMakeFiles/face_swap_image.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

HDF5 is installed into /usr/local

chrischen commented 6 years ago

Fixed by changing references in CMakeLists.txt to libhdf5_cpp.so.

tjusxh commented 6 years ago

I come across the same question with you. Please could you describe how to change the references in CMakeLists.txt? Thanks