cmpute/pcl.py

Unable to install on jetson-tx2

bfouts-kindred opened this issue · 6 comments

Hi there. I'm trying to install this on a Nvidia Jetson tx2 running Jetpack 3.3.

It seems to have some unresolved cmake dependency, but I haven't been able to track down how to resolve it. Any advice would be greatly appreciated!

$ pip install PyPCL --no-cache-dir
Looking in indexes: https://pypi.org/simple
Collecting PyPCL
Downloading https://files.pythonhosted.org/packages/b4/83/b3d397539f8877d99cc95a7073b58480a09fcee408997c19e2345e9933eb/PyPCL-0.1.8.tar.gz (179kB)
100% |████████████████████████████████| 184kB 2.6MB/s
Requirement already satisfied: numpy in ./venv/lib/python3.7/site-packages (from PyPCL) (1.16.1)
Installing collected packages: PyPCL
Running setup.py install for PyPCL ... error
Complete output from command /home/nvidia/repos/graspai/venv/bin/python3.7 -u -c "import setuptools, tokenize;file='/tmp/pip-install-3lvbtspx/PyPCL/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-pxtpiv6o/install-record.txt --single-version-externally-managed --compile --install-headers /home/nvidia/repos/graspai/venv/include/site/python3.7/PyPCL:

--------------------------------------------------------------------------------
-- Trying "Ninja" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Ninja" generator - failure
--------------------------------------------------------------------------------



--------------------------------------------------------------------------------
-- Trying "Unix Makefiles" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is GNU 5.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/pip-install-3lvbtspx/PyPCL/_cmake_test_compile/build
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Unix Makefiles" generator - success
--------------------------------------------------------------------------------

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /home/nvidia/repos/graspai/venv/bin/python3.7 (found version "3.7")
-- Found PythonLibs: /usr/local/lib/libpython3.7m.a (found version "3.7.0")
-c:42: DeprecationWarning: SO is deprecated, use EXT_SUFFIX
-- Found Cython: /home/nvidia/repos/graspai/venv/bin/cython
CMake Error at pcl/CMakeLists.txt:1 (find_package):
  By not providing "FindPCL.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "PCL", but
  CMake did not find one.

  Could not find a package configuration file provided by "PCL" with any of
  the following names:

    PCLConfig.cmake
    pcl-config.cmake

  Add the installation prefix of "PCL" to CMAKE_PREFIX_PATH or set "PCL_DIR"
  to a directory containing one of the above files.  If "PCL" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
See also "/tmp/pip-install-3lvbtspx/PyPCL/_skbuild/linux-aarch64-3.7/cmake-build/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
  File "/home/nvidia/repos/graspai/venv/lib/python3.7/site-packages/skbuild/setuptools_wrap.py", line 548, in setup
    languages=cmake_languages
  File "/home/nvidia/repos/graspai/venv/lib/python3.7/site-packages/skbuild/cmaker.py", line 232, in configure
    os.path.abspath(CMAKE_BUILD_DIR)))

An error occurred while configuring with CMake.
  Command:
    "cmake" "/tmp/pip-install-3lvbtspx/PyPCL" "-G" "Unix Makefiles" "-DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-3lvbtspx/PyPCL/_skbuild/linux-aarch64-3.7/cmake-install" "-DPYTHON_EXECUTABLE:FILEPATH=/home/nvidia/repos/graspai/venv/bin/python3.7" "-DPYTHON_VERSION_STRING:STRING=3.7.0" "-DPYTHON_INCLUDE_DIR:PATH=/usr/local/include/python3.7m" "-DPYTHON_LIBRARY:FILEPATH=/usr/local/lib/libpython3.7m.a" "-DSKBUILD:BOOL=TRUE" "-DCMAKE_MODULE_PATH:PATH=/home/nvidia/repos/graspai/venv/lib/python3.7/site-packages/skbuild/resources/cmake" "-DCMAKE_BUILD_TYPE:STRING=Release"
  Source directory:
    /tmp/pip-install-3lvbtspx/PyPCL
  Working directory:
    /tmp/pip-install-3lvbtspx/PyPCL/_skbuild/linux-aarch64-3.7/cmake-build
Please see CMake's output for more information.

----------------------------------------

Command "/home/nvidia/repos/graspai/venv/bin/python3.7 -u -c "import setuptools, tokenize;file='/tmp/pip-install-3lvbtspx/PyPCL/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-pxtpiv6o/install-record.txt --single-version-externally-managed --compile --install-headers /home/nvidia/repos/graspai/venv/include/site/python3.7/PyPCL" failed with error code 1 in /tmp/pip-install-3lvbtspx/PyPCL/

Have you ever installed PCL (the C++ library) on the machine? Unfortunately PyPCL now is not standalone library, it depends on the C++ version of PCL

Hi,
I get the same error even with PCL installed. Does it need to be referenced somehow?
Do you have any advice?
Thanks in advance

Hi,
I get the same error even with PCL installed. Does it need to be referenced somehow?
Do you have any advice?
Thanks in advance

You mean error showing that cannot find PCLConfig.cmake? I guess this is due to that the path for PCL is not setup correctly. Did you install pcl using apt?

I was eventually able to get this installed using PCL1.8

I had to patch PyPCL to respect my header location:
rev 1dd6acc

index 72d91a8..b71a1b7 100644
--- a/pypcl_build.py
+++ b/pypcl_build.py
@@ -16,7 +16,7 @@ ffibuilder.cdef(pypcl_header_source)
 #       To compile on another platform they need to be changed.
 def pcl_header():
     for version in ["1.7", "1.8"]:
-        pcl_header = "/usr/include/pcl-{}".format(version)
+        pcl_header = "/usr/local/include/pcl-{}".format(version)
         if os.path.exists(pcl_header):
             return pcl_header
     raise Exception("No valid PCL header found")

I also had to patch python-pcl at rev: d8b1fea

index cba5eb3..085a6e2 100644
--- a/setup.py
+++ b/setup.py
@@ -146,7 +146,7 @@ if platform.system() == "Windows":
             break
     else:
         # Try to find PCL. XXX we should only do this when trying to build or install.
-        PCL_SUPPORTED = ["-1.8", "-1.7", "-1.6", ""]    # in order of preference
+        PCL_SUPPORTED = ["-1.7", "-1.6", ""]    # in order of preference

         for pcl_version in PCL_SUPPORTED:
             if subprocess.call(['.\\pkg-config\\pkg-config.exe', 'pcl_common%s' % pcl_version]) == 0:
@@ -550,6 +550,7 @@ else:
     # "-I/usr/include/openni"
     # /usr/include/ni
     ext_args['include_dirs'].append('/usr/include/ni')
+    ext_args['include_dirs'].append('/usr/local/include/vtk-7.1')
     # ext_args['library_dirs'].append()
     # ext_args['libraries'].append()

@@ -614,22 +615,22 @@ else:

     if pcl_version == '-1.6':
         module = [Extension("pcl._pcl", ["pcl/_pcl.pyx", "pcl/minipcl.cpp", "pcl/ProjectInliers.cpp"], language="c++", **ext_args),
-                  # Extension("pcl.pcl_visualization", ["pcl/pcl_visualization.pyx"], language="c++", **ext_args),
+                  Extension("pcl.pcl_visualization", ["pcl/pcl_visualization.pyx"], language="c++", **ext_args),
                   # Extension("pcl.pcl_grabber", ["pcl/pcl_grabber.pyx", "pcl/grabber_callback.cpp"], language="c++", **ext_args),
                   # debug
                   # gdb_debug=True,
                   ]
     elif pcl_version == '-1.7':
         module = [Extension("pcl._pcl", ["pcl/_pcl_172.pyx", "pcl/minipcl.cpp", "pcl/ProjectInliers.cpp"], language="c++", **ext_args),
-                  # Extension("pcl.pcl_visualization", ["pcl/pcl_visualization.pyx"], language="c++", **ext_args),
+                  Extension("pcl.pcl_visualization", ["pcl/pcl_visualization.pyx"], language="c++", **ext_args),
                   # Extension("pcl.pcl_grabber", ["pcl/pcl_grabber.pyx", "pcl/grabber_callback.cpp"], language="c++", **ext_args),
                   # debug
                   # gdb_debug=True,
:q
uu                   ]
     elif pcl_version == '-1.8':
         module = [Extension("pcl._pcl", ["pcl/_pcl_180.pyx", "pcl/minipcl.cpp", "pcl/ProjectInliers.cpp"], language="c++", **ext_args),
-                  # Extension("pcl.pcl_visualization", ["pcl/pcl_visualization.pyx"], language="c++", **ext_args),
-                  # Extension("pcl.pcl_grabber", ["pcl/pcl_grabber.pyx", "pcl/grabber_callback.cpp"], language="c++", **ext_args),
+                  Extension("pcl.pcl_visualization", ["pcl/pcl_visualization.pyx"], language="c++", **ext_args),
+                  #Extension("pcl.pcl_grabber", ["pcl/pcl_grabber.pyx", "pcl/grabber_callback.cpp"], language="c++", **ext_args),
                   # debug
                   # gdb_debug=True,
                   ]

@bfouts-kindred I didn't find the corresponding codes in my source. Where does pypcl_build.py come from? Currently the location of PCL is determined by CMake modules, so as long as your PCL installation is able to be discovered by CMake, then it should be fine to build

The old version of pypcl has been deprecated, so this issue is going to be closed.