Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Using ICC with ROS

Maneesh_Agrawala
Beginner
626 Views
Hi all,
I'm trying to use ICC to compile a package I've made for ROS (www.ros.org). My package depends on a package in the standard ROS library, called PCL, which has already been compiled, I believe using gcc. When I compile my code using gcc, it works fine. However, when I try to compile with icc, I get the following two errors:
/opt/ros/diamondback/stacks/perception_pcl/pcl/include/pcl/point_cloud.h(195):
error: argument list for class template "pcl::PointCloud" is missing friend
boost::shared_ptr& detail::getMapping(PointCloud& p);

and

/opt/ros/diamondback/stacks/perception_pcl/pcl/include/pcl/point_cloud.h(195):
error: declaration is incompatible with function template
"boost::shared_ptr<:MSGFIELDMAP>
&pcl::detail::getMapping(pcl::PointCloud &)" (declared at line 204)
friend boost::shared_ptr&
detail::getMapping(PointCloud& p); ^ detected during instantiation
of class "pcl::PointCloud [with PointT=rgbd::pt]" at line 64 of
"/home/rheld/Documents/Code/kinect/rgbd/branches/pcl/rgbd-ros-pkg/kinect_tracker/include/Model.h"

I believe these are the lines of code in question from Model.h:

typedef rgbd::pt PointT;

void loadTextCloud(char* fname, pcl::PointCloud &cloud);

struct AlignData {

pcl::PointCloud curr_cloud; (THIS IS LINE 64)

pcl::PointCloud cloud;

vector err_vector; int num_outliers;

Eigen::Transform3f xform;

Eigen::Transform3f temp_pose;

};
Any tips?
0 Kudos
5 Replies
Judith_W_Intel
Employee
626 Views

I'm afraid we're going to need more details on how to reproduce the errors. Can you post a preprocessed file (created using the icpc-P -E options)?

Also helpful would be:

(1) what version of icpc you are using
(2) what version of g++ you are using

thanks
Judy
0 Kudos
Maneesh_Agrawala
Beginner
626 Views
Hi Judy,
These are the lines I'm using in my CMakeLists file:
set (CMAKE_C_COMPILER /opt/intel/bin/icc)
set (CMAKE_CXX_COMPILER /opt/intel/bin/icpc)
set (CMAKE_C_EXECUTABLE /opt/intel/bin/xild)
set (CMAKE_CXX_EXECUTABLE /opt/intel/bin/xild)
set (CMAKE_C_FLAGS "-msse3 -ip -no-prec-div -parallel -O3 -fPIC " )
set (CMAKE_CXX_FLAGS "-msse3 -ip -no-prec-div -parallel -O3 -fPIC " )
set (CMAKE_EXE_LINKER_FLAGS "-Wl,-rpath,/opt/intel/lib -L/opt/intel/lib -lguide -lcxaguard -limf -lsvml -lirc -lpthread -lintlc" )
Which I got fromhttp://www.ros.org/wiki/rosbuild. Where should I place the -P -E options? And what kind of name will the preprocessed file have? Sorry, I'm a little new to this process.

~Robin
0 Kudos
Maneesh_Agrawala
Beginner
626 Views
Also, here are the compiler versions:
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
icpc (ICC) 12.0.4 20110427
~Robin
0 Kudos
TimP
Honored Contributor III
626 Views
icpc 12 no longer has a libguide. If you include -parallel in the options at link time, the current OpenMP library and -lpthread, as well as any other libraries needed from the compiler installation, would be added automatically by icpc in its invocation of the pre-link steps. I don't remember whether libcxaguard is still available, but it's preferable to simply use normal options rather than specifying a list of libraries associated with some past version of icpc and bypass the C compiler in its normal role for driving a link.
The -E -P options are pretty much similar to those use by g++ for pre-processing only, and you would specify the file name same as you would with g++. You're asking a lot to expect people to second guess you here, when you don't even show error messages.
0 Kudos
rheld1
Beginner
626 Views
(I'm the original poster, but was using Maneesh's account before).
Thanks for the feedback, Tim. I'll try making those changes. But what other error messages did you want? My first post included the error messages that I received from the compiler.
0 Kudos
Reply