Building PCL-1.6.0 with MSVC 2012

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

Building PCL-1.6.0 with MSVC 2012

asckp
Hello,

I have been trying to build the latest stable release of PCL (1.6.0) with VC11 that is shipped with MSVC 2012.

I have not managed to get it to build past the linking stage, with the following error emitted from MSVC:
2>c:\software\software libraries\pcl-1.6.0-source\features\include\pcl\features\impl\shot_omp.hpp(183): fatal error C1002: compiler is out of heap space in pass 2
2>LINK : fatal error LNK1257: code generation failed

I tried changing the /Zm and /STACK options in the CMake file before building the library again, but the error above is repeated except from different positions in the same shot_omp.hpp file.

Using a combination of /Zm100 and /STACK:10000000, I get the following error instead:
6>     Creating library G:/PCL-1.6.0-vc11-64Bit-Build/lib/pcl_features.lib and object G:/PCL-1.6.0-vc11-64Bit-Build/lib/pcl_features.exp
6>  Generating code
6>LINK : fatal error C1510: Cannot load language resource clui.dll.

A check on Process Explorer seems to indicate that the linker executed until it hit the 4GB memory limit accessible to a 32-bit program in a 64-bit machine.

The issue occurs when I try to build both in 32-bit and 64-bit release modes. I did not attempt to build in debug as I believe some breaking changes are likely to be present due to change of defaults from VC10 to VC11 (perhaps like ITERATOR_DEBUG_LEVEL).

The following is my system configuration:
- Windows 7 Professional Edition 64-Bit
- Intel Core i7 2760QM (2.40GHz), 16GB RAM
- Microsoft Visual Studio 2012 Professional Edition
- CMake 2.8.9

And the following are the build dependencies' versions:
- Boost 1.51
- Flann 1.7.1
- VTK 5.10
- Eigen 3.1

I was able to get CMake to generate successfully by including MSVC11 and boost 1.51 in the CMake file settings.

Do let me know if you need more information from me regarding this matter.

As I am not certain if this is something that should be resolved at the library level or if I should get Microsoft to fix it, I will just post something here first.

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Building PCL-1.6.0 with MSVC 2012

Radu B. Rusu
Administrator
Unfortunately, I don't think we ever tested PCL with MSVC 2012. Our build machines run 2010 (and we used to test with
2008). It looks like the compiler is choking on simple C++ code though.

There's probably ways of rewriting the code inside SHOT OMP, but since all the other compilers seem to work fine, I
wonder if maybe filing a bug report with the Visual Studio dev team is more appropriate ? Of course, getting a
standalone minimally compilable code snippet will be a challenge in itself.

We would definitely appreciate any help that you can give us in debugging this issue. We'd love to have a solution for
it no matter what, as we don't like to leave our users stranded.

Cheers,
Radu.
--
http://openperception.org

On 09/08/2012 02:03 PM, asckp wrote:

> Hello,
>
> I have been trying to build the latest stable release of PCL (1.6.0) with
> VC11 that is shipped with MSVC 2012.
>
> I have not managed to get it to build past the linking stage, with the
> following error emitted from MSVC:
> 2>c:\software\software
> libraries\pcl-1.6.0-source\features\include\pcl\features\impl\shot_omp.hpp(183):
> fatal error C1002: compiler is out of heap space in pass 2
> 2>LINK : fatal error LNK1257: code generation failed
>
> I tried changing the /Zm and /STACK options in the CMake file before
> building the library again, but the error above is repeated except from
> different positions in the same shot_omp.hpp file.
>
> Using a combination of /Zm100 and /STACK:10000000, I get the following error
> instead:
> 6>     Creating library G:/PCL-1.6.0-vc11-64Bit-Build/lib/pcl_features.lib
> and object G:/PCL-1.6.0-vc11-64Bit-Build/lib/pcl_features.exp
> 6>  Generating code
> 6>LINK : fatal error C1510: Cannot load language resource clui.dll.
>
> A check on Process Explorer seems to indicate that the linker executed until
> it hit the 4GB memory limit accessible to a 32-bit program in a 64-bit
> machine.
>
> The issue occurs when I try to build both in 32-bit and 64-bit release
> modes. I did not attempt to build in debug as I believe some breaking
> changes are likely to be present due to change of defaults from VC10 to VC11
> (perhaps like ITERATOR_DEBUG_LEVEL).
>
> The following is my system configuration:
> - Windows 7 Professional Edition 64-Bit
> - Intel Core i7 2760QM (2.40GHz), 16GB RAM
> - Microsoft Visual Studio 2012 Professional Edition
> - CMake 2.8.9
>
> And the following are the build dependencies' versions:
> - Boost 1.51
> - Flann 1.7.1
> - VTK 5.10
> - Eigen 3.1
>
> I was able to get CMake to generate successfully by including MSVC11 and
> boost 1.51 in the CMake file settings.
>
> Do let me know if you need more information from me regarding this matter.
>
> As I am not certain if this is something that should be resolved at the
> library level or if I should get Microsoft to fix it, I will just post
> something here first.
>
> Thank you.
>
>
>
> --
> View this message in context: http://www.pcl-users.org/Building-PCL-1-6-0-with-MSVC-2012-tp4022101.html
> Sent from the Point Cloud Library (PCL) Users mailing list archive at Nabble.com.
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
>
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Building PCL-1.6.0 with MSVC 2012

