From b74412fbc672276c057ab215e71488d3d262bc97 Mon Sep 17 00:00:00 2001 From: John Haddon Date: Tue, 24 Feb 2015 11:29:34 +0000 Subject: [PATCH] Fixed clang build. TBB doesn't actually define the task_scheduler_init::automatic symbol, and clang wants to reference it rather than evaluate the constant. I don't quite understant it fully, but there's some detail on a similar problem here : http://stackoverflow.com/questions/5391973/undefined-reference-to-static-const-int --- src/GafferModule/GafferModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GafferModule/GafferModule.cpp b/src/GafferModule/GafferModule.cpp index 08bd0aaffb0..8116eba5001 100644 --- a/src/GafferModule/GafferModule.cpp +++ b/src/GafferModule/GafferModule.cpp @@ -178,11 +178,11 @@ BOOST_PYTHON_MODULE( _Gaffer ) DependencyNodeClass(); object tsi = class_( "_tbb_task_scheduler_init", no_init ) - .def( init( arg( "max_threads" ) = tbb::task_scheduler_init::automatic ) ) + .def( init( arg( "max_threads" ) = int( tbb::task_scheduler_init::automatic ) ) ) .def( "__enter__", &TaskSchedulerInitWrapper::enter, return_self<>() ) .def( "__exit__", &TaskSchedulerInitWrapper::exit ) ; - tsi.attr( "automatic" ) = tbb::task_scheduler_init::automatic; + tsi.attr( "automatic" ) = int( tbb::task_scheduler_init::automatic ); object behavioursModule( borrowed( PyImport_AddModule( "Gaffer.Behaviours" ) ) ); scope().attr( "Behaviours" ) = behavioursModule;