cvg / pixel-perfect-sfm

Pixel-Perfect Structure-from-Motion with Featuremetric Refinement (ICCV 2021, Best Student Paper Award)
Apache License 2.0
1.29k stars 132 forks source link

pip install -e . fails #87

Open spacycoder opened 1 year ago

spacycoder commented 1 year ago

Thanks for your awesome work!

Hi, I get the following error when building:

    -- Generating done
    -- Build files have been written to: /home/larsh/development/pixel-perfect-sfm/build/temp.linux-x86_64-cpython-39
    [ 56%] Built target pixsfm
    [ 60%] Building CXX object pixsfm/CMakeFiles/pypixsfm.dir/bundle_adjustment/bindings.cc.o
    In file included from /home/larsh/development/pixel-perfect-sfm/pixsfm/bundle_adjustment/src/costmap_extractor.h:18,
                     from /home/larsh/development/pixel-perfect-sfm/pixsfm/bundle_adjustment/bindings.cc:14:
    /home/larsh/development/pixel-perfect-sfm/pixsfm/bundle_adjustment/src/reference_extractor.h:331:32: error: redefinition of default argument for ‘int N_NODES’
      331 | template <int N_NODES = Eigen::Dynamic>
          |                                ^~~~~~~
    /home/larsh/development/pixel-perfect-sfm/pixsfm/bundle_adjustment/src/reference_extractor.h:52:32: note: original definition appeared here
       52 | template <int N_NODES = Eigen::Dynamic>
          |                                ^~~~~~~
    make[2]: *** [pixsfm/CMakeFiles/pypixsfm.dir/build.make:132: pixsfm/CMakeFiles/pypixsfm.dir/bundle_adjustment/bindings.cc.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:376: pixsfm/CMakeFiles/pypixsfm.dir/all] Error 2
    make: *** [Makefile:136: all] Error 2
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "/home/larsh/development/pixel-perfect-sfm/setup.py", line 112, in <module>
        setup(
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
        return distutils.core.setup(**attrs)
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
        return run_commands(dist)
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
        dist.run_commands()
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
        self.run_command(cmd)
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command
        super().run_command(command)
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
        cmd_obj.run()
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in run
        self.install_for_development()
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/site-packages/setuptools/command/develop.py", line 114, in install_for_development
        self.run_command('build_ext')
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
        self.distribution.run_command(command)
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command
        super().run_command(command)
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
        cmd_obj.run()
      File "/home/larsh/development/pixel-perfect-sfm/setup.py", line 55, in run
        self.build_extension(ext)
      File "/home/larsh/development/pixel-perfect-sfm/setup.py", line 98, in build_extension
        subprocess.check_call(['cmake', '--build', '.'] + build_args,
      File "/home/larsh/micromamba/envs/pp_sfm/lib/python3.9/subprocess.py", line 373, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j']' returned non-zero exit status 2.
    [end of output]

gcc -v gcc version 11.3.0

Phil26AT commented 1 year ago

Thanks for reporting this, it is indeed a bug. Just remove " = Eigen::Dynamic" in line 331 and the install should work again.

Please feel free to add a PR with this fix if it solved your problem.