pcl icon indicating copy to clipboard operation
pcl copied to clipboard

[tutorials] Compile issue related to random number generation

Open SunBlack opened this issue 3 years ago • 1 comments

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.

SunBlack avatar Dec 22 '21 20:12 SunBlack

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

mvieth avatar Dec 23 '21 13:12 mvieth