Skip to content

Commit

Permalink
Make mpicxx use g++10
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMarechal25 committed Jan 22, 2024
1 parent b7e98e6 commit db24f8b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ jobs:
sudo apt-get install -y ccache cmake libgtest-dev libjsoncpp-dev libtbb-dev libopenmpi-dev
sudo apt-get install -y g++-10 gcc-10
- name: Update alternatives
#mpicxx uses "g++" so we need g++ to be symbolic link to g++-10
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
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: Read antares-solver version
id: antares-version
uses: ./.github/actions/read-json-value
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ jobs:
sudo cmake .
sudo cmake --build . --target install
- name: Update alternatives
#mpicxx uses "g++" so we need g++ to be symbolic link to g++-10
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
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: Read antares-solver version
id: antares-version
uses: ./.github/actions/read-json-value
Expand Down Expand Up @@ -86,7 +96,6 @@ jobs:
antares-version: ${{steps.antares-version.outputs.result}}
os: ${{matrix.os}}
os-full-name: Ubuntu-20.04
buildtype: Debug

- name: Compile Boost
uses: ./.github/workflows/compile-boost
Expand All @@ -100,17 +109,18 @@ jobs:
git submodule update --init --recursive .
- name: Configure
shell: bash
run: |
cmake -B _build -S . \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER=/usr/bin/gcc-10 \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \
-DDEPS_INSTALL_DIR=rte-antares-deps-Debug\
-DCODE_COVERAGE=ON\
-DBUILD_TESTING=ON\
-DBUILD_antares_solver=OFF\
-DCMAKE_BUILD_TYPE=Debug\
-DDEPS_INSTALL_DIR=rte-antares-deps-Release \
-DCODE_COVERAGE=ON \
-DBUILD_TESTING=ON \
-DBUILD_antares_solver=OFF \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=_install
- name: Build
Expand All @@ -120,7 +130,7 @@ jobs:
continue-on-error: true
run: |
cd $GITHUB_WORKSPACE/_build
ctest -C Release --output-on-failure -L "unit"
ctest -C Debug --output-on-failure -L "unit"
- name: Compile coverage reports
run: |
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,21 @@ message ("CMAKE_SOURCE_DIR : ${CMAKE_SOURCE_DIR}")
message ("CMAKE_C_COMPILER_VERSION : ${CMAKE_C_COMPILER_VERSION}")
message ("CMAKE_CXX_COMPILER_VERSION : ${CMAKE_CXX_COMPILER_VERSION}")

set(CODE_COVERAGE FALSE CACHE BOOL "Enable code coverage")
message("DCOVERAGE ${CODE_COVERAGE}")
if (CODE_COVERAGE)
message("Code coverage enabled")
# if code-coverage is ON, force tests build
set(BUILD_TESTING ON)

include(CodeCoverage)
code_coverage(NAME code-coverage
OUTPUT_DIR coverage
EXCLUDE_DIRS tests)
else ()
message("Code coverage disabled")
endif ()
set(CODE_COVERAGE FALSE CACHE BOOL "Enable code coverage")


# ===========================================================================
# External dependencies
Expand Down
2 changes: 1 addition & 1 deletion tests/end_to_end/lpnamer/test_lpnamerEndToEnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def setup_and_teardown_lp_directory(request):
lp_dir = test_dir.parent / (test_dir.stem + "-Xpansion") / "lp"
if Path(lp_dir).is_dir():
shutil.rmtree(lp_dir)
Path(lp_dir).mkdir(exist_ok=True)
Path(lp_dir).mkdir(parents=True, exist_ok=True)

list_files = list(Path(test_dir).glob("*.mps"))
list_files.extend(list(Path(test_dir).glob("variables*.txt")))
Expand Down

0 comments on commit db24f8b

Please sign in to comment.