diff --git a/internal/ceres/problem_impl.cc b/internal/ceres/problem_impl.cc index 1c76ea691..1a048e5ed 100644 --- a/internal/ceres/problem_impl.cc +++ b/internal/ceres/problem_impl.cc @@ -731,7 +731,15 @@ bool ProblemImpl::Evaluate(const Problem::EvaluateOptions& evaluate_options, // the Evaluator decides the storage for the Jacobian based on the // type of linear solver being used. evaluator_options.linear_solver_type = SPARSE_NORMAL_CHOLESKY; +#ifndef CERES_USE_OPENMP + LOG_IF(WARNING, evaluate_options.num_threads > 1) + << "OpenMP support is not compiled into this binary; " + << "only evaluate_options.num_threads = 1 is supported. Switching " + << "to single threaded mode."; + evaluator_options.num_threads = 1; +#else evaluator_options.num_threads = evaluate_options.num_threads; +#endif // CERES_USE_OPENMP string error; scoped_ptr evaluator(