PCL Tools

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

PCL Tools

ognjen011
Hey guys, 

I am new to both C++ and PCL, so I hope you will forgive a silly question. How does one compile the tools from the pcl/tools/ folder on git? The compilation from the folder with cmake fails, so I guess I am doing something wrong (it reports that minimum version is missing)!

Thanks in advance!

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

Re: PCL Tools

Stephen McDowell

On Apr 26, 2018, at 2:50 PM, Ognjen Milicevic <[hidden email]> wrote:

it reports that minimum version is missing

Please provide more information.  Minimum version of what?  Cmake?  One of the third party libraries?  It’s probably a third party library, since PCL asks for CMake v2.8.  It’s rather unlikely on any recent system that you have CMake < 2.8 (current stable release is 3.11).

I don’t think the minimum version missing is coming from the tools specifically, the only mention of version is here


But what that will do is only add the `pcl_add_gaussian_noise` executable if Boost v1.41 or higher is found (current stable release is 1.66 btw).  It won’t fail out compilation, it will skip adding the executable if not found.

So perhaps the minimum version report is coming from something else?



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

Re: PCL Tools

ognjen011
Thanks for a prompt answer!

You are correct, I didn't give sufficient data. Also, when copy pasting this I see this is just a warning, and the error is just above, sorry for that. 

So, I cloned the git repo, entered /pcl/tools/, created build, and did 'cmake ..' in it. The error (as far as I can tell) is :

CMake Error at CMakeLists.txt:7 (PCL_SUBSYS_OPTION):

  Unknown CMake command "PCL_SUBSYS_OPTION".



CMake Warning (dev) in CMakeLists.txt:

  No cmake_minimum_required command is present.  A line of code such as


    cmake_minimum_required(VERSION 3.5)


  should be added at the top of the file.  The version specified may be lower

  if you wish to support older CMake versions for this project.  For more

  information run "cmake --help-policy CMP0000".

This warning is for project developers.  Use -Wno-dev to suppress it.


-- Configuring incomplete, errors occurred!



Also, I am using Docker for PCL installation so I am providing that too:

#RUN apt-get install -y software-properties-common
RUN apt-get update && apt-get install -y \
git build-essential linux-libc-dev \
cmake cmake-gui \
libusb-1.0-0-dev libusb-dev libudev-dev \
mpi-default-dev openmpi-bin openmpi-common \
libflann1.8 libflann-dev \
libeigen3-dev \
libboost-all-dev \
libvtk5.10-qt4 libvtk5.10 libvtk5-dev \
libqhull* libgtest-dev \
freeglut3-dev pkg-config \
libxmu-dev libxi-dev \
qt-sdk openjdk-8-jdk openjdk-8-jre \
openssh-client


# PCL - build from source and install
WORKDIR /opt/
RUN ln -s /opt/pcl-trunk /opt/pcl
WORKDIR /opt/pcl
#RUN git checkout pcl-1.8.0
RUN mkdir -p /opt/pcl-trunk/release
WORKDIR /opt/pcl/release
RUN cmake -DCMAKE_BUILD_TYPE=None -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON ..
WORKDIR /opt/pcl/release
RUN make VERBOSE=1 #-j3
WORKDIR /opt/pcl/release
RUN make install
WORKDIR /opt/pcl/release
RUN make clean

Many thanks and sorry for the previously incomplete info.

On Fri, Apr 27, 2018 at 2:17 AM, Stephen McDowell <[hidden email]> wrote:

On Apr 26, 2018, at 2:50 PM, Ognjen Milicevic <[hidden email]> wrote:

it reports that minimum version is missing

Please provide more information.  Minimum version of what?  Cmake?  One of the third party libraries?  It’s probably a third party library, since PCL asks for CMake v2.8.  It’s rather unlikely on any recent system that you have CMake < 2.8 (current stable release is 3.11).

I don’t think the minimum version missing is coming from the tools specifically, the only mention of version is here


But what that will do is only add the `pcl_add_gaussian_noise` executable if Boost v1.41 or higher is found (current stable release is 1.66 btw).  It won’t fail out compilation, it will skip adding the executable if not found.

So perhaps the minimum version report is coming from something else?



_______________________________________________
[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: PCL Tools

Stephen McDowell
No need to apologize!  Sometimes when you are confused it’s hard to understand what information is / is not relevant ;)

So the real issue is how you are trying to build the tools.  Consider the following structure

/path/to/pcl
    - CMakeLists.txt <<< (A)
    tools/
        - CMakeLists.txt <<< (B)

The way that PCL has its CMake setup is that (A) will “call” (B) for you.  By trying to use just (B) (what you did by making tools/build and cmake ..), you get the warning about minimum version as well as PCL_SUBSYS_OPTION because those have not been defined!  In other words, (B) is not a stand-alone CMakeLists.txt, it cannot be used on its own.

So the golden question: how do we get (A) to “call” (B)?  It actually comes from this 


$ cd /path/to/pcl
# note: you’ll want to make sure you start over, e.g. if
# build/ exists delete it entirely and start again
$ mkdir build
$ cd build

To enforce that the tools are built

$ cmake .. -DBUILD_tools=ON

How did I know it was BUILD_tools?  The easy way to check is to actually just

# NOTE: .. goes build/../CMakeLists.txt AKA points to file (A)
$ cmake ..
# Now we do ccmake . because inside of build/ is where the CMakeCache is created :)
$ ccmake .

