drprojects / superpoint_transformer

Official PyTorch implementation of Superpoint Transformer introduced in [ICCV'23] "Efficient 3D Semantic Segmentation with Superpoint Transformer" and SuperCluster introduced in [3DV'24 Oral] "Scalable 3D Panoptic Segmentation As Superpoint Graph Clustering"
MIT License
601 stars 75 forks source link

[enviroment configuration] Compilation of third-party libraries (eg `FRNN`) #14

Closed MenglinQiu closed 1 year ago

MenglinQiu commented 1 year ago

Hi Damien: When I run install.sh until the installation of third-party libraries such as FRNN, errors related to g++ and gcc are output. I can make sure that the system has gcc-7 & g++-7, but it doesn't seem to work.

running install
/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
running bdist_egg
running egg_info
writing prefix_sum.egg-info/PKG-INFO
writing dependency_links to prefix_sum.egg-info/dependency_links.txt
writing top-level names to prefix_sum.egg-info/top_level.txt
reading manifest file 'prefix_sum.egg-info/SOURCES.txt'
writing manifest file 'prefix_sum.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
Traceback (most recent call last):
  File "setup.py", line 9, in <module>
    setup(
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
    super().run_command(command)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/command/install.py", line 80, in run
    self.do_egg_install()
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/command/install.py", line 129, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
    super().run_command(command)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 164, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
    self.run_command(cmdname)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
    super().run_command(command)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/command/install_lib.py", line 111, in build
    self.run_command('build_ext')
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
    super().run_command(command)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
    _build_ext.run(self)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
    self.build_extensions()
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 485, in build_extensions
    compiler_name, compiler_version = self._check_abi()
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 869, in _check_abi
    _, version = get_compiler_abi_compatibility_and_version(compiler)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 337, in get_compiler_abi_compatibility_and_version
    if not check_compiler_ok_for_platform(compiler):
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 291, in check_compiler_ok_for_platform
    which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/shi/anaconda3/envs/spt/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['which', 'g++']' returned non-zero exit status 1.

2023-07-29_17-21

MenglinQiu commented 1 year ago

thank you for your reply!

drprojects commented 1 year ago

Hi @MenglinQiu thanks for your interest in this project !

So, from what I gather, this might be a FRNN-related issue. Can you please try installing FRNN by itself (i.e. in a new conda environment of your choice) by following the FRNN installation instructions, and let me know how that goes ?

Also, can you please share the setuptools version you are using in your environment ?

pip list | grep setuptools
MenglinQiu commented 1 year ago

Thanks for your advice! I installed FRNN independently in two different conda environments as you suggested and got the same error.

Processing /media/shi/projects/FRNN/external/prefix_sum
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: prefix-sum
  Building wheel for prefix-sum (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [53 lines of output]
      running bdist_wheel
      running build
      running build_ext
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/media/shi/projects/FRNN/external/prefix_sum/setup.py", line 9, in <module>
          setup(
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 325, in run
          self.run_command("build")
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 390, in build_extensions
          self._check_abi()
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 761, in _check_abi
          check_compiler_abi_compatibility(compiler)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 294, in check_compiler_abi_compatibility
          if not check_compiler_ok_for_platform(compiler):
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 254, in check_compiler_ok_for_platform
          which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/subprocess.py", line 415, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "/home/shi/anaconda3/envs/frnn/lib/python3.8/subprocess.py", line 516, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['which', 'g++']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for prefix-sum
  Running setup.py clean for prefix-sum
Failed to build prefix-sum
ERROR: Could not build wheels for prefix-sum, which is required to install pyproject.toml-based projects

the setuptools version in my environment is v68.0.0 (and i also tested in v65.6.3)

图片

drprojects commented 1 year ago

Hi, I have tested this installation on multiple machines with multiple setuptools versions (58.0.0, 63.4.1, 65.6.3, 67.8.0) and never encountered this error.

Since you cannot install FRNN on its own, it seems the error is related to FRNN, for which I cannot provide support. I invite you to have a look at the FRNN Issues to find some help.

MenglinQiu commented 1 year ago

Hi, Damien. Thank you for your answer. I found out the reason is that new symbolic links were not created when gcc/g++ was updated. (But the strange thing is that other C++ projects compile smoothly without being affected.) So, if anyone else has the same problem as me, just make symbolic links for gcc/g++. (don't be careless like me. T^T)

drprojects commented 1 year ago

Thanks @MenglinQiu for sharing your solution :relaxed: