Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to the COLMAP head. Use FetchContent for PoseLib and COLMAP #98

Merged
merged 33 commits into from
Nov 28, 2024

Conversation

B1ueber2y
Copy link
Member

@B1ueber2y B1ueber2y commented Nov 21, 2024

This works in my test after installation. More tests are appreciated.

python -c "import limap; print(limap.__version__)"

Will add the installation test into CI for the next step (in a separate PR after this is merged).

@B1ueber2y B1ueber2y marked this pull request as draft November 21, 2024 00:50
@B1ueber2y B1ueber2y marked this pull request as ready for review November 24, 2024 13:29
@B1ueber2y B1ueber2y changed the title Compatible to the COLMAP head Upgrade to the COLMAP head. Use FetchContent for PoseLib and COLMAP Nov 24, 2024
@rpautrat
Copy link
Member

With which Python version did you build it in your tests? The compilation of PoseLib is failing for me with Python 3.10:

    [ 35%] Building CXX object _deps/poselib-build/PoseLib/CMakeFiles/PoseLib.dir/robust/estimators/relative_pose.cc.o
    [ 35%] Building CXX object _deps/poselib-build/PoseLib/CMakeFiles/PoseLib.dir/robust/estimators/hybrid_pose.cc.o
    [ 36%] Building CXX object _deps/poselib-build/PoseLib/CMakeFiles/PoseLib.dir/robust/estimators/homography.cc.o
    [ 36%] Linking CXX static library libcolmap_poisson_recon.a
    [ 36%] Built target colmap_poisson_recon
    [ 36%] Linking CXX static library libPoseLib.a
    [ 36%] Built target PoseLib
    gmake: *** [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/pautratrmi/Documents/external/test/limap/setup.py", line 68, in <module>
        setup(
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup
        return distutils.core.setup(**attrs)
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 183, in setup
        return run_commands(dist)
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
        dist.run_commands()
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
        self.run_command(cmd)
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/dist.py", line 995, in run_command
        super().run_command(command)
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
        cmd_obj.run()
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/command/develop.py", line 35, in run
        self.install_for_development()
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/command/develop.py", line 112, in install_for_development
        self.run_command('build_ext')
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
        self.distribution.run_command(command)
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/dist.py", line 995, in run_command
        super().run_command(command)
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
        cmd_obj.run()
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 99, in run
        _build_ext.run(self)
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
        self.build_extensions()
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 476, in build_extensions
        self._build_extensions_serial()
      File "/home/pautratrmi/env_limap/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 502, in _build_extensions_serial
        self.build_extension(ext)
      File "/home/pautratrmi/Documents/external/test/limap/setup.py", line 59, in build_extension
        subprocess.check_call(
      File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--parallel 8']' returned non-zero exit status 2.
    error: subprocess-exited-with-error

    × python setup.py develop did not run successfully.
    │ exit code: 1
    ╰─> See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    full command: /home/pautratrmi/env_limap/bin/python -c '
    exec(compile('"'"''"'"''"'"'
    # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
    #
    # - It imports setuptools before invoking setup.py, to enable projects that directly
    #   import from `distutils.core` to work with newer packaging standards.
    # - It provides a clear error message when setuptools is not installed.
    # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
    #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
    #     manifest_maker: standard file '"'"'-c'"'"' not found".
    # - It generates a shim setup.py, for handling setup.cfg-only projects.
    import os, sys, tokenize

    try:
        import setuptools
    except ImportError as error:
        print(
            "ERROR: Can not execute `setup.py` since setuptools is not available in "
            "the build environment.",
            file=sys.stderr,
        )
        sys.exit(1)

    __file__ = %r
    sys.argv[0] = __file__

    if os.path.exists(__file__):
        filename = __file__
        with tokenize.open(__file__) as f:
            setup_py_code = f.read()
    else:
        filename = "<auto-generated setuptools caller>"
        setup_py_code = "from setuptools import setup; setup()"

    exec(compile(setup_py_code, filename, "exec"))
    '"'"''"'"''"'"' % ('"'"'/home/pautratrmi/Documents/external/test/limap/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' develop --no-deps
    cwd: /home/pautratrmi/Documents/external/test/limap/
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Upgrading setuptools to the latest version doesn't help.

@B1ueber2y
Copy link
Member Author

The previous issue was fixed here (due to copy construction behavior in pybind11): 6e14755. Now both quickstarts work for me.

Will add the quickstart tests to CI test in the future PR.

@B1ueber2y
Copy link
Member Author

B1ueber2y commented Nov 26, 2024

One thing to mention is that the parallelization for fitting 3D lines in the fitnmerge pipeline is currently broken. However, it is not the bottleneck so we could live with it: 2957ebf. Will look into it in later days.

@B1ueber2y B1ueber2y marked this pull request as draft November 26, 2024 18:45
@B1ueber2y B1ueber2y marked this pull request as ready for review November 26, 2024 18:45
@B1ueber2y B1ueber2y merged commit 04987c4 into main Nov 28, 2024
1 check passed
@B1ueber2y B1ueber2y deleted the features/colmap_head branch November 28, 2024 11:24
@B1ueber2y
Copy link
Member Author

One thing to mention is that the parallelization for fitting 3D lines in the fitnmerge pipeline is currently broken. However, it is not the bottleneck so we could live with it: 2957ebf. Will look into it in later days.

This is resolved by #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants