Skip to content

Commit

Permalink
Fixed clang build.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
johnhaddon committed Feb 24, 2015
1 parent 1bc995e commit b74412f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/GafferModule/GafferModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ BOOST_PYTHON_MODULE( _Gaffer )
DependencyNodeClass<SwitchComputeNode>();

object tsi = class_<TaskSchedulerInitWrapper, boost::noncopyable>( "_tbb_task_scheduler_init", no_init )
.def( init<int>( arg( "max_threads" ) = tbb::task_scheduler_init::automatic ) )
.def( init<int>( 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;
Expand Down

0 comments on commit b74412f

Please sign in to comment.