Building on windows

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

Building on windows

Richard Frank
Hi,

I know there are prebuilt libraries for 1.8.1 windows but I would like to integrate PCL into an large existing project that ready has VTK configured in It’s CMakeLists.txt.

The PCL prebuilt seems to be looking for a slightly different VTK than I’m using ( it was built with 8.0 it seems, it crashes funny when calling VTK as if the vtables are off, I’m still using 7.1 for now).

I tried to build from source, but got hung up getting lapack blas eigen correct.....

So,

Can someone help me get it configured to build with MSVS 2017? If I can get over a few hurdles it be happy to pass along what else I learn.


Thanks
Rick Frank
Dominion Software, Inc.
825 Beacon Street
Newton, MA 02459
Medical, Scientific, and Industrial Software
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Building on windows

Stephen McDowell
Hi Rick,

If you want to use a different version of VTK with PCL than what was used in the precompiled binaries, you’ll need to build PCL from source.  From what you wrote, it sounds like your system only has VTK 7.1, and it also sounds like when building from source you didn’t have trouble with find_package(VTK), but other build dependencies?

Preface: I am not an expert on PCL, but have battled the Eigen backend front with CMake before.  These are thoughts on what you can look at, but may lead you in the wrong direction.  AKA take with a big grain of salt!

What issues were you struggling with for Eigen?


There’s nothing going on with respect to the Eigen backend.  Most projects with CMake and Eigen tend to overlook this altogether:


These all come in the form of preprocessor definitions, so you need to use something like FindBlas.cmake


And if it is found, include the directories as well as link against the libraries, and add_definitions(-DEIGEN_USE_BLAS).

The same would go for LAPACK, but the Eigen defines have an E at the end: LAPACKE.

Long story short, it’s not required and shouldn’t be preventing you from compiling PCL.  But I do think that you need this in the PCL cmake setup in order for PCL to actually take advantage of it.  It gets a little more complicated, because I think the installed cmake scripts that make find_package(PCL) available would have to be modified (otherwise you’d get link errors for BLAS?).  Bigger complications are how PCL is compiled, a lot of things are explicit template instantiations on specific point cloud types, so if you’re wielding those and do not splice the BLAS / LAPACK code into the PCL cmake system, those backends won’t be used.  See Sérgio’s answer here: http://www.pcl-users.org/PCL-1-7-throws-undefined-reference-exceptions-when-I-define-my-own-type-of-point-cloud-td4045391.html

So for custom point cloud types you define PCL_NO_PRECOMPILE before including PCL stuff, but I do not understand the implication of this with respect to Eigen and BLAS / LAPACK and which classes in PCL would be affected.

Is this what you were trying to do, or am I misunderstanding?  Having the Eigen backend is nice, but I don’t think it will necessarily have a huge payoff for PCL.  To be clear, I am not deeply familiar with the PCL code-base, but my working assumption is that most of the Eigen math operations are doing things with e.g. Matrix4f or Vector3f etc, which are not going to use BLAS or LAPACK — they’ll be using the hand-crafted Eigen SSE / AVX operations.  For larger problem representations, I’m not sure MatrixXf comes into play nearly as much as operating on the raw PCL point cloud types.

So you could defer the BLAS / LAPACK stuff to just your own code-base that is using PCL?

I hope that was coherent and more helpful than not!

On Jan 14, 2018, at 11:18 AM, Richard Frank <[hidden email]> wrote:

Hi,

I know there are prebuilt libraries for 1.8.1 windows but I would like to integrate PCL into an large existing project that ready has VTK configured in It’s CMakeLists.txt.

The PCL prebuilt seems to be looking for a slightly different VTK than I’m using ( it was built with 8.0 it seems, it crashes funny when calling VTK as if the vtables are off, I’m still using 7.1 for now).

I tried to build from source, but got hung up getting lapack blas eigen correct.....

So,

Can someone help me get it configured to build with MSVS 2017? If I can get over a few hurdles it be happy to pass along what else I learn.


Thanks
Rick Frank
Dominion Software, Inc.
825 Beacon Street
Newton, MA 02459
Medical, Scientific, and Industrial Software
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users