[ros-users] Error compiling tutorial

bdoshaughnessy bdoshaughnessy at gmail.com
Tue Jan 11 01:06:44 UTC 2011


Hi,

I'm new to ROS and am working my way through the tutorials but I'm receiving
an error while compiling the cylinder model segmentation example.  I created
the relevant file "segmentation_cylinder.cpp" in the proper location.  I
also added the two necessary lines of code to
/opt/ros/cturtle/stacks/point_cloud_perception/pcl/CMakeLists.txt.  The two
new lines are in bold below.  

Here is the entire CMakeLists.txt file:


cmake_minimum_required (VERSION 2.4.6)

include ($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
#set (ROS_BUILD_TYPE Release)
set (ROS_BUILD_TYPE RelWithDebInfo)
rosbuild_init ()
rosbuild_add_boost_directories ()
#add_definitions(-Wall -O3 -DNDEBUG -ffast-math -funroll-loops
-fomit-frame-pointer -pipe -mfpmath=sse -mmmx -msse -mtune=core2
-march=core2 -msse2 -msse3 -msse4)
###add_definitions(-Wall -O3 -DNDEBUG -ffast-math -funroll-loops
-ftree-vectorize -fomit-frame-pointer -pipe -mfpmath=sse -mmmx -msse
-mtune=core2 -march=core2 -msse2 -msse3 -mssse3)
#add_definitions(-Wall -O3 -pipe -funroll-loops -momit-leaf-frame-pointer
-fomit-frame-pointer -floop-block -ftree-loop-distribution
-ftree-loop-linear -floop-interchange -floop-strip-mine -DNDEBUG
-mfpmath=sse -msse3 -mssse3 -fgcse-lm -fgcse-sm -fsched-spec-load)
 #-Wall -O3 -DNDEBUG -mfpmath=sse -mmmx -msse -msse2 -msse3)
 #add_definitions(-Wall -DNDEBUG -O3 -msse3 -mssse3 )#-funroll-loops)
add_definitions (-Wall -O3 -Winvalid-pch -DNDEBUG -funroll-loops)#
-DEIGEN_NO_DEBUG)# -msse3 -mssse3 -std=c++0x)#-funroll-loops)
rosbuild_check_for_sse ()

rosbuild_genmsg ()
set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
include_directories (${CMAKE_CURRENT_BINARY_DIR})
include_directories (src)

include (PCLPCHSupport.cmake REQUIRED)

# ---[ Point Cloud Library
  rosbuild_add_library (pcl_base
                        src/pcl/pcl_base.cpp
                       )

  rosbuild_add_compile_flags (pcl_base ${SSE_FLAGS})

# ---[ Point Cloud Library - Features
  rosbuild_add_library (pcl_features
                        src/pcl/features/feature.cpp
                       )
  rosbuild_add_compile_flags (pcl_features ${SSE_FLAGS})
  rosbuild_add_openmp_flags (pcl_features)
  rosbuild_link_boost (pcl_features system filesystem)
  target_link_libraries (pcl_features tbb)

# ---[ Point Cloud Library - Features
  rosbuild_add_library (pcl_keypoints
                        src/pcl/keypoints/narf_keypoint.cpp
                       )
  rosbuild_add_compile_flags (pcl_keypoints ${SSE_FLAGS})
  rosbuild_add_openmp_flags (pcl_keypoints)

# ---[ Point Cloud Library - IO
  rosbuild_add_library (pcl_io
                      src/pcl/io/io.cpp
                      src/pcl/io/pcd_io.cpp
                     )
  rosbuild_add_compile_flags (pcl_io ${SSE_FLAGS})
  rosbuild_link_boost (pcl_io system filesystem)
  target_link_libraries (pcl_io tbb)

# ---[ Point Cloud Library - Surface
  rosbuild_add_library (pcl_surface
                        src/pcl/surface/convex_hull.cpp
                        src/pcl/surface/surface.cpp
                       )
  rosbuild_add_compile_flags (pcl_surface ${SSE_FLAGS})
  rosbuild_link_boost (pcl_surface system filesystem)
  target_link_libraries (pcl_features tbb)
# ---[ Point Cloud Library - Filters
  rosbuild_add_library (pcl_filters
                        src/pcl/filters/passthrough.cpp
                        src/pcl/filters/extract_indices.cpp
                        src/pcl/filters/filter.cpp
                        src/pcl/filters/project_inliers.cpp
                        src/pcl/filters/radius_outlier_removal.cpp
                        src/pcl/filters/statistical_outlier_removal.cpp
                        src/pcl/filters/voxel_grid.cpp
                       )

rosbuild_add_executable (tutorial_filter_voxel_grid
src/examples/filter_voxel_grid.cpp)
target_link_libraries (tutorial_filter_voxel_grid pcl_io pcl_filters)

  rosbuild_add_compile_flags (pcl_filters ${SSE_FLAGS})
  rosbuild_link_boost (pcl_filters system filesystem)
  target_link_libraries (pcl_filters pcl_base)
  # ---[ Point Cloud Library - Segmentation
  rosbuild_add_library (pcl_segmentation
                        src/pcl/segmentation/segmentation.cpp
                       )
  rosbuild_add_compile_flags (pcl_segmentation ${SSE_FLAGS})
  rosbuild_link_boost (pcl_segmentation system filesystem)
  # ---[ Point Cloud Library - Registration
  rosbuild_add_library (pcl_registration
                        src/pcl/registration/registration.cpp
                       )
  rosbuild_add_compile_flags (pcl_registration ${SSE_FLAGS})
  rosbuild_link_boost (pcl_registration system filesystem)
######
  # ---[ Point Cloud Library - RangeImage
  rosbuild_add_library (pcl_range_image
                        src/pcl/range_image/range_image.cpp
                       )
  rosbuild_add_compile_flags (pcl_range_image ${SSE_FLAGS})
  rosbuild_add_openmp_flags(pcl_range_image)

  rosbuild_add_library (pcl_range_image_border_extractor
                        src/pcl/features/range_image_border_extractor.cpp
                       )


rosbuild_add_executable (tutorial_segmentation_cylinder
src/examples/segmentation_cylinder.cpp)
target_link_libraries (tutorial_segmentation_cylinder pcl_io pcl_filters)


  target_link_libraries (pcl_range_image_border_extractor pcl_range_image)
  rosbuild_add_openmp_flags (pcl_range_image_border_extractor)

add_subdirectory (src/tools)
add_subdirectory (test)

# Option to generate a standalone tarball
add_custom_target (tarball ${PROJECT_SOURCE_DIR}/make_tarball
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM)
add_dependencies (tarball rospack_genmsg_all)


I then run: sudo cmake
/opt/ros/cturtle/stacks/point_cloud_perception/pcl/CMakeLists.txt 

and this error occurs:

CMake Error at CMakeLists.txt:3 (include):
  include could not find load file:

    /core/rosbuild/rosbuild.cmake


CMake Error at CMakeLists.txt:6 (rosbuild_init):
  Unknown CMake command "rosbuild_init".


-- Configuring incomplete, errors occurred!

I have confirmed that the rosbuild.cmake is in the rosbuild folder.  I have
also hardcoded the location on the second line and received the same error. 
Any help would be greatly appreciated.

Thanks!
Brendan

-- 
View this message in context: http://ros-users.122217.n3.nabble.com/Error-compiling-tutorial-tp2231920p2231920.html
Sent from the ROS-Users mailing list archive at Nabble.com.



More information about the ros-users mailing list