Basically the main procedure is posted on the openimageio wiki page, see reference below. However I encounter the following error:
libOpenImageIO.a(tbb_misc.cpp.o): In function `__TBB_machine_store8_slow_perf_warning': tbb_misc.cpp:(.text+0x342): undefined reference to `tbb::internal::runtime_warning(char const*, ...)'
After looking through the source code, this function is defined in /src/include/tbb/tbb_assert_impl.h, not in tbb_misc.h. So we simply include the header file in tbb_misc.cpp, that's done!
// In tbb_misc.cpp file, Add this following line at the beginning