本文介绍了获得在Linux上使用gcc运行的线程构建块(Intel TBB)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图构建一些测试用于线程构建块。不幸的是,我无法配置tbb库。链接器找不到库tbb。我试过运行在bin目录中的脚本没有帮助。我甚至试图将库文件移动到/ usr / local / lib /这是一个翻牌。

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.

推荐答案


  • 确定您将 tbb / lib 文件夹,然后将库的路径添加到 环境变量,可以手动或在〜/ .bashrc

    • 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.

      示例:

      export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib/tbb/lib/intel64/gcc4.4
      


    • 然后,使用g ++

    • Then, compile the program using g++


      • 使用 -I 标志指向头文件目录

      • -L
      • -ltbb

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

      示例:

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


    • 这篇关于获得在Linux上使用gcc运行的线程构建块(Intel TBB)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 22:05