Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pcl] Add cuda and tools option #2775

Merged
merged 4 commits into from
Mar 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions ports/pcl/CONTROL
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Source: pcl
Version: 1.8.1-9
Version: 1.8.1-10
Description: Point Cloud Library (PCL) is open source library for 2D/3D image and point cloud processing.
Build-Depends: eigen3, flann, qhull, vtk, boost-system, boost-filesystem, boost-thread, boost-date-time, boost-iostreams, boost-random, boost-foreach, boost-dynamic-bitset, boost-property-map, boost-graph, boost-multi-array, boost-signals2, boost-ptr-container, boost-uuid, boost-interprocess, boost-asio
Build-Depends: eigen3, flann, qhull, vtk, libpng, boost-system, boost-filesystem, boost-thread, boost-date-time, boost-iostreams, boost-random, boost-foreach, boost-dynamic-bitset, boost-property-map, boost-graph, boost-multi-array, boost-signals2, boost-ptr-container, boost-uuid, boost-interprocess, boost-asio

Feature: openni2
Description: OpenNI2 support for PCL
Expand All @@ -13,4 +13,12 @@ Build-Depends: vtk[qt]

Feature: pcap
Description: PCAP support for PCL
Build-Depends: winpcap
Build-Depends: winpcap

Feature: tools
Description: Build PCL utilities
Build-Depends: boost-accumulators

Feature: cuda
Description: CUDA support for PCL
Build-Depends: cuda
15 changes: 15 additions & 0 deletions ports/pcl/find_cuda.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/cmake/pcl_find_cuda.cmake b/cmake/pcl_find_cuda.cmake
index fd9cfa9..ae9e612 100644
--- a/cmake/pcl_find_cuda.cmake
+++ b/cmake/pcl_find_cuda.cmake
@@ -43,7 +43,9 @@ if(CUDA_FOUND)

# Find a complete list for CUDA compute capabilities at http://developer.nvidia.com/cuda-gpus

- if(NOT ${CUDA_VERSION_STRING} VERSION_LESS "8.0")
+ if(NOT ${CUDA_VERSION_STRING} VERSION_LESS "9.0")
+ set(__cuda_arch_bin "3.0 3.5 5.0 5.2 5.3 6.0 6.1 7.0")
+ elseif(NOT ${CUDA_VERSION_STRING} VERSION_LESS "8.0")
set(__cuda_arch_bin "2.0 2.1(2.0) 3.0 3.5 5.0 5.2 5.3 6.0 6.1")
elseif(NOT ${CUDA_VERSION_STRING} VERSION_LESS "6.5")
set(__cuda_arch_bin "2.0 2.1(2.0) 3.0 3.5 5.0 5.2")
27 changes: 24 additions & 3 deletions ports/pcl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ vcpkg_apply_patches(
"${CMAKE_CURRENT_LIST_DIR}/find_flann.patch"
"${CMAKE_CURRENT_LIST_DIR}/find_qhull.patch"
"${CMAKE_CURRENT_LIST_DIR}/find_openni2.patch"
"${CMAKE_CURRENT_LIST_DIR}/find_cuda.patch"
"${CMAKE_CURRENT_LIST_DIR}/vs2017-15.4-workaround.patch"
)

Expand All @@ -36,23 +37,35 @@ if("pcap" IN_LIST FEATURES)
set(WITH_PCAP ON)
endif()

set(WITH_CUDA OFF)
if("cuda" IN_LIST FEATURES)
set(WITH_CUDA ON)
endif()

set(BUILD_TOOLS OFF)
if("tools" IN_LIST FEATURES)
set(BUILD_TOOLS ON)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
# BUILD
-DBUILD_surface_on_nurbs=ON
-DBUILD_tools=OFF
-DBUILD_tools=${BUILD_TOOLS}
-DBUILD_CUDA=${WITH_CUDA}
-DBUILD_GPU=${WITH_CUDA} # build GPU when use CUDA
# PCL
-DPCL_BUILD_WITH_BOOST_DYNAMIC_LINKING_WIN32=${PCL_SHARED_LIBS}
-DPCL_BUILD_WITH_FLANN_DYNAMIC_LINKING_WIN32=${PCL_SHARED_LIBS}
-DPCL_SHARED_LIBS=${PCL_SHARED_LIBS}
# WITH
-DWITH_CUDA=OFF
-DWITH_CUDA=${WITH_CUDA}
-DWITH_LIBUSB=OFF
-DWITH_OPENNI2=${WITH_OPENNI2}
-DWITH_PCAP=${WITH_PCAP}
-DWITH_PNG=OFF
-DWITH_PNG=ON
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should libpng be added as a dependency because of this?

Copy link
Contributor Author

@cmpute cmpute Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be, but pcl depends on vtk which takes libpng as a dependency, so adding it as a dependency is not necessary

-DWITH_QHULL=ON
-DWITH_QT=${WITH_QT}
-DWITH_VTK=ON
Expand All @@ -64,5 +77,13 @@ vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

if(BUILD_TOOLS)
file(GLOB EXEFILES_RELEASE ${CURRENT_PACKAGES_DIR}/bin/*.exe)
file(GLOB EXEFILES_DEBUG ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
file(COPY ${EXEFILES_RELEASE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/pcl)
file(REMOVE ${EXEFILES_RELEASE} ${EXEFILES_DEBUG})
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/pcl)
endif()

file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/pcl)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/pcl/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/pcl/copyright)