Open chennuo0125-HIT opened 4 months ago
@sandwichmaker could you tell me why above problem occured ?
The error stems from your Homebrew version of SuiteSparse not from Ceres:
/opt/homebrew/lib/cmake/SuiteSparse_config/SuiteSparse_configConfig.cmake:68 (find_dependency)
For some reason, the OpenMP C component is not usable. You could check the CMake configure log to identify the issue.
@sergiud if not ceres proplem, why can i replace ceres version solve the problem ?
@sergiud ceres 2.1.0 is ok, but ceres 2.2.0 not ok
Three people around me have all experienced this problem,we just run "brew update" and the problem occurred, my home brew version: Homebrew 4.0.23-12-ge986264
While Ceres 2.1.0 supported OpenMP as one of the threading backends, Ceres 2.2.0 removed OpenMP support in 06bfe6ffacecd09f82ca54e761117aa7d9bca565. This is likely the reason why the issue no longer occurs in Ceres 2.2.0. However, even in 2.1.0 Ceres did nothing special here: https://github.com/ceres-solver/ceres-solver/blob/f68321e7de8929fbcdb95dd42877531e64f72f66/cmake/CeresThreadingModels.cmake#L55 Therefore, I suggest reporting the issue to Homebrew or SuiteSparse maintainers. There seems to be a conflict in the way OpenMP components are requested and used. Relying on a language specific version of OpenMP in the dependency chain can generally cause problems, e.g., if a CMake project that enables the use of a CXX compiler only also depends on a component requiring a C compiler (and vice versa).
@sergiud how can i remove OpenMP support in ceres 2.1.0 ?
You could try explicitly setting the CERES_THREADING_MODEL
CMake variable, e.g., to CXX_THREADS
to avoid Ceres invoking the above find_package
call. Alternatively, you can unconditionally set the threading backend to CXX_THREADS
here:
https://github.com/ceres-solver/ceres-solver/blob/f68321e7de8929fbcdb95dd42877531e64f72f66/cmake/CeresThreadingModels.cmake#L65-L82
macos version: Sonoma 14.2.1 problem: I make install ceres-solver 2.1.0 from source, and find_package(Ceres REQUIRED) in cmakelist demo, and I got follow problem:
but if I install ceres-solver 2.2.0 , and the result is ok.
why does this problem happen ?