Compiling PCL 1.6 for android - patch

本文探讨了PCL (Point Cloud Library) 和 VTK (Visualization Toolkit) 的源码变更细节,包括narf特征描述子计算中的改进及VTK编译配置的调整。这些更改提高了代码的可读性和效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

~/pcl-superbuild/build/CMakeExternals/Source/pcl$ git diff
diff --git a/features/src/narf.cpp b/features/src/narf.cpp
index 23d6813..6b99500 100644
--- a/features/src/narf.cpp
+++ b/features/src/narf.cpp
@@ -457,7 +457,7 @@ Narf::getRotations (std::vector<float>& rotations, std::vector<float>& strengths
     {
       float value = descriptor_[descriptor_value_idx];
       float angle2 = static_cast<float> (descriptor_value_idx) * angle_step_size2;
-      float distance_weight = powf (1.0f - fabsf (normAngle (angle - angle2)) / deg2rad (180.0f), 2.0f);
+      float distance_weight = std::pow (1.0f - fabsf (normAngle (angle - angle2)) / deg2rad (180.0f), 2.0f);
       
       score += value * distance_weight;
     }
diff --git a/keypoints/src/narf_keypoint.cpp b/keypoints/src/narf_keypoint.cpp
index c0daf88..6ae677f 100644
--- a/keypoints/src/narf_keypoint.cpp
+++ b/keypoints/src/narf_keypoint.cpp
@@ -132,7 +132,7 @@ namespace
                 float optimal_distance, float& negative_score, float& positive_score)
   {
     negative_score = 1.0f - 0.5f * surface_change_score * (std::max) (1.0f - distance_factor/optimal_distance, 0.0f);
-    negative_score = powf (negative_score, 2);
+    negative_score = std::pow (negative_score, 2);
     
     if (pixelDistance < 2.0)
       positive_score = surface_change_score;
@@ -639,7 +639,7 @@ NarfKeypoint::calculateSparseInterestImage ()
       if (do_neighbor_size_reduction)
       {
         float min_distance_between_relevant_points = 0.25f * search_radius,
-              min_distance_between_relevant_points_squared = powf(min_distance_between_relevant_points, 2);
+              min_distance_between_relevant_points_squared = std::pow(min_distance_between_relevant_points, 2);
         for (int angle_histogram_idx=0; angle_histogram_idx<angle_histogram_size; ++angle_histogram_idx)
         {
           std::vector<std::pair<int,float> >& relevent_point_indices = angle_elements[angle_histogram_idx];
@@ -745,7 +745,7 @@ NarfKeypoint::calculateInterestPoints ()
   
   interest_points_ = new ::pcl::PointCloud<InterestPoint>;
   
-  float max_distance_squared = powf (0.3f*parameters_.support_size, 2);
+  float max_distance_squared = std::pow (0.3f*parameters_.support_size, 2);
   
   const RangeImage& range_image = range_image_border_extractor_->getRangeImage ();
   const ::pcl::PointCloud<BorderDescription>& border_descriptions =
@@ -871,7 +871,7 @@ NarfKeypoint::calculateInterestPoints ()
   
   std::sort (tmp_interest_points.begin (), tmp_interest_points.end (), isBetterInterestPoint);
   
-  float min_distance_squared = powf (parameters_.min_distance_between_interest_points*parameters_.support_size, 2);
+  float min_distance_squared = std::pow (parameters_.min_distance_between_interest_points*parameters_.support_size, 2);
   for (size_t int_point_idx=0; int_point_idx<tmp_interest_points.size (); ++int_point_idx)
   {

     if (parameters_.max_no_of_interest_points > 0  &&  int (interest_points_->size ()) >= parameters_.max_no_of_interest_points)



~/pcl-superbuild/build/CMakeExternals/Source/vtk$ git diff
diff --git a/CMake/GenerateExportHeader.cmake b/CMake/GenerateExportHeader.cmake
index e0897d4..ebbb741 100644
--- a/CMake/GenerateExportHeader.cmake
+++ b/CMake/GenerateExportHeader.cmake
@@ -174,7 +174,7 @@ macro(_test_compiler_hidden_visibility)
         _gcc_version "${_gcc_version_info}")
     endif()
 
-    if(${_gcc_version} VERSION_LESS "4.2")
+    if(_gcc_version VERSION_LESS "4.2")
       set(GCC_TOO_OLD TRUE)
     endif()
   endif()
diff --git a/CMake/vtkCompilerExtras.cmake b/CMake/vtkCompilerExtras.cmake
index 0b57437..f0bfffd 100644
--- a/CMake/vtkCompilerExtras.cmake
+++ b/CMake/vtkCompilerExtras.cmake
@@ -37,7 +37,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
   option(VTK_USE_GCC_VISIBILITY "Use GCC visibility support if available." OFF)
   mark_as_advanced(VTK_USE_GCC_VISIBILITY)
 
-  if(${_gcc_version} VERSION_GREATER 4.2.0 AND BUILD_SHARED_LIBS
+  if(_gcc_version VERSION_GREATER 4.2.0 AND BUILD_SHARED_LIBS
     AND HAVE_GCC_VISIBILITY AND VTK_USE_GCC_VISIBILITY
     AND NOT MINGW AND NOT CYGWIN)
     # Should only be set if GCC is newer than 4.2.0

To compile a kernel for use in a multi-VM environment (such as a host VM), you'll typically follow these steps: 1. **Start with a base kernel configuration**: Choose or create a suitable kernel configuration that includes the necessary features for your multi-VM setup. This might include virtualization support, network drivers, and other relevant modules. 2. **Prepare the source code**: Clone or download the Linux kernel sources from the official repository. For example, if using kernel 3.10, refer to the `kernel 3.10` makefile analysis[^2], which may contain options like `CONFIG_STRIP_ASM_SYMS` for stripping assembly symbols for smaller size. 3. **Configure the kernel**: Run `make menuconfig` or `make defconfig` to set up the build configuration according to your requirements. Ensure you enable any necessary options for virtual machine support, such as KVM or Xen. 4. **Compile the kernel**: ```shell make vmlinux # Compiles the unstripped vmlinux binary ``` If you want a smaller image, consider: ```shell make bzImage # Builds the compressed bzImage for better performance ``` 5. **Create initramfs**: Since you're dealing with a host-VM, an initial RAM disk (`initrd`) might be required for booting. Use `make initramfs` to generate this file. 6. **Combine vmlinux and initrd**: Depending on your bootloader setup, you may need to create a combined image (e.g., `uImage` for U-Boot) that contains both the vmlinux and initrd data. For U-Boot, you'd modify the `uImage` tag accordingly[^4]. 7. **Deploy the kernel**: Copy the compiled kernel and initramfs to the appropriate locations within the host-VM's boot partition or firmware configuration. 8. **Test the boot process**: Boot the host-VM and verify that the new kernel boots successfully and can handle multiple VMs. Remember to tailor your build process based on your specific needs and the hardware architecture of the host and guest VMs.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值