mamoto
This post has NOT been accepted by the mailing list yet.
Hello.
i build PCL 1.7.0 and this is link to download:
http://www.mediafire.com/?hu8nnnlb6a66awa
it work oke, but i had a problem, i want to create a program in common language runtime support /cli but when i add: #include <pcl/io/openni_grabber.h> it didn't work, (my program use data input from kinect).
Admin can you tell me How to fix it!
thank you,
sorry my English !!
Reply | Threaded
Open this post in threaded view
|

Re: Building PCL-1.6.0 with MSVC 2012

asckp
In reply to this post by Radu B. Rusu
Hello Radu,

Sorry for my late reply. Lots of deadlines to meet. :(

I have contacted the VS development team as you suggested, but they moved my convseration off-topic with the reason that PCL is not a library they support.

I am still trying my luck with them despite this. Hopefully they can at least look at the problem and suggest something, because I still think this a problem with the compiler/linker toolchain since the PCL code compiles with VC11 with no other errors. This even suggests that the PCL code is C++11 ready (at least with VC11's implementation of C++11).

I could look at changing the code if VS is unable to support in the matter. But due to work commitments I think I can only look at this in Nov or even later. Perhaps by that time, PCL 1.7.0 would be out and it may even build in VC11?

Sorry for not being able to do more.
Reply | Threaded
Open this post in threaded view
|

Re: Building PCL-1.6.0 with MSVC 2012

mamoto
hi asckp!
i builded successful PCL 1.7.0 for VC 2011. some error when building but i fix it.
if you want i can send my Setup file ALL_IN_ONE.
Reply | Threaded
Open this post in threaded view
|

Re: Building PCL-1.6.0 with MSVC 2012

Yangyan Li
In reply to this post by Radu B. Rusu
I have the same error when compiling pcl trunk with VS 2012 with release, debug is ok(Win7 x64 with 16GB RAM).
---------
LINK : fatal error C1510: Cannot load language resource clui.dll.
---------

The problem is that the release link for pcl_features takes too much memory, larger than link.exe allows. I have 16 GB RAM and this error is thrown when less than half of the memory is used, so I am sure the bottle neck is at VS link.exe, but not running out of the physical RAM.

The workaround is to turn off the "Whole Program Optimization" option(/GL) of the compiler, which will disable the "Link Time Code Generation" option(/LTCG) of the linker thus reduce the memory usage of it, with the trade off of generating lib with less optimization.

Generally, the linking of pcl_features is very heavy, it will be great if it can be made a bit more light-weighted.
Reply | Threaded
Open this post in threaded view
|

Re: Building PCL-1.6.0 with MSVC 2012

Radu B. Rusu
Administrator

On 12/02/2012 10:34 PM, Yangyan Li wrote:

> I have the same error when compiling pcl trunk with VS 2012 with release,
> debug is ok(Win7 x64 with 16GB RAM).
> ---------
> LINK : fatal error C1510: Cannot load language resource clui.dll.
> ---------
>
> The problem is that the release link for pcl_features takes too much memory,
> larger than link.exe allows. I have 16 GB RAM and this error is thrown when
> less than half of the memory is used, so I am sure the bottle neck is at VS
> link.exe, but not running out of the physical RAM.
>
> The workaround is to turn off the "Whole Program Optimization" option(/GL)
> of the compiler, which will disable the "Link Time Code Generation"
> option(/LTCG) of the linker thus reduce the memory usage of it, with the
> trade off of generating lib with less optimization.
>
> Generally, the linking of pcl_features is very heavy, it will be great if it
> can be made a bit more light-weighted.

Contributions are always welcome ;) Try running the code through a compile profiler to see what causes MSVC to have such
a poor performance. GCC and clang have no problem in compiling this code even on old machines.

You can also try disabling the explicit instantiations in PCL features using either -DPCL_ONLY_CORE_POINT_TYPES=ON or
-DPCL_NO_PRECOMPILE=ON at the expense of extra time spent compiling your user code afterwards.

Cheers,
Radu.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Building PCL-1.6.0 with MSVC 2012

Preetham Manjunatha
In reply to this post by mamoto
Dear PCL-users,

PCL 1.6.0
Cmake 2.8.10
Windows 7 64 bit

I have MSVS 2012, I have tried pcl_write.cpp it worked properly and I got an output. Later when I tried to build the pcl_read.cpp. I am getting an error saying

  pcl_io_debug.dll!std::_Iterator_base12::_Adopt(const std::_Container_base12 * _Parent) Line 146 C++
  pcl_io_debug.dll!std::_Vector_const_iterator<std::_Vector_val<unsigned char,std::allocator<unsigned char> > >::_Vector_const_iterator<std::_Vector_val<unsigned char,std::allocator<unsigned char> > >(unsigned char * _Parg, const std::_Container_base12 * _Pvector) Line 46 C++
  pcl_io_debug.dll!std::_Vector_iterator<std::_Vector_val<unsigned char,std::allocator<unsigned char> > >::_Vector_iterator<std::_Vector_val<unsigned char,std::allocator<unsigned char> > >(unsigned char * _Parg, const std::_Container_base12 * _Pvector) Line 305 C++
  pcl_io_debug.dll!std::vector<unsigned char,std::allocator<unsigned char> >::end() Line 792 C++
  pcl_io_debug.dll!std::vector<unsigned char,std::allocator<unsigned char> >::clear() Line 1218 C++
  pcl_io_debug.dll!pcl::PCDReader::readHeader(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & file_name, sensor_msgs::PointCloud2 & cloud, Eigen::Matrix<float,4,1,0,4,1> & origin, Eigen::Quaternion<float,0> & orientation, int & pcd_version, int & data_type, unsigned int & data_idx, const int offset) Line 85 C++
  pcl_io_debug.dll!pcl::PCDReader::read(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & file_name, sensor_msgs::PointCloud2 & cloud, Eigen::Matrix<float,4,1,0,4,1> & origin, Eigen::Quaternion<float,0> & orientation, int & pcd_version, const int offset) Line 888 C++
> PCLibrary-Template_Checkread.exe!pcl::PCDReader::read<pcl::PointXYZ>(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & file_name, pcl::PointCloud<pcl::PointXYZ> & cloud, const int offset) Line 238 C++
  PCLibrary-Template_Checkread.exe!main(int argc, char * * argv) Line 14 C++
  PCLibrary-Template_Checkread.exe!__tmainCRTStartup() Line 536 C
  kernel32.dll!0000000076ae652d() Unknown
  ntdll.dll!00000000771dc521() Unknown


All the required include directories, libraries and additional dependencies are provided in the MSVS 2012. I presume MSVS 2012 vc11.0 is not working for the pcl 1.6.0. I would appreciate for any help.


Thank you,
Reply | Threaded
Open this post in threaded view
|

Re: Building PCL-1.6.0 with MSVC 2012

Radu B. Rusu
Administrator
I don't think 1.6 is compilable with VS 2012. You'd need to try trunk. Remember to compile all dependencies too.

Cheers,
Radu.
--
http://openperception.org

On 01/06/2013 06:38 AM, Preetham Manjunatha wrote:

> Dear PCL-users,
>
> PCL 1.6.0
> Cmake 2.8.10
> Windows 7 64 bit
>
> I have MSVS 2012, I have tried pcl_write.cpp it worked properly and I got an
> output. Later when I tried to build the pcl_read.cpp. I am getting an error
> saying
>
>     pcl_io_debug.dll!std::_Iterator_base12::_Adopt(const
> std::_Container_base12 * _Parent) Line 146 C++
>   pcl_io_debug.dll!std::_Vector_const_iterator<std::_Vector_val&lt;unsigned
> char,std::allocator&lt;unsigned char> >
>> ::_Vector_const_iterator<std::_Vector_val&lt;unsigned
> char,std::allocator&lt;unsigned char> > >(unsigned char * _Parg, const
> std::_Container_base12 * _Pvector) Line 46 C++
>   pcl_io_debug.dll!std::_Vector_iterator<std::_Vector_val&lt;unsigned
> char,std::allocator&lt;unsigned char> >
>> ::_Vector_iterator<std::_Vector_val&lt;unsigned
> char,std::allocator&lt;unsigned char> > >(unsigned char * _Parg, const
> std::_Container_base12 * _Pvector) Line 305 C++
>   pcl_io_debug.dll!std::vector<unsigned char,std::allocator<unsigned char>
>> ::end() Line 792 C++
>   pcl_io_debug.dll!std::vector<unsigned char,std::allocator<unsigned char>
>> ::clear() Line 1218 C++
>   pcl_io_debug.dll!pcl::PCDReader::readHeader(const
> std::basic_string<char,std::char_traits&lt;char>,std::allocator<char> > &
> file_name, sensor_msgs::PointCloud2 & cloud, Eigen::Matrix<float,4,1,0,4,1>
> & origin, Eigen::Quaternion<float,0> & orientation, int & pcd_version, int &
> data_type, unsigned int & data_idx, const int offset) Line 85 C++
>   pcl_io_debug.dll!pcl::PCDReader::read(const
> std::basic_string<char,std::char_traits&lt;char>,std::allocator<char> > &
> file_name, sensor_msgs::PointCloud2 & cloud, Eigen::Matrix<float,4,1,0,4,1>
> & origin, Eigen::Quaternion<float,0> & orientation, int & pcd_version, const
> int offset) Line 888 C++
>> PCLibrary-Template_Checkread.exe!pcl::PCDReader::read<pcl::PointXYZ>(const
> std::basic_string<char,std::char_traits&lt;char>,std::allocator<char> > &
> file_name, pcl::PointCloud<pcl::PointXYZ> & cloud, const int offset) Line
> 238 C++
>   PCLibrary-Template_Checkread.exe!main(int argc, char * * argv) Line 14 C++
>   PCLibrary-Template_Checkread.exe!__tmainCRTStartup() Line 536 C
>   kernel32.dll!0000000076ae652d() Unknown
>   ntdll.dll!00000000771dc521() Unknown
>
>
> All the required include directories, libraries and additional dependencies
> are provided in the MSVS 2012. I presume MSVS 2012 vc11.0 is not working for
> the pcl 1.6.0. I would appreciate for any help.
>
>
> Thank you,
>
>
>
>
> --
> View this message in context: http://www.pcl-users.org/Building-PCL-1-6-0-with-MSVC-2012-tp4022101p4025170.html
> Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
>
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Building PCL-1.6.0 with MSVC 2012

kellp
In reply to this post by mamoto
Hi,
I have been trying to build pcl 1.7.1 with VS 2012 with no luck. I see that you have managed to build 1.7.0 with vs 2012 could you send me the All-In-One files as you suggested?
or if you can tell me the versions of your dependencies
Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Building PCL-1.6.0 with MSVC 2012

kwaegel
Administrator
kellp wrote
Hi,
I have been trying to build pcl 1.7.1 with VS 2012 with no luck. I see that you have managed to build 1.7.0 with vs 2012 could you send me the All-In-One files as you suggested?
or if you can tell me the versions of your dependencies
Thank you
Try using the dependencies I've listed here. It works fine for me.

Now that trunk has a version of OpenNI (2.x) that works with VS2012, we might want to consider making an all-in-one installer it.

wrote
The problem is that the release link for pcl_features takes too much memory, larger than link.exe allows. I have 16 GB RAM and this error is thrown when less than half of the memory is used, so I am sure the bottle neck is at VS link.exe, but not running out of the physical RAM.

The workaround is to turn off the "Whole Program Optimization" option(/GL) of the compiler, which will disable the "Link Time Code Generation" option(/LTCG) of the linker thus reduce the memory usage of it, with the trade off of generating lib with less optimization.
This workaround has already been applied in trunk.

(The underlying problem is that VS2012 uses the x86_64 cross compiler (32-bit compiler building a 64-bit program) by default, even on native 64-bit systems, which means it can hit the 4GB limit when linking. Microsoft actually includes a native x64 toolchain that would solve this problem, but they provide no clear instructions on how to enable it.)
Reply | Threaded
Open this post in threaded view
|

Re: Building PCL-1.6.0 with MSVC 2012

mwahl
This post has NOT been accepted by the mailing list yet.
kwaegel wrote
Try using the dependencies I've listed here. It works fine for me.
Did you compile for Win32 or x64?