Software & AppsOperating SystemLinux

How To Install Newest TBB on Ubuntu 18.04 for C++17 Parallel Execution Policies

Ubuntu 10

In this article, we will guide you through the process of installing the newest version of Thread Building Blocks (TBB) on Ubuntu 18.04. TBB is a widely used C++ template library developed by Intel for parallel programming. It is particularly useful for leveraging multi-core processor performance.

Quick Answer

To install the newest version of Thread Building Blocks (TBB) on Ubuntu 18.04 for C++17 parallel execution policies, you can add the Ubuntu repository that contains the desired version of TBB or download the latest version directly from Intel’s official GitHub page.

Prerequisites

Before we start, ensure that you have administrative access to your Ubuntu 18.04 system. You will need to use the sudo command, which requires administrator privileges.

Checking the Available TBB Version

Ubuntu 18.04 provides the libtbb-dev package in its default repositories. However, this package may not have the latest version of TBB required for C++17 parallel execution policies. To check the available version, you can run the following command:

apt show libtbb-dev

This command displays detailed information about the libtbb-dev package, including its version. If the available version is older than TBB 2018, you will need to install a newer version.

Adding the Ubuntu Repository

One possible workaround is to add a Ubuntu repository that contains the desired version of TBB. In this article, we will use the repository http://cz.archive.ubuntu.com/ubuntu to install TBB version 2019~U8-1.

To add this repository, run the following command in the terminal:

echo "deb http://cz.archive.ubuntu.com/ubuntu eoan main universe" | sudo tee -a /etc/apt/sources.list

The echo command prints the string that follows. The | symbol is a pipe that passes the output of the preceding command as input to the following command. The tee command is used to append the output to the /etc/apt/sources.list file. The -a option tells tee to append rather than overwrite the file.

Please note that this method may not always work, as mixing sources from different Ubuntu releases can potentially break your system. It is generally recommended to use a newer release of Ubuntu if you require newer software.

Updating the Repositories

After adding the repository, update the repositories by running the following command:

sudo apt update

The apt update command fetches the package information from all configured sources and updates the package list.

Installing the Newest TBB

Finally, install the latest version of libtbb-dev by running the following command:

sudo apt install libtbb-dev

This command installs the newest version of TBB on your Ubuntu 18.04 system.

Alternative Methods

If the above steps do not work for you, consider replacing cz.archive with old-releases in the repository URL. For example:

echo "deb http://old-releases.ubuntu.com/ubuntu eoan main universe" | sudo tee -a /etc/apt/sources.list

Alternatively, you can download the latest version of TBB directly from Intel’s official GitHub page and follow the installation instructions provided there. This method allows you to manually install the desired version of TBB on your Ubuntu 18.04 system.

Conclusion

This article provided a detailed guide on how to install the newest version of TBB on Ubuntu 18.04 for C++17 parallel execution policies. However, it’s always recommended to refer to official documentation or seek further assistance if you encounter any issues during the installation process. Remember to always backup your system before making significant changes like adding new repositories.

Can I install TBB on Ubuntu 18.04 without adding a new repository?

Yes, Ubuntu 18.04 provides the libtbb-dev package in its default repositories. However, if you require a newer version of TBB, you may need to add a different repository or manually install it from Intel’s GitHub page.

How can I check the version of TBB available in the default repositories?

You can use the apt show libtbb-dev command to check the available version of the libtbb-dev package in the default repositories.

Is it safe to mix sources from different Ubuntu releases?

Mixing sources from different Ubuntu releases can potentially break your system. It is generally recommended to use a newer release of Ubuntu if you require newer software.

What should I do if the repository method doesn’t work for me?

If adding a repository doesn’t work, you can try replacing cz.archive with old-releases in the repository URL. Alternatively, you can download the latest version of TBB from Intel’s GitHub page and follow the provided installation instructions.

How can I update the repositories after adding a new one?

You can update the repositories by running the sudo apt update command. This command fetches the package information from all configured sources and updates the package list.

How do I install the newest version of TBB on Ubuntu 18.04?

To install the newest version of TBB, you can use the sudo apt install libtbb-dev command. This will install the latest version of TBB on your Ubuntu 18.04 system.

Leave a Comment

Your email address will not be published. Required fields are marked *