From f3156d47178c3cf8b55fa13243868ab558a802ad Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Mon, 19 Aug 2013 15:51:06 +0000 Subject: [PATCH] fix when TBB is disabled --- examples/SolverComparer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/SolverComparer.cpp b/examples/SolverComparer.cpp index 6bdb8cf26..49159924d 100644 --- a/examples/SolverComparer.cpp +++ b/examples/SolverComparer.cpp @@ -34,9 +34,11 @@ #include #include +#ifdef GTSAM_USE_TBB #include #undef max // TBB seems to include windows.h and we don't want these macros #undef min +#endif using namespace std; using namespace gtsam; @@ -185,12 +187,19 @@ int main(int argc, char *argv[]) { } } +#ifdef GTSAM_USE_TBB std::auto_ptr init; if(nThreads > 0) { cout << "Using " << nThreads << " threads" << endl; init.reset(new tbb::task_scheduler_init(nThreads)); } else cout << "Using threads for all processors" << endl; +#else + if(nThreads > 0) { + std::cout << "GTSAM is not compiled with TBB, so threading is disabled and the --threads option cannot be used." << endl; + exit(1); + } +#endif // Run mode if(incremental)