Skip to content

Commit

Permalink
Add pthread for unix platform
Browse files Browse the repository at this point in the history
  • Loading branch information
pfxuan committed Mar 23, 2024
1 parent 52f8cc8 commit 90a3377
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/ubuntu-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,18 @@ jobs:
-DCMAKE_C_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/libtorch \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install \
-DOPENSPLAT_BUILD_SIMPLE_TRAINER=ON
ninja
- name: Save Artifacts
uses: actions/upload-artifact@v4
with:
path: |
build/libgsplat.a
build/opensplat
build/simple_trainer
- name: Clean Compiler Cache
run: |
set -x
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ add_executable(opensplat opensplat.cpp point_io.cpp nerfstudio.cpp model.cpp kdt
set_property(TARGET opensplat PROPERTY CXX_STANDARD 17)
target_include_directories(opensplat PRIVATE ${PROJECT_SOURCE_DIR}/vendor/glm ${GPU_INCLUDE_DIRS})
target_link_libraries(opensplat PUBLIC ${STDPPFS_LIBRARY} ${GPU_LIBRARIES} ${GSPLAT_LIBS} ${TORCH_LIBRARIES} ${OpenCV_LIBS})
if (NOT WIN32)
target_link_libraries(opensplat PUBLIC pthread)
endif()
if(GPU_RUNTIME STREQUAL "HIP")
target_compile_definitions(opensplat PRIVATE USE_HIP __HIP_PLATFORM_AMD__)
elseif(GPU_RUNTIME STREQUAL "CUDA")
Expand All @@ -96,6 +99,9 @@ if(OPENSPLAT_BUILD_SIMPLE_TRAINER)
add_executable(simple_trainer simple_trainer.cpp project_gaussians.cpp rasterize_gaussians.cpp cv_utils.cpp)
target_include_directories(simple_trainer PRIVATE ${PROJECT_SOURCE_DIR}/vendor/glm ${GPU_INCLUDE_DIRS})
target_link_libraries(simple_trainer PUBLIC ${GPU_LIBRARIES} ${GSPLAT_LIBS} ${TORCH_LIBRARIES} ${OpenCV_LIBS})
if (NOT WIN32)
target_link_libraries(simple_trainer PUBLIC pthread)
endif()
set_property(TARGET simple_trainer PROPERTY CXX_STANDARD 17)
if(GPU_RUNTIME STREQUAL "HIP")
target_compile_definitions(simple_trainer PRIVATE USE_HIP __HIP_PLATFORM_AMD__)
Expand Down

0 comments on commit 90a3377

Please sign in to comment.