PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.83k stars 4.6k forks source link

[tutorials] Compile issue related to random number generation #5097

Open SunBlack opened 2 years ago

SunBlack commented 2 years ago

Tried to compile the tutorials via the .ci/scripts/build_tutorials.sh with Clang 13 (default Clang on Ubuntu 21.10)

error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion]
      n_cloud_b[i].normal[2] = 1024 * rand () / (RAND_MAX + 1.0f);
                                                 ^~~~~~~~ ~
/usr/include/stdlib.h:86:18: note: expanded from macro 'RAND_MAX'
#define RAND_MAX        2147483647
                        ^~~~~~~~~~

Result of building all tutorials:

Tutorial build summary
----------------------

alignment_prerejective                          šŸ—ø  
bare_earth                                      šŸ—ø  
bspline_fitting                                 šŸ—ø  
cloud_viewer                                    šŸ—ø  
cluster_extraction                              šŸ—ø  
concatenate_clouds                              š„‚  build error
concatenate_fields                              š„‚  build error
concatenate_points                              š„‚  build error
concave_hull_2d                                 šŸ—ø  
conditional_euclidean_clustering                š„‚  build error
conditional_removal                             š„‚  build error
convex_hull_2d                                  šŸ—ø  
correspondence_grouping                         šŸ—ø  
cylinder_segmentation                           šŸ—ø  
davidsdk                                        š„‚  cmake error
don_segmentation                                š„‚  build error
ensenso_cameras                                 š„‚  cmake error
extract_indices                                 šŸ—ø  
function_filter                                 šŸ—ø  
global_hypothesis_verification                  šŸ—ø  
gpu                                             š„‚  cmake error
greedy_projection                               šŸ—ø  
ground_based_rgbd_people_detection              šŸ—ø  
iccv2011                                        šŸ—ø  
implicit_shape_model                            šŸ—ø  
interactive_icp                                 šŸ—ø  
iros2011                                        š„‚  build error
iterative_closest_point                         š„‚  build error
kdtree_search                                   š„‚  build error
matrix_transform                                šŸ—ø  
min_cut_segmentation                            šŸ—ø  
model_outlier_removal                           š„‚  build error
moment_of_inertia                               šŸ—ø  
narf_descriptor_visualization                   šŸ—ø  
narf_feature_extraction                         šŸ—ø  
narf_keypoint_extraction                        šŸ—ø  
normal_distributions_transform                  šŸ—ø  
normal_estimation_using_integral_images         šŸ—ø  
octree_change_detection                         š„‚  build error
octree_search                                   š„‚  build error
openni_grabber                                  šŸ—ø  
openni_narf_keypoint_extraction                 šŸ—ø  
openni_range_image_visualization                šŸ—ø  
pairwise_incremental_registration               šŸ—ø  
passthrough                                     š„‚  build error
pcd_read                                        šŸ—ø  
pcd_write                                       š„‚  build error
pcl_painter2D                                   šŸ—ø  
pcl_plotter                                     šŸ—ø  
pcl_visualizer                                  šŸ—ø  
planar_segmentation                             š„‚  build error
point_cloud_compression                         šŸ—ø  
project_inliers                                 š„‚  build error
qt_colorize_cloud                               š„‚  build error
qt_visualizer                                   š„‚  build error
radius_outlier_removal                          š„‚  build error
random_sample_consensus                         šŸ—ø  
range_image_border_extraction                   šŸ—ø  
range_image_creation                            šŸ—ø  
range_image_visualization                       šŸ—ø  
region_growing_rgb_segmentation                 šŸ—ø  
region_growing_segmentation                     šŸ—ø  
registration_api                                šŸ—ø  
remove_outliers                                 š„‚  build error
resampling                                      š„‚  build error
rops_feature                                    šŸ—ø  
statistical_removal                             šŸ—ø  
stick_segmentation                              šŸ—ø  
supervoxel_clustering                           šŸ—ø  
template_alignment                              šŸ—ø  
tracking                                        šŸ—ø  
vfh_recognition                                 šŸ—ø  
voxel_grid                                      šŸ—ø  

Succeeded building 49 out of 73 tutorials
Excluded or skipped 0 tutorials

As far as I remember: Should the tutorials are be build on the CI? On Azure I don't see it, even tutorials.yaml still exists.

mvieth commented 2 years ago

Yes, on azure they are built as part of the "Documentation" pipeline (Ubuntu 18.04, GCC). So to fix these warnings, I guess the random number generation should be rewritten ... there are similar cases of this problem in the tests