paul0noah / spider-match

🕷️ SpiderMatch: 3D Shape Matching with Global Optimality and Geometric Consistency
MIT License
76 stars 5 forks source link

error when install from sm-3dcouple #5

Closed Spphire closed 1 month ago

Spphire commented 1 month ago

My system is Ubuntu2004 I tried it with gcc/g++-11 and cmake3.20

I successfully created the environment (which is the content of Step 1), but when I executed Step 2 to install sm-3dcouple, I encountered errors related to pybind11.

It seems to be an issue with duplicate naming, as the errors are almost all of the same type: "add_library cannot create imported target XXX because another target with the same name already exists".

Full bash output is below:


$ python setup.py install
setup.py:10: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import parse_version
/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/__init__.py:94: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
running install
/home/apri/miniconda3/envs/spidermatch/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/apri/miniconda3/envs/spidermatch/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 SMM_Dijkstra.egg-info/PKG-INFO
writing dependency_links to SMM_Dijkstra.egg-info/dependency_links.txt
writing top-level names to SMM_Dijkstra.egg-info/top_level.txt
reading manifest file 'SMM_Dijkstra.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'SMM_Dijkstra.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
b''
b'cmake version 3.20.0\n\nCMake suite maintained and supported by Kitware (kitware.com/cmake).\n'
Testing gcc...
++++++++++++++++++++++++
['gcc', '(Ubuntu', '11.4.0-2ubuntu1~20.04)', '11.4.0']
...has version 11.4.0
Found suitable gcc/g++ version gcc g++
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Retrieving pybind11...
-- pybind11 v2.11.0 dev1
-- Found PythonInterp: /home/apri/miniconda3/envs/spidermatch/bin/python (found suitable version "3.8.20", minimum required is "3.6")
-- Found PythonLibs: /home/apri/miniconda3/envs/spidermatch/lib/libpython3.8.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
Retrieving libigl...
-- Creating target: igl::core (igl_core)
-- Third-party: creating target 'Eigen3::Eigen'
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
Building Python Bindings
-- Found Python3: /home/apri/miniconda3/envs/spidermatch/bin/python3.8 (found version "3.8.20") found components: Interpreter
-- Compiling with CUDA support
-- The CUDA compiler identification is NVIDIA 12.1.66
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda-12.1/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Downloading CPM.cmake to /home/apri/workspace/sm-3dcouple/build/temp.linux-x86_64-cpython-38/cmake/CPM_0.34.0.cmake
-- CPM: adding package PEGTL@ (main)
-- CPM: adding package CLI11@ (main)
-- CPM: adding package eigen@ (master)
-- CPM: adding package robin-map@ (master)
-- CPM: adding package pybind11@ (master)
-- pybind11 v2.14.0 dev1
CMake Error at build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/tools/pybind11Common.cmake:54 (add_library):
  add_library cannot create imported target "pybind11::pybind11" because
  another target with the same name already exists.
Call Stack (most recent call first):
  build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/CMakeLists.txt:229 (include)

CMake Error at build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/tools/pybind11Common.cmake:61 (add_library):
  add_library cannot create imported target "pybind11::module" because
  another target with the same name already exists.
Call Stack (most recent call first):
  build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/CMakeLists.txt:229 (include)

CMake Error at build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/tools/pybind11Common.cmake:68 (add_library):
  add_library cannot create imported target "pybind11::embed" because another
  target with the same name already exists.
Call Stack (most recent call first):
  build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/CMakeLists.txt:229 (include)

CMake Error at build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/tools/pybind11Common.cmake:98 (add_library):
  add_library cannot create imported target "pybind11::python_link_helper"
  because another target with the same name already exists.
Call Stack (most recent call first):
  build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/CMakeLists.txt:229 (include)

CMake Error at build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/tools/pybind11Common.cmake:107 (add_library):
  add_library cannot create imported target "pybind11::windows_extras"
  because another target with the same name already exists.
Call Stack (most recent call first):
  build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/CMakeLists.txt:229 (include)

CMake Error at build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/tools/pybind11Common.cmake:132 (add_library):
  add_library cannot create imported target "pybind11::opt_size" because
  another target with the same name already exists.
Call Stack (most recent call first):
  build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/CMakeLists.txt:229 (include)

-- Found PythonInterp: /home/apri/miniconda3/envs/spidermatch/bin/python (found suitable version "3.8.20", minimum required is "3.8")
CMake Error at build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/tools/pybind11Common.cmake:395 (add_library):
  add_library cannot create imported target "pybind11::lto" because another
  target with the same name already exists.
Call Stack (most recent call first):
  build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/CMakeLists.txt:229 (include)

CMake Error at build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/tools/pybind11Common.cmake:398 (add_library):
  add_library cannot create imported target "pybind11::thin_lto" because
  another target with the same name already exists.
Call Stack (most recent call first):
  build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/CMakeLists.txt:229 (include)

