dvlab-research/PointGroup

Error when building PG_OP

Closed this issue · 1 comments

Hi all,

I have met some error when I compiled pointgroup_ops library. The error is:

$ python setup.py develop                                                              
running develop
running egg_info
writing PG_OP.egg-info/PKG-INFO
writing dependency_links to PG_OP.egg-info/dependency_links.txt
writing top-level names to PG_OP.egg-info/top_level.txt
reading manifest file 'PG_OP.egg-info/SOURCES.txt'
writing manifest file 'PG_OP.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "setup.py", line 14, in <module>
    cmdclass={'build_ext': BuildExtension}
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/site-packages/setuptools/command/develop.py", line 34, in run
    self.install_for_development()
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/site-packages/setuptools/command/develop.py", line 136, in install_for_development
    self.run_command('build_ext')
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 232, in build_extensions
    self._check_abi()
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 370, in _check_abi
    check_compiler_abi_compatibility(compiler)
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 162, in check_compiler_abi_compatibility
    if not check_compiler_ok_for_platform(compiler):
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 138, in check_compiler_ok_for_platform
    which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "/home/helinxu/anaconda3/envs/partnet/lib/python3.7/subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['which', '/home/helinxu/anaconda3/envs/partnet/bin/x86_64-conda_cos6-linux-gnu-c++']' returned non-zero exit status 1.

I've tried everything I could find, including conda install gxx_linux-64 which led to another error.

Thanks in advance!

It turns out starting from a new conda env solvs my problem. I am now able to compile this repository! Here's what I did:

  • Install the exact CUDA and PyTorch version, install cudnn accordingly (when building spconv, receive output like:-- Found cuDNN: v7.6.5 (include: /home/helinxu/anaconda3/pkgs/cudnn-7.6.5-cuda9.0_0/include/, library: /home/helinxu/anaconda3/pkgs/cudnn-7.6.5-cuda9.0_0/include/cudnn.h). May need $ export CUDNN_INCLUDE_DIR=/home/helinxu/anaconda3/pkgs/cudnn-7.6.5-cuda9.0_0/include/ and $ export CUDNN_LIBRARY=~/anaconda3/pkgs/cudnn-7.6.5-cuda9.0_0/include/cudnn.h in my case ).
  • Succeed running conda install -c daleydeng gcc-5 thanks to https://stackoverflow.com/questions/58651869/conda-install-of-gcc-ends-with-link-error-error-loading-shared-library-libmpfr . Anaconda v5 in Ubuntu 18.04 supports libmpfr.so.6 but not libmpfr.so.4, hence the issues with finding libmpfr.so.4, sudo ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4 worked for me.
  • apt-get install libsparsehash-dev solved the error mentioned in #16
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176

$ conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch

I'm closing this issue.