linux tbb 安装_intel tbb 安装

本文档提供了一个Dockerfile,用于在Ubuntu 18.04环境中安装Intel Threading Building Blocks (TBB)。首先,更新源列表并安装必要的依赖项,然后从GitHub克隆TBB源码,编译并安装到系统路径。通过运行容器进行测试,展示了如何在Docker中执行TBB示例,并验证了并行计算的性能提升。
摘要由CSDN通过智能技术生成

写了一个Dockerfile

FROM ubuntu:18.04

ADD sources.list /etc/apt/sources.list

RUN apt-get update && apt-get install -y \

gcc \

g++ \

make \

vim \

wget \

git

RUN cd / && git clone https://github.com/01org/tbb.git && cd tbb && \

make -j56 && cd build && sh generate_tbbvars.sh && sh tbbvars.sh && \

cp linux_intel64_gcc_cc7_libc2.27_kernel3.10.0_release/*.so* /usr/lib/ && \

cd ../include && cp -r ./* /usr/local/include && \

/sbin/ldconfig

sources.list内容

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

build:

docker build -t tbb:v0 .

测试:

docker run -it --network=host --name=tbb -v `pwd`:/work -w /work tbb:v0 bash

root@host:/work# ls

CHANGES Doxyfile Makefile README.md cmake examples index.html python src

Dockerfile LICENSE README build doc include jni sources.list

root@host:/work# cd examples/

GettingStarted/ concurrent_priority_queue/ parallel_for/ task_arena/

Makefile graph/ parallel_reduce/ task_group/

common/ index.html pipeline/ test_all/

concurrent_hash_map/ parallel_do/ task/

root@host:/work# cd examples/pipeline/

index.html square/

root@host:/work# cd examples/pipeline/square/

root@host:/work/examples/pipeline/square# make

g++ -O2 -DNDEBUG -o square square.cpp gen_input.cpp -ltbb -lrt

./square 0 input.txt output.txt

serial run time = 0.151666

parallel run time = 0.0278103

elapsed time : 0.271129 seconds

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值