File: docker_install_tbb.sh

package info (click to toggle)
memkind 1.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,508 kB
  • sloc: ansic: 72,572; cpp: 39,493; sh: 4,594; perl: 4,250; xml: 2,044; python: 1,753; makefile: 1,393; csh: 7
file content (39 lines) | stat: -rwxr-xr-x 1,273 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (C) 2019 - 2020 Intel Corporation.

# docker_install_tbb.sh - is called inside a Docker container;
# installs Threading Building Block library
#

set -e

TBB_RELEASE_URL=https://github.com/01org/tbb/releases/tag/"$TBB_LIBRARY_VERSION"
TBB_TAR_GZ="$TBB_LIBRARY_VERSION".tar.gz
TBB_TARBALL_URL=https://github.com/01org/tbb/archive/"$TBB_TAR_GZ"
TBB_VARS_SH="tbbvars.sh"

# check if specified TBB release exists
if curl --output /dev/null --silent --head --fail "$TBB_RELEASE_URL"; then
  echo "TBB version ${TBB_LIBRARY_VERSION} exist."
else
  echo "TBB url: ${TBB_RELEASE_URL} is not valid. TBB version: ${TBB_LIBRARY_VERSION} doesn't exist."
  exit 1
fi

TBB_LOCAL_DIR="$HOME"/tbb/"$TBB_LIBRARY_VERSION"
TBB_LOCAL_TAR_GZ="$TBB_LOCAL_DIR"/"$TBB_TAR_GZ"

# create TBB directory in home directory
mkdir -p "$TBB_LOCAL_DIR"

# download and untar TBB library to TBB directory
curl -L "$TBB_TARBALL_URL" -o "$TBB_LOCAL_TAR_GZ"
tar -xzf "$TBB_LOCAL_TAR_GZ" -C "$TBB_LOCAL_DIR" --strip-components=1

# build TBB library
make -j "$(nproc)" --directory="$TBB_LOCAL_DIR"
TBB_RELEASE_DIR=$(ls -d "$TBB_LOCAL_DIR"/build/*release)

# set environment variables regarding TBB package
source "$TBB_RELEASE_DIR"/"$TBB_VARS_SH"