-1

I am trying to compile freshly installed PCL library in WSL. I followed the steps given in the thread: https://stackoverflow.com/questions/58040066/how-to-compile-point-cloud-library-pcl-with-examples-ubuntu. I installed all the required dependencies mentioned in the thread but I am running into compilation error.

CMake Deprecation Warning at CMakeLists.txt:15 (cmake_policy):
The OLD behavior for policy CMP0048 will be removed from a futur 
version of CMake.l/lib/cmake/vtk 9.2/FindFreetype.cmake:179(vtk_detect_library_type) 
/usr/local/lib/cmake/vtk-9.2/patches/3.19/FindX11.cmake:235(find_package)
The cmake-policies(7) manual explains that the OLD behaviors of al 
(find_package) policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances.  
Projects should be ported to the NEW behavior and not rely on setting a policy to OLD.



The cmake-policies(7) manual explains that the OLD behaviors of all 
policies are deprecated and that a policy should be set to OLD only 
under specific short-term circumstances.  


--Could NOT find LIBUSB_1 (missing: LIBUSB_1_LIBRARY LIBUSB_1_INCLUDE_DIR)
-- Checking for module 'metslib'
-- No package 'metslib' found
-- Configuring incomplete, errors occurred!
-- QHULL found (include: /usr/include, lib: 
   optimized;/usr/lib/x86_64-linux gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so)
   CMake Error at /usr/local/lib/cmake/vtk 9.2/vtkDetectLibraryType.cmake:23 (message):
   The `PATH` argument is required.
    
   Projects should be ported to the NEW behavior and not rely on 
   setting a policy to OLD.

I did not quite understand the warning written in the first line. Does it have to do anything with the CMake version? I am new to cmake and cannot figure this out. Some help will be appreciated :)

Ken Adams
  • 25
  • 4
  • Are you really need to build PCL 1.8.1, which is 5 years old? Yes, this PCL version is developed for quite old CMake, so CMake emits a warning about some its aspects. Instead, build the latest 13.0 version, or even build the master branch. – Tsyvarev Jan 22 '23 at 20:13
  • @Tsyvarev he needs an x-server for that anyway and IIRC you don't have that available on a WSL – Milan Š. Jan 22 '23 at 20:13
  • 1
    @MilanŠ.: As you have found, X server can be configured on WSL: https://stackoverflow.com/questions/61110603/how-to-set-up-working-x11-forwarding-on-wsl2 – Tsyvarev Jan 22 '23 at 20:20
  • @Tsyvarev that's a nicely explained answer I will add the link to my answer. I still think that unless it's a cross-compilation, working with the lib would be much easier on an actual installation of ubuntu rather than a wsl version of it. – Milan Š. Jan 22 '23 at 20:23

1 Answers1

0

You are trying to compile on a WSL which is just a subsystem i.e. it's without an X-server. Simple as that. Look at this line:

/usr/local/lib/cmake/vtk-9.2/patches/3.19/FindX11.cmake:235(find_package)

Long story short, you can't might be able to compile it on WSL, because but VTK needs an X-server for it's visualisation and you need to start by getting the X-server up and running. I'm really not sure how this would run on a WSL even if you got an X-server to work with WSL, but I might be wrong here.

EDIT: Apparently it is possible to get an X-server to work on WSL by forwarding it, but I still believe (especially since you are new) that it's more work then just getting a dual-boot working.

EDIT2: Tsyvarev was kind enough to provide a great link on how to get X-server configured on WSL.

Milan Š.
  • 1,353
  • 1
  • 2
  • 11
  • Thanks a lot for clarification. Is there any other way to get the PCL library up and running? I Found windows installation a bit messy because for CMake GUI I was running into a lot of 'path not found' errors and I have to manually search the paths of required files. After some point I could not find the paths of few files so gave up. Do you have any advice for me? @Tsyvarev – Ken Adams Jan 22 '23 at 21:04
  • @KenAdams I assume you just need the PCL library for development reasons. In such a case get `vcpkg`. It's a very good package manager that integrates well with CMake and it has the pcl package for download. It's an amazing tool that takes 5-10mins to set up and saves you a ton of time. [Check it out here](https://vcpkg.io) – Milan Š. Jan 23 '23 at 08:56