-- CPM: adding package thrust@ (main)
-- Found libcudacxx: /home/apri/workspace/sm-3dcouple/build/temp.linux-x86_64-cpython-38/_deps/thrust-src/dependencies/libcudacxx/lib/cmake/libcudacxx/libcudacxx-config.cmake (found suitable version "1.8.1.0", minimum required is "1.8.0")
-- Found Thrust: /home/apri/workspace/sm-3dcouple/build/temp.linux-x86_64-cpython-38/_deps/thrust-src/thrust/cmake/thrust-config.cmake (found version "2.2.0.0")
-- Found CUB: /home/apri/workspace/sm-3dcouple/build/temp.linux-x86_64-cpython-38/_deps/thrust-src/dependencies/cub/cub/cmake/cub-config.cmake (found suitable version "2.2.0.0", minimum required is "2.2.0.0")
-- CPM: adding package cereal@ (master)
-- Performing Test COMPILER_SUPPORT_M32
-- Performing Test COMPILER_SUPPORT_M32 - Failed
CMake Error at /home/apri/Downloads/cmake-3.20.0-linux-x86_64/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: Boost_INCLUDE_DIR serialization)
Call Stack (most recent call first):
  /home/apri/Downloads/cmake-3.20.0-linux-x86_64/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /home/apri/Downloads/cmake-3.20.0-linux-x86_64/share/cmake-3.20/Modules/FindBoost.cmake:2344 (find_package_handle_standard_args)
  build/temp.linux-x86_64-cpython-38/_deps/cereal-src/CMakeLists.txt:116 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/apri/workspace/sm-3dcouple/build/temp.linux-x86_64-cpython-38/CMakeFiles/CMakeOutput.log".
See also "/home/apri/workspace/sm-3dcouple/build/temp.linux-x86_64-cpython-38/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "setup.py", line 126, in <module>
    setup(
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 183, in setup
    return run_commands(dist)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
    dist.run_commands()
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
    self.run_command(cmd)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/command/install.py", line 97, in run
    self.do_egg_install()
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/command/install.py", line 149, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 168, in run
    cmd = self.call_command('install_lib', warn_dir=False)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 154, in call_command
    self.run_command(cmdname)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 19, in run
    self.build()
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/_distutils/command/install_lib.py", line 110, in build
    self.run_command('build_ext')
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "setup.py", line 43, in run
    self.build_extension(ext)
  File "setup.py", line 123, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
  File "/home/apri/miniconda3/envs/spidermatch/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/apri/workspace/sm-3dcouple', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/apri/workspace/sm-3dcouple/build/lib.linux-x86_64-cpython-38', '-DPYTHON_EXECUTABLE=/home/apri/miniconda3/envs/spidermatch/bin/python', '-DBUILD_PYTHON_BINDINGS=True', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
``
paul0noah commented 1 month ago

Please provide more information, condense down your outputs and ask a proper question :)

Spphire commented 1 month ago

Please provide more information, condense down your outputs and ask a proper question :) image I was doing the second step when error occured, and full information is at above. It prevent me from installing environment.

paul0noah commented 1 month ago

As said: please condense down your outputs and ask a proper question. Also describe what you have already done and what machine you are running on.

Running steps 1 and 2 works for me just fine (on kultiple machines) so i cannot reproduce nor debug your error without proper information from your side :)

Spphire commented 1 month ago

As said: please condense down your outputs and ask a proper question. Also describe what you have already done and what machine you are running on.

Running steps 1 and 2 works for me just fine (on kultiple machines) so i cannot reproduce nor debug your error without proper information from your side :)

I‘m running on Ubuntu2004 with python3.8, cmake3.20, gcc-11 and g++-11

I successfully created the environment (which is the content of Step 1), but when I executed Step 2 to install sm-3dcouple, I encountered errors related to pybind11.

It seems to be an issue with duplicate naming, as the errors are almost all of the same type: "add_library cannot create imported target XXX because another target with the same name already exists".

I searched for the issue and tried modifying the names in 'project(smm_dijkstra)' and 'pybind11_add_module(smm_dijkstra pythonbinding/shapeMatchModelPB.cpp)', but it doesn't seem to have fixed the problem. I hope you can help me look into this issue.

ElectronicElephant commented 1 month ago

Hi @paul0noah , I reproduced the same error on a fresh-installed Ubuntu 24.04. It looks like the pybind11 module is being included twice. After reviewing the code (CMakeLists.txts), I found external/BDD/CMakeLists.txt L65-75 is using CPM to add pybind11. Commenting out these lines as the screenshot shows fixed the error. image

BTW, it seems that libboost-all-dev is also required when building sm-3dcouple. Otherwise, the following error will occur.

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.83.0/BoostConfig.cmake:141 (find_package):
  Could not find a package configuration file provided by
  "boost_serialization" (requested version 1.83.0) with any of the following
  names:

    boost_serializationConfig.cmake
    boost_serialization-config.cmake

  Add the installation prefix of "boost_serialization" to CMAKE_PREFIX_PATH
  or set "boost_serialization_DIR" to a directory containing one of the above
  files.  If "boost_serialization" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Boost-1.83.0/BoostConfig.cmake:262 (boost_find_component)
  /usr/share/cmake-3.28/Modules/FindBoost.cmake:594 (find_package)
  build/_deps/cereal-src/CMakeLists.txt:116 (find_package)

I will make a pull request to help enrich the troubleshooting section.

paul0noah commented 1 month ago

@ElectronicElephant thank you so much for taking a look and posting your findings. @Spphire does this solve your issues?

paul0noah commented 1 month ago

@Spphire please checkout the newest version of sm-3dcouple. It should work now!

Spphire commented 1 month ago

@Spphire please checkout the newest version of sm-3dcouple. It should work now!

yes it's fixed! thank you guys so much!