Skip to content

Commit

Permalink
Remove TBB dependency (#851)
Browse files Browse the repository at this point in the history
With gcc10, TBB isn't required anymore to support
std::execution_policies

---------

Co-authored-by: abdoulbari zaher <[email protected]>
  • Loading branch information
JasonMarechal25 and a-zakir authored Jun 20, 2024
1 parent 096f7ca commit 8749aa2
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 83 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ jobs:
os: centos7
os-full-name: CentOS-7.9.2009

- name: Compile tbb
uses: ./.github/workflows/compile-tbb

- name: Install dependencies
run: |
pip3 install --upgrade pip
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/build_oracle8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ jobs:
os: Oracle8
os-full-name: OracleServer-8.10

- name: Compile TBB
uses: ./.github/workflows/compile-tbb

- run: |
mkdir -p ${{ github.workspace }}/vcpkg_cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Install mandatory system libraries
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y ccache libtbb-dev
sudo apt-get install -y ccache
sudo apt-get install -y g++-10 gcc-10
- name: Update alternatives
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ jobs:
# Allows to restore a cache when deps have only partially changed (like adding a dependency)
restore-keys: vcpkg-cache-windows-

- name: Compile tbb
uses: ./.github/workflows/compile-tbb
with:
cmake: 'cmake'

- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-zip
with:
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/compile-tbb/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Install libraries
run: |
sudo apt-get update --fix-missing
sudo apt-get install libjsoncpp-dev libgtest-dev libboost-mpi-dev libboost-program-options-dev libtbb-dev
sudo apt-get install libjsoncpp-dev libgtest-dev libboost-mpi-dev libboost-program-options-dev
sudo apt-get install g++-10 gcc-10
cd /usr/src/googletest/
sudo cmake .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-system-deps-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Install mandatory system libraries
run: |
sudo apt-get update --fix-missing
sudo apt-get install libtbb-dev
sudo apt-get install g++-10 gcc-10
- uses: lukka/get-cmake@latest
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/windows-vcpkg-deps-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ jobs:
# Allows to restore a cache when deps have only partially changed (like adding a dependency)
restore-keys: vcpkg-cache-windows

- name: Compile tbb
uses: ./.github/workflows/compile-tbb
with:
cmake: 'cmake'

- name: Configure
run: |
$pwd=Get-Location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Antares-Xpansion depends on several mandatory libraries:
- [Boost](https://www.boost.org/) : MPI serialization (only for MPI benders compilation), program-options,
- [Doxygen](https://www.doxygen.nl/index.html) for documentation generation,
- [GraphViz](https://graphviz.org/) for Doxygen use.
- [TBB](https://github.com/oneapi-src/oneTBB) for execution policy and parallelization

This section describes the install procedures for the third-party open source libraries used by Antares-Xpansion.
The install procedure can be done:
Expand Down Expand Up @@ -45,7 +44,7 @@ The install procedure can be done:
3. Install dependencies:
```
cd vcpkg
vcpkg install jsoncpp gtest boost-mpi boost-program-options tbb --triplet <vcpkg-triplet>
vcpkg install jsoncpp gtest boost-mpi boost-program-options --triplet <vcpkg-triplet>
```
!!! Note
Expand All @@ -64,23 +63,10 @@ The install procedure can be done:
sudo yum install libuuid-devel
```

=== "Centos (other dependencies)"

Antares-Xpansion depends on 2018 <= TBB <= 2020 for libstdc++9 compatibility but centos7 only provide 2013 version. TBB can be build from source using the [official source code compatible branch](https://github.com/oneapi-src/oneTBB/tree/tbb_2020)
Unfortuanatly the compilation and installation of the official source code can be tedious. One alternative is to trust a third party repository which provide cmake build system for TBB.
We propose to use the following [third party repository](https://github.com/wjakob/tbb.git) installation procedure

git clone https://github.com/wjakob/tbb.git
cd tbb/build
cmake3 ..
cmake3 --build . --target install -j8

Include and libraries will be installed in /usr/local

=== "Ubuntu (apt-get)"

```
sudo apt-get install lsb-release libjsoncpp-dev libgtest-dev libboost-mpi-dev doxygen graphviz libboost-program-options-dev libtbb-dev
sudo apt-get install lsb-release libjsoncpp-dev libgtest-dev libboost-mpi-dev doxygen graphviz libboost-program-options-dev
sudo apt-get install unzip uuid-dev
```
!!! Note
Expand Down
8 changes: 0 additions & 8 deletions src/cpp/benders/benders_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# Targets
# ===========================================================================

find_package(TBB REQUIRED CONFIG)
if (TBB_VERSION_MAJOR VERSION_LESS "2018")
message(FATAL_ERROR "Require tbb 2018 or higher.")
endif()
if (TBB_VERSION_MAJOR VERSION_GREATER "2020")
message(FATAL_ERROR "Require tbb 2018 to 2020.")
endif()
find_package(yaml-cpp CONFIG REQUIRED)
add_library (benders_core STATIC
${CMAKE_CURRENT_SOURCE_DIR}/SubproblemWorker.cpp
Expand Down Expand Up @@ -44,7 +37,6 @@ target_link_libraries (benders_core
helpers
output_core
solvers
TBB::tbb
${JSONCPP_LIB}
yaml-cpp
)
Expand Down
9 changes: 0 additions & 9 deletions src/cpp/lpnamer/problem_modifier/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
# Targets
# ===========================================================================

find_package(TBB REQUIRED CONFIG)
if (TBB_VERSION_MAJOR VERSION_LESS "2018")
message(FATAL_ERROR "Require tbb 2018 or higher.")
endif()
if (TBB_VERSION_MAJOR VERSION_GREATER "2020")
message(FATAL_ERROR "Require tbb 2018 to 2020.")
endif()

add_library(lp_namer_problem_modifier STATIC
${CMAKE_CURRENT_SOURCE_DIR}/LinkdataRecord.cpp
${CMAKE_CURRENT_SOURCE_DIR}/LinkProblemsGenerator.cpp
Expand Down Expand Up @@ -70,7 +62,6 @@ target_link_libraries (lp_namer_problem_modifier
lp_namer_helper
helpers
solvers
TBB::tbb
)

add_library (${PROJECT_NAME}::lp_namer_problem_modifier ALIAS lp_namer_problem_modifier)
14 changes: 1 addition & 13 deletions src/cpp/sensitivity/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
find_package(TBB REQUIRED CONFIG)
if (TBB_VERSION_MAJOR VERSION_LESS "2018")
message(FATAL_ERROR "Require tbb 2018 or higher.")
endif()
if (TBB_VERSION_MAJOR VERSION_GREATER "2020")
message(FATAL_ERROR "Require tbb 2018 to 2020.")
endif()

add_library (sensitivity_core
SensitivityInputReader.cpp
SensitivityMasterLogger.cpp
Expand All @@ -28,10 +20,6 @@ target_include_directories (sensitivity_core
target_link_libraries (sensitivity_core
PUBLIC
logger_lib
TBB::tbb
)

add_library (${PROJECT_NAME}::sensitivity_core ALIAS sensitivity_core)
install(FILES
$<TARGET_FILE:TBB::tbb>
DESTINATION bin)
add_library (${PROJECT_NAME}::sensitivity_core ALIAS sensitivity_core)

0 comments on commit 8749aa2

Please sign in to comment.