Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I link against Intel TBB on Mac OS X with GCC?

I can't for the life of me figure out how to compile and link against the Intel TBB library on my Mac. I've run the commercial installer and the tbbvars.sh script but I can't figure this out. I have a feeling it is something really obvious and it's just been a bit too long since I've done this kind of thing.

tbb_test.cpp

#include <tbb/concurrent_queue.h>

int main() {
    tbb::concurrent_queue<int> q;
}

g++ tbb_test.cpp -I /Library/Frameworks/TBB.framework/Headers -ltbb

...can't find the symbols.

Cheers!

UPDATE:

g++ tbb_test.cpp -I /Library/Frameworks/TBB.framework/Headers -L /Library/Frameworks/TBB.framework/Libraries/libtbb.dylib

works!

like image 320
Nick Strupat Avatar asked Oct 14 '25 14:10

Nick Strupat


1 Answers

Since you are using a framework instead of a traditional library, you need to use -framework, like:

g++ tbb_test.cpp -o tbb_test -framework TBB

Instead of:

g++ tbb_test.cpp -o tbb_test -I /Library/Frameworks/TBB.framework/Headers -ltbb
like image 157
Michael Aaron Safyan Avatar answered Oct 17 '25 04:10

Michael Aaron Safyan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!