graphdeco-inria / gaussian-splatting

Original reference implementation of "3D Gaussian Splatting for Real-Time Radiance Field Rendering"
https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/
Other
14.75k stars 1.93k forks source link

Cannot not compile SIBR in Ubuntu (/usr/bin/ld: cannot find ... No such file or directory) #940

Open RyanPham19092002 opened 3 months ago

RyanPham19092002 commented 3 months ago

Hi! Thanks for your great work. But I got some issue when compile SIBR like the image below image In folder "extlibs", I download zip of each submodel and then build individual instead of clone and built based on dependencies.cmake file (I did it because my server has proxy blocking for gitlab) After I build each submodel, then I build cmake for SIBR but it get error /usr/bin/ld: cannot find -lglfw3: No such file or directory collect2: error: ld returned 1 exit status gmake[2]: [src/core/graphics/CMakeFiles/sibr_graphics.dir/build.make:410: src/core/graphics/libsibr_graphics.so] Error 1 gmake[1]: [CMakeFiles/Makefile2:717: src/core/graphics/CMakeFiles/sibr_graphics.dir/all] Error 2 gmake: *** [Makefile:136: all] Error 2

The content of modified CMakeLists.txt (I add some lib because I build each submodel individual):

"""--------------------------------------------------------------------------------------------------------------""" project(sibr_system)

file(GLOB SOURCES ".cpp" ".h" "*.hpp") source_group("Source Files" FILES ${SOURCES})

add_library(${PROJECT_NAME} SHARED ${SOURCES})

include_directories( ${Boost_INCLUDE_DIRS} ${picojson_INCLUDE_DIRS} ${rapidxml_INCLUDE_DIRS} /home/vinai/Workspace/phat-intern-dev/VinAI/hierarchical-3d-gaussians/SIBR_viewers/extlibs/imgui/examples/libs/glfw/include )

add_subdirectory(${CMAKE_SOURCE_DIR}/extlibs/rapidxml ${CMAKE_BINARY_DIR}/extlibs/rapidxml) add_subdirectory(${CMAKE_SOURCE_DIR}/extlibs/nativefiledialog ${CMAKE_BINARY_DIR}/extlibs/nativefiledialog) add_subdirectory(${CMAKE_SOURCE_DIR}/extlibs/picojson ${CMAKE_BINARY_DIR}/extlibs/picojson) add_subdirectory(${CMAKE_SOURCE_DIR}/extlibs/imgui ${CMAKE_BINARY_DIR}/extlibs/imgui)

link_directories(/home/vinai/Workspace/phat-intern-dev/VinAI/hierarchical-3d-gaussians/SIBR_viewers/extlibs/imgui/examples/libs/glfw/lib-vc2010-64) (I add GLFW)

if (WIN32) target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} picojson clrapidxml nfd glfw (added) ) else() target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} picojson rapidxml nativefiledialog glfw (added) ) endif()

add_definitions( -DSIBR_SYSTEM_EXPORTS -DBOOST_ALL_DYN_LINK )

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER ${SIBR_FOLDER})

High level macro to install in an homogen way all our ibr targets

include(install_runtime) ibr_install_target(${PROJECT_NAME} INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) ) """--------------------------------------------------------------------------------------------------------------""" The structure of glfw library in "imgui" folder: image

Can you help me how to adding correctly "GLFW" for this problem ? Thanks for your help

dharmasai21 commented 3 months ago

have you found the solution ?

RyanPham19092002 commented 3 months ago

Hi. Now I have don't have this problem when in ./SIBR_viewers/src/core/system/CMakeLists.txt, I add add_subdirectory(${CMAKE_SOURCE_DIR}/extlibs/rapidxml ${CMAKE_BINARY_DIR}/extlibs/rapidxml) add_subdirectory(${CMAKE_SOURCE_DIR}/extlibs/nativefiledialog ${CMAKE_BINARY_DIR}/extlibs/nativefiledialog) add_subdirectory(${CMAKE_SOURCE_DIR}/extlibs/picojson ${CMAKE_BINARY_DIR}/extlibs/picojson) add_subdirectory(${CMAKE_SOURCE_DIR}/extlibs/imgui ${CMAKE_BINARY_DIR}/extlibs/imgui) add_subdirectory(${CMAKE_SOURCE_DIR}/extlibs/xatlas ${CMAKE_BINARY_DIR}/extlibs/xatlas) add_subdirectory(${CMAKE_SOURCE_DIR}/extlibs/nanoflann ${CMAKE_BINARY_DIR}/extlibs/nanoflann) add_subdirectory(${CMAKE_SOURCE_DIR}/extlibs/mrf ${CMAKE_BINARY_DIR}/extlibs/mrf)

And when I built, it works (but I cannot run this app because my server is headless) Do you know how to use this app in headless server ? Thanks