OpenSfM icon indicating copy to clipboard operation
OpenSfM copied to clipboard

Changes made on October 16 break build on Ubuntu 24.04

Open farhaven opened this issue 1 year ago • 1 comments

The changes made on October 16 by generatedunixname89002005279527 remove a bunch of third party files, but leave the infrastructure that tries to build them in place (in particular vlfeat and gtest). This breaks the configuration step (and thus the build) on Ubuntu 24.04.

What is the best way to work around this? As of now, I'm building an older checkout, but this seems to be an issue that should be fixed?

farhaven avatar Oct 18 '24 10:10 farhaven

I had the same issue. I first reverted those changes by

git revert -n 129ab66 b863db5 177d146 444e362

It was still giving me gmock related errors, so I turned test off.

Then it started giving me this error: error: ‘optional’ in namespace ‘std’ does not name a template type I fixed this one by changing the c++ standard to c++17

here's a patch

diff --git a/opensfm/src/CMakeLists.txt b/opensfm/src/CMakeLists.txt
index c85aa6fb..bbae2d2c 100644
--- a/opensfm/src/CMakeLists.txt
+++ b/opensfm/src/CMakeLists.txt
@@ -24,10 +24,13 @@ set(CMAKE_CXX_VISIBILITY_INLINES ON)
 # fPIC
 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 
-# C++14
-set(CMAKE_CXX_STANDARD 14)
+# C++17
+set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
+# Disable tests
+set(OPENSFM_BUILD_TESTS OFF)
+
 # Enable all warnings
 if (NOT WIN32)
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")

nomtats avatar Jan 17 '25 03:01 nomtats