PointCloudLibrary / PointCloudLibrary/pcl

[tutorials] Compile issue related to random number generation

Open
#5,097 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind: bug status: triage
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up β€” it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running .ci/scripts/build_tutorials.sh with Clang 13 and inspect the tutorial source containing the reported RAND_MAX conversion. Then read tutorials.yaml to determine whether tutorial builds are configured for Azure CI. Done means the reported compilation issue and the CI coverage question are resolved, with the tutorial build summary checked.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.