YuvalNirkin / face_swap

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

Make error,Help! #6

Closed inkImage closed 7 years ago

inkImage commented 7 years ago

Hello, When I make the projcect, it is wrong.The information below.Can you give me some suggestion.Thanks.


Make: face_swap-master/build$ make [ 9%] Built target cv_gl [ 50%] Built target iris_sfs [ 81%] Built target face_swap [ 86%] Linking CXX executable face_swap_image ../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function `face_swap::readH5Dataset(H5::H5File make[2]: [face_swap_image/face_swap_image] Error 1 make[1]: [face_swap_image/CMakeFiles/face_swap_image.dir/all] Error 2 make: *** [all] Error 2

hoamle commented 7 years ago

You also need to link to libhdf5_hl_cpp.so and libhdf5_cpp.so. In face_swap/face_swap/CMakeLists.txt, add /path/to/libhdf5_hl_cpp.so and /path/to/libhdf5_cpp.so to target_link_libraries(face_swap ... ) after ${HDF5_LIBRARIES} (#L38)

Both files are most likely included in your anaconda2's library directory (/home/zmce/anaconda2/lib/, as are libhdf5_hl.so and libhdf5.so).

YuvalNirkin commented 7 years ago

Don't rely on the libraries that come with Anaconda. Download the binaries from the official site or build your own version of HDF5.

inkImage commented 7 years ago

Hi, @hoamle , It is be fixed.Thanks

noirblack commented 6 years ago

Hi, @inkImage I get the same error, but I am not clearly have to fix it. I can't find ${HDF5_LIBRARIES} in CMakeList.txt. Could you help me? Thanks.

tjusxh commented 6 years ago

@hoamle According to your suggestion. I change the CMakeList.txt as following. But my question still exist. Please give me some suggestion. Thanks very much! if(MSVC)

Find HDF5 using it's hdf5-config.cmake file with MSVC

if(DEFINED HDF5_DIR) list(APPEND CMAKE_MODULE_PATH ${HDF5_DIR}) endif() find_package(HDF5 COMPONENTS C HL CXX REQUIRED) set(HDF5_LIBRARIES hdf5-shared hdf5_cpp-shared) set(HDF5_HL_LIBRARIES hdf5_hl-shared) target_link_libraries(face_swap "/usr/lib/x86_64-linux-gnu/libhdf5_cpp.so") target_link_libraries(face_swap "/usr/lib/x86_64-linux-gnu/libhdf5_hl_cpp.so") else() find_package(HDF5 COMPONENTS HL REQUIRED) endif()

My libhdf5_cpp.so and libhdf5_hl_cpp.so are located in /usr/lib/x86_64-linux-gnu. default

hoamle commented 6 years ago

@tjusxh You need to edit the CMakeList.txt in subdirectory ./face_swap (i.e. face_swap/face_swap/CMakeLists.txt, not the one at the project root (i.e. not face_swap/CMakeLists.txt).

I just edited the previous comment to make it clearer.