Skip to content
Open
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
22 changes: 16 additions & 6 deletions recipes/pcl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class PclConan(ConanFile):
"with_cuda": False,
"with_flann": True,
"with_libusb": True,
"with_opencv": True,
"with_opencv": False,
"with_opengl": True,
"with_openmp": False,
"with_pcap": True,
Expand Down Expand Up @@ -193,16 +193,23 @@ def _external_deps(self):
def _external_optional_deps(self):
return {
"2d": ["vtk"],
"io": ["davidsdk", "dssdk", "ensenso", "fzapi", "libusb", "openni", "openni2", "pcap", "png", "rssdk", "rssdk2", "vtk"],
"io": ["davidsdk", "dssdk", "ensenso", "fzapi", "libusb", "openni", "openni2", "pcap", "png", "rssdk", "rssdk2", "vtk", "opencv"],
"kdtree": ["flann"],
"people": ["openni"],
"recognition": ["metslib"],
"recognition": ["metslib", "opencv"],
"search": ["flann"],
"simulation": ["opengl"],
"surface": ["qhull", "vtk"],
"surface": ["qhull", "vtk", "openmp"],
"stereo": ["opencv"],
"visualization": ["davidsdk", "dssdk", "ensenso", "opengl", "openni", "openni2", "qvtk", "rssdk"],
"apps": ["cuda", "libusb", "opengl", "openni", "png", "qhull", "qt", "qvtk", "vtk"],
"apps": ["cuda", "libusb", "opengl", "openni", "png", "qhull", "qt", "qvtk", "vtk", "openmp"],
"tools": ["cuda", "davidsdk", "dssdk", "ensenso", "opencv", "opengl", "openni", "openni2", "qhull", "rssdk", "vtk"],
"filters": ["openmp"],
"features": ["openmp"],
"registration": ["openmp"],
"tracking": ["openmp", "opencv"],
"keypoints": ["openmp"],
"segmentation": ["openmp"],
}

def _ext_dep_to_conan_target(self, dep):
Expand All @@ -221,6 +228,7 @@ def _ext_dep_to_conan_target(self, dep):
"metslib": [],
"opencv": ["opencv::opencv"],
"opengl": ["opengl::opengl", "freeglut::freeglut", "glew::glew", "glu::glu" if is_apple_os(self) or self.settings.os == "Windows" else "mesa-glu::mesa-glu"],
"openmp": [],
"openni": [],
"openni2": [],
"pcap": ["libpcap::libpcap"],
Expand Down Expand Up @@ -373,7 +381,6 @@ def _is_enabled(self, dep):

def requirements(self):
self.requires("boost/1.83.0", transitive_headers=True)
self.requires("eigen/[>=3.4.0 <4]", transitive_headers=True)
if self._is_enabled("flann"):
self.requires("flann/1.9.2", transitive_headers=True)
if self._is_enabled("png"):
Expand All @@ -397,6 +404,9 @@ def requirements(self):
self.requires("mesa-glu/9.0.3", transitive_headers=True)
if self._is_enabled("opencv"):
self.requires("opencv/[>=4.8.1 <5]", transitive_headers=True)
self.requires("eigen/3.4.0", transitive_headers=True)
else:
self.requires("eigen/[>=3.4.0 <4]", transitive_headers=True)
if self._is_enabled("zlib"):
self.requires("zlib/[>=1.2.11 <2]")
# TODO:
Expand Down
10 changes: 10 additions & 0 deletions recipes/pcl/all/test_package_omp/CMakeLists.txt
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove before merge

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.15)

project(test_package CXX)

find_package(PCL REQUIRED)

add_executable(${PROJECT_NAME} test_package.cpp)

target_link_libraries(${PROJECT_NAME} PRIVATE PCL::PCL)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
27 changes: 27 additions & 0 deletions recipes/pcl/all/test_package_omp/conanfile.py
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove before merge

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import cmake_layout, CMake
import os


# It will become the standard on Conan 2.x
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
test_type = "explicit"

def requirements(self):
self.requires(self.tested_reference_str)

def layout(self):
cmake_layout(self)

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindir, "test_package")
self.run(bin_path, env="conanrun")
32 changes: 32 additions & 0 deletions recipes/pcl/all/test_package_omp/test_package.cpp
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove before merge

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// TO BE REMOVED BEFORE MERGE
#include <iostream>
#include <pcl/point_types.h>
#include <pcl/features/normal_3d_omp.h>

int main()
{
// Create fake input cloud
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>());
cloud->resize(1000);
for (std::size_t i = 0; i < cloud->size(); i++) {
(*cloud)[i].x = float(i);
(*cloud)[i].y = float(i) * 0.1f;
(*cloud)[i].z = float(i) * 0.01f;
}

pcl::NormalEstimationOMP<pcl::PointXYZ, pcl::Normal> ne;

// Try using 4 threads
ne.setNumberOfThreads(4);
std::cout << "Requested threads = 4\n";

ne.setInputCloud(cloud);
ne.setRadiusSearch(0.1);

pcl::PointCloud<pcl::Normal> normals;
ne.compute(normals);

std::cout << "Computed normals: " << normals.size() << "\n";

return 0;
}