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

落爺英雄遲暮 提交于 2019-12-23 14:57:24

问题


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 files to /usr/local/lib/ which was again a flop. Any suggestions would be helpful.


回答1:


  • 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
    



回答2:


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



来源:https://stackoverflow.com/questions/5586396/getting-thread-building-blocks-intel-tbb-running-on-linux-with-gcc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!