开发者

Getting Thread Building Blocks (Intel TBB) running on Linux with gcc

I'm trying to build some tests for threading building blocks. Unfortunately, I'm unable to configure the tbb library. The linker cannot find the library tbb. I've tried running the scripts in bin directory which has not helped. I've even tried moving the library f开发者_运维技巧iles to /usr/local/lib/ which was again a flop. Any suggestions would be helpful.


  • Determine where you have put the tbb/lib folder, and then add the path to the library to the LD_LIBRARY_PATH environment variable, either manually or in ~/.bashrc.

    Example:

    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib/tbb/lib/intel64/gcc4.4
    
  • Then, compile the program using g++

    • with the -I flag pointing at the header files directory
    • the -L flag pointing at the library directory
    • and -ltbb

    Example:

    g++ program.cpp -o program -I/usr/local/lib/tbb/include -L/usr/local/lib/tbb/lib/intel64/gcc4.4 -ltbb
    


After building/installing and making sure that /etc/ld.so.conf has the proper listing for the directories pointing to where your libraries are stored, you might want to try and run sudo ldconfig on the command-line and see if that changes anything.

Hope this helps,

Jason

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