Skip to content

Commit

Permalink
use system package manager for mpi (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir authored Jul 12, 2024
1 parent e9ee1f6 commit 8692890
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 10 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/build_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,20 @@ jobs:
antares-version: ${{needs.versions.outputs.antares-version}}
os: centos7
os-full-name: CentOS-7.9.2009


- name: openmpi-devel
run: |
yum update
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
yum install -y openmpi-devel
- name: Compile Boost
uses: ./.github/workflows/compile-boost
with:
prefix: "${GITHUB_WORKSPACE}/deps"

- name: Install dependencies
run: |
pip3 install --upgrade pip
Expand Down Expand Up @@ -162,6 +175,8 @@ jobs:
- name: Configure
run: |
source /opt/rh/devtoolset-10/enable
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib64/openmpi/bin:$PATH
cmake -B _build -S . \
-DBUILD_TESTING=ON \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/deps \
Expand All @@ -187,8 +202,8 @@ jobs:
timeout-minutes: 120
shell: bash
run: |
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux/tools/openmpi/bin/:$PATH
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:${{ env.XPRS_LIB_Path_CONTAINER }}
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib64/openmpi/bin:${{ env.XPRS_LIB_Path_CONTAINER }}:$PATH
export XPRESS=${{ env.XPRESS_CONTAINER }}
cd _build
ctest -C Release --output-on-failure -L "unit|benders|lpnamer|medium"
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/build_oracle8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
#make gcc &co available system wide and "action wide"
source /opt/rh/gcc-toolset-10/enable
echo $PATH >> $GITHUB_PATH

- run: |
dnf module install -y nodejs:20/common
Expand All @@ -80,6 +81,11 @@ jobs:
with:
submodules: true

- name: Compile Boost
uses: ./.github/workflows/compile-boost
with:
prefix: "${GITHUB_WORKSPACE}/deps"

- name: Checkout xpressmp linux
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -126,6 +132,8 @@ jobs:

- name: Configure
run: |
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib64/openmpi/bin:$PATH
cmake -B _build -S . \
-DBUILD_TESTING=ON \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -143,8 +151,8 @@ jobs:
timeout-minutes: 120
shell: bash
run: |
export PATH=${GITHUB_WORKSPACE}/_build/vcpkg_installed/x64-linux/tools/openmpi/bin/:$PATH
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:${{ env.XPRS_LIB_Path_CONTAINER }}
export PATH=/usr/lib64/openmpi/bin:$PATH
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:${{ env.XPRS_LIB_Path_CONTAINER }}:$LD_LIBRARY_PATH
export XPRESS=${{ env.XPRESS_CONTAINER }}
cd _build
ctest -C Release --output-on-failure -L "unit|benders|lpnamer|medium"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jobs:
sudo apt-get update --fix-missing
sudo apt-get install -y ccache
sudo apt-get install -y g++-10 gcc-10
sudo apt-get install -y libopenmpi-dev

- name: ccache
uses: hendrikmuhs/[email protected]
Expand Down Expand Up @@ -83,6 +85,11 @@ jobs:
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
- name: Compile Boost
uses: ./.github/workflows/compile-boost
with:
prefix: "${GITHUB_WORKSPACE}/deps"

- uses: lukka/get-cmake@latest
with:
useLocalCache: false
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/compile-boost/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Download and compile boost"
description: "Download and compile boost"
inputs:
prefix:
description: 'extra qualifiers'
required: true
runs:
using: "composite"
steps:
- id: install-boost
shell: bash
run: |
source /opt/rh/gcc-toolset-10/enable || true
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib64/openmpi/bin:$PATH
wget https://github.com/boostorg/boost/releases/download/boost-1.81.0/boost-1.81.0.tar.gz
tar xvf boost-1.81.0.tar.gz
cd boost-1.81.0
./bootstrap.sh --prefix=${{inputs.prefix}}/ --with-libraries=serialization,program_options,mpi
echo "using mpi ;" >> project-config.jam
./b2 install
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runs:
run: |
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib64/openmpi/bin:$PATH
mkdir deps
mkdir -p deps
wget https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/v${{inputs.antares-version}}/antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz
tar -xvf antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz -C deps --strip-components=1
rm -rf antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz
8 changes: 7 additions & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
run: |
sudo apt-get update --fix-missing
sudo apt-get install g++-10 gcc-10 libgtest-dev
sudo apt-get install -y libopenmpi-dev
cd /usr/src/googletest/
sudo cmake .
sudo cmake --build . --target install
Expand All @@ -65,7 +66,12 @@ jobs:
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
- name: Compile Boost
uses: ./.github/workflows/compile-boost
with:
prefix: "${GITHUB_WORKSPACE}/deps"

- name: Read antares-solver version
id: antares-version
uses: ./.github/actions/read-json-value
Expand Down
9 changes: 6 additions & 3 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@
"coin-or-cbc",
{
"name": "boost-mpi",
"version>=": "1.81.0"
"version>=": "1.81.0",
"platform": "windows"
},
{
"name": "boost-program-options",
"version>=": "1.81.0"
"version>=": "1.81.0",
"platform": "windows"
},
{
"name": "boost-algorithm",
"version>=": "1.81.0"
"version>=": "1.81.0",
"platform": "windows"
},
"yaml-cpp",
{
Expand Down

0 comments on commit 8692890

Please sign in to comment.