Updating to work with colmap 3.9+ according to #110
I managed to compile the code but it still doesn't link.
Todo:
[x] Fix include file locations
[x] Rename function and variable names
[x] Move to GTest
[ ] Didn't run tests (didn't link)
[ ] Didn't test with colmap 3.9.1 and dev version (didn't link)
[ ] pybind signatures might have changed
[ ] Fix CameraModelId print
[ ] Run clang-format
I had to add a print function for CameraModelId because apparently enums cannot be easily printed: std::ostream& operator<<(std::ostream& os, const colmap::CameraModelId& id)
Probably there is a really easy fix for this though.
Details
Linking CXX shared module ../../lib.linux-x86_64-3.10/pixsfm/_pixsfm.cpython-310-x86_64-linux-gnu.so
/usr/bin/ld: libpixsfm.a(graph.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)':
graph.cc:(.text+0x11c0): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: libpixsfm.a(featurepatch.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)':
featurepatch.cc:(.text+0x760): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: libpixsfm.a(featuremap.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)':
featuremap.cc:(.text+0x8a0): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: libpixsfm.a(featuremanager.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)':
featuremanager.cc:(.text+0xe0): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: libpixsfm.a(featureview.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)':
featureview.cc:(.text+0x690): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: libpixsfm.a(featureset.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)':
featureset.cc:(.text+0xc00): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: libpixsfm.a(references.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)':
references.cc:(.text+0x340): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: libpixsfm.a(keypoint_adjustment_options.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)':
keypoint_adjustment_options.cc:(.text+0x0): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: libpixsfm.a(bundle_adjustment_options.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)':
bundle_adjustment_options.cc:(.text+0x0): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here
I don't want to spend more time on figuring these out in the near future but I'm happy to address any reviews.
Updating to work with colmap 3.9+ according to #110
I managed to compile the code but it still doesn't link.
Todo:
I had to add a print function for CameraModelId because apparently enums cannot be easily printed:
std::ostream& operator<<(std::ostream& os, const colmap::CameraModelId& id)
Probably there is a really easy fix for this though.Details
Linking CXX shared module ../../lib.linux-x86_64-3.10/pixsfm/_pixsfm.cpython-310-x86_64-linux-gnu.so /usr/bin/ld: libpixsfm.a(graph.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)': graph.cc:(.text+0x11c0): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here /usr/bin/ld: libpixsfm.a(featurepatch.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)': featurepatch.cc:(.text+0x760): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here /usr/bin/ld: libpixsfm.a(featuremap.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)': featuremap.cc:(.text+0x8a0): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here /usr/bin/ld: libpixsfm.a(featuremanager.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)': featuremanager.cc:(.text+0xe0): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here /usr/bin/ld: libpixsfm.a(featureview.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)': featureview.cc:(.text+0x690): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here /usr/bin/ld: libpixsfm.a(featureset.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)': featureset.cc:(.text+0xc00): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here /usr/bin/ld: libpixsfm.a(references.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)': references.cc:(.text+0x340): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here /usr/bin/ld: libpixsfm.a(keypoint_adjustment_options.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)': keypoint_adjustment_options.cc:(.text+0x0): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here /usr/bin/ld: libpixsfm.a(bundle_adjustment_options.cc.o): in function `operator<<(std::ostream&, colmap::CameraModelId const&)': bundle_adjustment_options.cc:(.text+0x0): multiple definition of `operator<<(std::ostream&, colmap::CameraModelId const&)'; CMakeFiles/_pixsfm.dir/_pixsfm/bindings.cc.o (symbol from plugin):(.text+0x0): first defined here
I don't want to spend more time on figuring these out in the near future but I'm happy to address any reviews.