educating ourselves on how to compile "correctly"

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

educating ourselves on how to compile "correctly"

Radu B. Rusu
Administrator
I think it's best to put up a page for "best practices" :) on how to compile PCL and projects depending on PCL
"correctly" (read the page to see what I mean). We've had a few bumps in the last few months regarding PCL_ROS's
excessive compile time and memory consumption, and I hope that we addressed some of those issues with the
refactorization done in 0.4 (damn you GCC!!!). There's still work to be done, and while we're at it I wonder if:

  * template specializations for nodelets will reduce the compile time (we dropped the templates in pcl_ros, but we
still rely on pcl::PointCloud<T>, even though T=PointXYZ almost always -- so building a specialization in PCL for
pcl::PointCloud<PointXYZ> might help?)

  * precompiled headers - I added some initial support, but didn't continue to integrate it properly due to lack of
time. This doesn't work with templates (obviously), and you need to gather most headers into a central header file and
precompile that.

  * at the opposite end, reduce all unneeded #includes from headers (especially base class headers) and include them
only where they are used, e.g., in CPP files. I've played with this a bit today and shoved off a few seconds from the
global pcl_ros compilation in trunk.

  * one awesome way of reducing compile time for a library is to include all its cpp components from the main file. See
pcl_ros/filters/filter.cpp to understand what I mean, and do some tests for yourself. Magic!

  * ... more... [maybe investigate the future clang releases and get rid of gcc? :)]


In the meantime, please add your comments or experiences to http://www.ros.org/wiki/pcl/Compiling. I've linked it to the
main wiki page so that new users can read it if they're interested.

--
Cheers,
Radu.

_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: educating ourselves on how to compile "correctly"

Radu B. Rusu
Administrator
I almost forgot:

http://www.network-theory.co.uk/docs/gccintro/gccintro_60.html

and

http://gcc.gnu.org/wiki/Visibility

might be very interesting within the next few days, as we're trying to make pcl_ros compile even faster for the 0.6 release.

Cheers,
Radu.


On 11/28/2010 11:28 PM, Radu Bogdan Rusu wrote:

> I think it's best to put up a page for "best practices" :) on how to compile PCL and projects depending on PCL
> "correctly" (read the page to see what I mean). We've had a few bumps in the last few months regarding PCL_ROS's
> excessive compile time and memory consumption, and I hope that we addressed some of those issues with the
> refactorization done in 0.4 (damn you GCC!!!). There's still work to be done, and while we're at it I wonder if:
>
> * template specializations for nodelets will reduce the compile time (we dropped the templates in pcl_ros, but we still
> rely on pcl::PointCloud<T>, even though T=PointXYZ almost always -- so building a specialization in PCL for
> pcl::PointCloud<PointXYZ> might help?)
>
> * precompiled headers - I added some initial support, but didn't continue to integrate it properly due to lack of time.
> This doesn't work with templates (obviously), and you need to gather most headers into a central header file and
> precompile that.
>
> * at the opposite end, reduce all unneeded #includes from headers (especially base class headers) and include them only
> where they are used, e.g., in CPP files. I've played with this a bit today and shoved off a few seconds from the global
> pcl_ros compilation in trunk.
>
> * one awesome way of reducing compile time for a library is to include all its cpp components from the main file. See
> pcl_ros/filters/filter.cpp to understand what I mean, and do some tests for yourself. Magic!
>
> * ... more... [maybe investigate the future clang releases and get rid of gcc? :)]
>
>
> In the meantime, please add your comments or experiences to http://www.ros.org/wiki/pcl/Compiling. I've linked it to the
> main wiki page so that new users can read it if they're interested.
>
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users