[Sources] Fix code location in some Windows systems #1718
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: | |
- master | |
# schedule: | |
# - cron: '0 1 * * *' | |
workflow_dispatch: | |
concurrency: | |
group: CI-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
Ubuntu-Cpp-C: | |
runs-on: ubuntu-latest | |
name: "Ubuntu C++ & C (${{ matrix.compiler }} / ${{ matrix.mpi }})" | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: [GCC, CLANG, ICC] | |
mpi: [OpenMPI, IntelMPI] | |
exclude: | |
# CLANG is not properly supported by Intel, better use LLVMIntel in the future | |
- compiler: CLANG | |
mpi: IntelMPI | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
# see https://software.intel.com/content/www/us/en/develop/articles/installing-intel-oneapi-toolkits-via-apt.html#pkgtable | |
cd /tmp | |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" | |
sudo apt-get update | |
sudo apt-get install \ | |
valgrind \ | |
clang-11 | |
- name: Install Intel compiler | |
if: ${{ matrix.compiler == 'ICC' }} | |
run: sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic | |
- name: Install MPI | |
run: | | |
if [ ${{ matrix.mpi }} = OpenMPI ]; then | |
sudo apt-get install libopenmpi-dev openmpi-bin | |
else | |
sudo apt-get install intel-oneapi-mpi-devel | |
fi | |
- name: Build CoSimIO | |
run: | | |
if [ ${{ matrix.compiler }} = GCC ]; then | |
export CXX=/usr/bin/g++ | |
export CC=/usr/bin/gcc | |
elif [ ${{ matrix.compiler }} = CLANG ]; then | |
export CXX=/usr/bin/clang++-11 | |
export CC=/usr/bin/clang-11 | |
elif [ ${{ matrix.compiler }} = ICC ]; then | |
export CXX=icpc | |
export CC=icc | |
else | |
echo 'Unsupported compiler: ${{ matrix.compiler }}' | |
exit 1 | |
fi | |
if [ ${{ matrix.compiler }} = ICC ] || [ ${{ matrix.mpi }} = IntelMPI ]; then | |
source /opt/intel/oneapi/setvars.sh | |
fi | |
build_mpi_comm=OFF | |
if [ ${{ matrix.mpi }} = IntelMPI ]; then | |
build_mpi_comm=ON | |
fi | |
cmake -H"." -B"build" \ | |
-DCMAKE_BUILD_TYPE="Debug" \ | |
-DCO_SIM_IO_BUILD_C=ON \ | |
-DCO_SIM_IO_BUILD_FORTRAN=OFF \ | |
-DCO_SIM_IO_BUILD_MPI=ON \ | |
-DCO_SIM_IO_BUILD_MPI_COMMUNICATION=$build_mpi_comm \ | |
-DCO_SIM_IO_STRICT_COMPILER=ON | |
cmake --build "build" --target install -- -j2 | |
- name: Running tests | |
env: | |
OMPI_MCA_rmaps_base_oversubscribe: 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0) | |
run: | | |
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin | |
export PATH=${PATH}:${GITHUB_WORKSPACE}/bin # required for IntelMPI | |
export PATH=${PATH}:${GITHUB_WORKSPACE}/bin/tests_c_mpi # required for IntelMPI | |
if [ ${{ matrix.compiler }} = ICC ] || [ ${{ matrix.mpi }} = IntelMPI ]; then | |
source /opt/intel/oneapi/setvars.sh | |
fi | |
cd build | |
ctest -T memcheck --output-on-failure | |
- uses: actions/upload-artifact@v2 | |
if: failure() | |
with: | |
name: "CTest Log Ubuntu C++ & C (${{ matrix.compiler }}-${{ matrix.mpi }})" | |
path: ${{ github.workspace }}/build/Testing/ | |
Ubuntu-Python: | |
runs-on: ubuntu-latest | |
name: Ubuntu Python ${{ matrix.python-version }} (${{ matrix.compiler }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
compiler: [GCC, ICC] | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Intel compiler | |
if: ${{ matrix.compiler == 'ICC' }} | |
run: | | |
# see https://software.intel.com/content/www/us/en/develop/articles/installing-intel-oneapi-toolkits-via-apt.html#pkgtable | |
cd /tmp | |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" | |
sudo apt-get update | |
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic | |
- name: Install MPI | |
run: | | |
sudo apt-get update | |
sudo apt-get install libopenmpi-dev openmpi-bin | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Build CoSimIO | |
run: | | |
cmake -H"." -B"build" \ | |
-DCMAKE_BUILD_TYPE="Debug" \ | |
-DCO_SIM_IO_BUILD_PYTHON=ON \ | |
-DCO_SIM_IO_BUILD_MPI=ON \ | |
-DPYBIND11_PYTHON_VERSION=${{ matrix.python-version }} \ | |
-DCO_SIM_IO_STRICT_COMPILER=ON | |
cmake --build "build" --target install -- -j2 | |
- name: Running tests | |
run: | | |
if [ ${{ matrix.compiler }} = ICC ]; then | |
source /opt/intel/oneapi/setvars.sh | |
fi | |
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin | |
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin | |
cd tests | |
# TODO delete build dir to make sure the linking etc works correctly? | |
python run_python_tests.py | |
- name: Running MPI tests | |
run: | | |
if [ ${{ matrix.compiler }} = ICC ]; then | |
source /opt/intel/oneapi/setvars.sh | |
fi | |
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin | |
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin | |
cd tests | |
#TODO run the tests... | |
# TODO delete build dir to make sure the linking etc works correctly? | |
# python run_python_tests.py | |
MacOS-Cpp-C: | |
runs-on: macOS-latest | |
name: MacOS C++ & C | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build CoSimIO | |
run: | | |
cmake -H"." -B"build" \ | |
-DCMAKE_BUILD_TYPE="Debug" \ | |
-DCO_SIM_IO_BUILD_C=ON \ | |
-DCO_SIM_IO_STRICT_COMPILER=ON | |
cmake --build "build" --target install -- -j3 | |
- name: Running tests | |
run: | | |
cd build | |
ctest --output-on-failure | |
MacOS-Python: | |
runs-on: macOS-latest | |
name: MacOS Python ${{ matrix.python-version }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Build CoSimIO | |
run: | | |
cmake -H"." -B"build" \ | |
-DCMAKE_BUILD_TYPE="Debug" \ | |
-DCO_SIM_IO_BUILD_PYTHON=ON \ | |
-DPYBIND11_PYTHON_VERSION=${{ matrix.python-version }} \ | |
-DCO_SIM_IO_STRICT_COMPILER=ON | |
cmake --build "build" --target install -- -j3 | |
- name: Running tests | |
run: | | |
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin | |
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin | |
cd tests | |
# TODO delete build dir to make sure the linking etc works correctly? | |
python run_python_tests.py | |
Windows-Cpp-C: | |
runs-on: windows-2022 | |
name: Windows C++ & C | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build CoSimIO | |
shell: cmd | |
run: | | |
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 || goto :error | |
set CC=cl.exe | |
set CXX=cl.exe | |
cmake ^ | |
-G"Visual Studio 17 2022" ^ | |
-H"." ^ | |
-B"build" ^ | |
-DCMAKE_BUILD_TYPE="Debug" ^ | |
-DCO_SIM_IO_BUILD_C=ON ^ | |
-DCO_SIM_IO_STRICT_COMPILER=ON || goto :error | |
cmake --build "build" --target install -- /p:Platform=x64 || goto :error | |
goto :EOF | |
:error | |
echo Failed with error #%errorlevel%. | |
exit /b %errorlevel% | |
- name: Running tests | |
shell: cmd | |
run: | | |
set PATH=%PATH%;%GITHUB_WORKSPACE%/bin | |
cd build | |
ctest -C Debug --output-on-failure | |
Windows-Python: | |
runs-on: windows-2022 | |
name: Windows Python ${{ matrix.python-version }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Installing dependencies | |
shell: cmd | |
run: | | |
pip install numpy | |
- name: Build CoSimIO | |
shell: cmd | |
run: | | |
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 || goto :error | |
set CC=cl.exe | |
set CXX=cl.exe | |
cmake ^ | |
-G"Visual Studio 17 2022" ^ | |
-H"." ^ | |
-B"build" ^ | |
-DCO_SIM_IO_BUILD_PYTHON=ON ^ | |
-DCO_SIM_IO_STRICT_COMPILER=ON || goto :error | |
cmake --build "build" --target install -- /p:Platform=x64 || goto :error | |
goto :EOF | |
:error | |
echo Failed with error #%errorlevel%. | |
exit /b %errorlevel% | |
- name: Running tests | |
env: | |
PYTHON_CMD: python # for the tests (subprocess) | |
shell: cmd | |
run: | | |
set PYTHONPATH=%PYTHONPATH%;%GITHUB_WORKSPACE%/bin | |
cd tests | |
rem TODO delete build dir to make sure the linking etc works correctly? | |
python run_python_tests.py | |
CentOS-7: | |
runs-on: ubuntu-latest | |
name: CentOS 7 | |
container: | |
image: kratosmultiphysics/kratos-image-ci-centos7-python35:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build CoSimIO | |
run: | | |
cmake -H"." -B"build" \ | |
-DCMAKE_BUILD_TYPE="Debug" \ | |
-DCO_SIM_IO_BUILD_C=ON \ | |
-DCO_SIM_IO_BUILD_PYTHON=ON \ | |
-DCO_SIM_IO_STRICT_COMPILER=ON | |
cmake --build "build" --target install -- -j2 | |
- name: Running tests (Ctest) | |
run: | | |
cd build | |
ctest --output-on-failure | |
- name: Running tests (Python) | |
run: | | |
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin | |
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin | |
cd tests | |
# TODO delete build dir to make sure the linking etc works correctly? (Needs to be done after running CTests) | |
python3.5 run_python_tests.py | |
Ubuntu-old-CMake: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '2.8.x' | |
- name: Use cmake | |
run: cmake --version | |
- name: Install MPI | |
run: | | |
sudo apt-get update | |
sudo apt-get install libopenmpi-dev openmpi-bin | |
- uses: actions/checkout@v2 | |
- name: Build CoSimIO | |
run: | | |
cmake -H"." -B"build" \ | |
-DCMAKE_BUILD_TYPE="Debug" \ | |
-DCO_SIM_IO_BUILD_C=ON \ | |
-DCO_SIM_IO_BUILD_PYTHON=OFF \ | |
-DCO_SIM_IO_BUILD_TESTING=OFF \ | |
-DCO_SIM_IO_BUILD_MPI=ON \ | |
-DCO_SIM_IO_STRICT_COMPILER=ON | |
cmake --build "build" --target install -- -j2 |