ccmake will pull up the current configuration, and you will see a bunch of BUILD_X variables.  By default, BUILD_tools should be “ON” already, but specifying it on the command line won’t hurt.  One example where you would need to do it is when the default is off.  For example, BUILD_CUDA (if you have CUDA installed / want to compile support for that in PCL).

$ cmake .. -DBUILD_CUDA=ON

Or, if you get used to ccmake or use cmake-gui if you rather, you can run `cmake ..` once, and then go through and toggle things you want with `ccmake .`.  <enter> will toggle booleans from ON to OFF or vice versa, and things like CMAKE_INSTALL_PREFIX that are strings <enter> will allow you to start typing.  ccmake takes a little getting used to, but after you get all of your options set the way you want, you type <c> to configure (think of this as sort of re-running the initial cmake ..), and then you need to type <g> to generate (e.g., to create the Makefile).

- <c>: configure updates CMake’s internal files such as the cache
- <g>: after you have reconfigured (and there are no errors), you still need to generate the builder (e.g. the Makefile)

In contrast, running `cmake ..` internally will do both of these phases in one step.

However you want to slice the cake, go for it.  Personally if there are only a couple things I want to change I just specify them from the command line

$ cmake .. -DTHING_I_WANT=ON -DOTHER_THING_I_WANT=ON

but for complex projects (PCL definitely fits this category), it can be very useful to have a “redo” (via ccmake).

I hope this has been helpful in clarifying how to approach your problem.  You need to build all of PCL, for which the tools/ directory is a small part of :)

I included the above information because I believe understanding what is happening will make things a lot clearer.  But don’t worry if you didn’t understand all of it (though feel free to ask follow up questions!) ;)

-Stephen


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

Re: PCL Tools

ognjen011
Wow... Teach a guy how to fish!!!!!

A million thanks, I just ran the cmake, and I am re-reading this for an even better understanding.

Please consider posting this wonderful reply to this thread: https://stackoverflow.com/questions/47109475/running-pcl-tools-mesh2pcd-cpp-in-ubuntu

If for some reason you cannot, I can do that for you!

Again, a million thanks!

On Fri, Apr 27, 2018 at 11:42 AM, Stephen McDowell <[hidden email]> wrote:
No need to apologize!  Sometimes when you are confused it’s hard to understand what information is / is not relevant ;)

So the real issue is how you are trying to build the tools.  Consider the following structure

/path/to/pcl
    - CMakeLists.txt <<< (A)
    tools/
        - CMakeLists.txt <<< (B)

The way that PCL has its CMake setup is that (A) will “call” (B) for you.  By trying to use just (B) (what you did by making tools/build and cmake ..), you get the warning about minimum version as well as PCL_SUBSYS_OPTION because those have not been defined!  In other words, (B) is not a stand-alone CMakeLists.txt, it cannot be used on its own.

So the golden question: how do we get (A) to “call” (B)?  It actually comes from this 


$ cd /path/to/pcl
# note: you’ll want to make sure you start over, e.g. if
# build/ exists delete it entirely and start again
$ mkdir build
$ cd build

To enforce that the tools are built

$ cmake .. -DBUILD_tools=ON

How did I know it was BUILD_tools?  The easy way to check is to actually just

# NOTE: .. goes build/../CMakeLists.txt AKA points to file (A)
$ cmake ..
# Now we do ccmake . because inside of build/ is where the CMakeCache is created :)
$ ccmake .

ccmake will pull up the current configuration, and you will see a bunch of BUILD_X variables.  By default, BUILD_tools should be “ON” already, but specifying it on the command line won’t hurt.  One example where you would need to do it is when the default is off.  For example, BUILD_CUDA (if you have CUDA installed / want to compile support for that in PCL).

$ cmake .. -DBUILD_CUDA=ON

Or, if you get used to ccmake or use cmake-gui if you rather, you can run `cmake ..` once, and then go through and toggle things you want with `ccmake .`.  <enter> will toggle booleans from ON to OFF or vice versa, and things like CMAKE_INSTALL_PREFIX that are strings <enter> will allow you to start typing.  ccmake takes a little getting used to, but after you get all of your options set the way you want, you type <c> to configure (think of this as sort of re-running the initial cmake ..), and then you need to type <g> to generate (e.g., to create the Makefile).

- <c>: configure updates CMake’s internal files such as the cache
- <g>: after you have reconfigured (and there are no errors), you still need to generate the builder (e.g. the Makefile)

In contrast, running `cmake ..` internally will do both of these phases in one step.

However you want to slice the cake, go for it.  Personally if there are only a couple things I want to change I just specify them from the command line

$ cmake .. -DTHING_I_WANT=ON -DOTHER_THING_I_WANT=ON

but for complex projects (PCL definitely fits this category), it can be very useful to have a “redo” (via ccmake).

I hope this has been helpful in clarifying how to approach your problem.  You need to build all of PCL, for which the tools/ directory is a small part of :)

I included the above information because I believe understanding what is happening will make things a lot clearer.  But don’t worry if you didn’t understand all of it (though feel free to ask follow up questions!) ;)

-Stephen


_______________________________________________
[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: PCL Tools

Stephen McDowell
You are very welcome :)  Fingers crossed it all compiles!!!

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