Removing old test script for building openmpi #112
This file contains hidden or 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: LBPM CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [master, dev] | |
| pull_request: | |
| branches: [master, dev] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| env: | |
| MPI_VERSION: "4.1.8" | |
| ZLIB_VERSION: "1.3.1" | |
| HDF5_VERSION: "1.14.6" | |
| MPI_DIR: ${{ github.workspace }}/deps/openmpi | |
| LBPM_ZLIB_DIR: ${{ github.workspace }}/deps/zlib | |
| LBPM_HDF5_DIR: ${{ github.workspace }}/hdf5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: LBPM | |
| - name: Install build tools | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y build-essential cmake wget tar | |
| - name: Cache compiled deps (OpenMPI, zlib, HDF5) | |
| id: cache-deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps/openmpi | |
| deps/zlib | |
| deps/hdf5 | |
| key: ${{ runner.os }}-lbpm-deps-mpi${{ env.MPI_VERSION }}-zlib${{ env.ZLIB_VERSION }}-hdf5${{ env.HDF5_VERSION }} | |
| restore-keys: | | |
| ${{ runner.os }}-lbpm-deps- | |
| - name: Build OpenMPI | |
| if: steps.cache-deps.outputs.cache-hit != 'true' | |
| run: | | |
| wget -q https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-${MPI_VERSION}.tar.gz | |
| tar -xzf openmpi-${MPI_VERSION}.tar.gz | |
| cd openmpi-${MPI_VERSION} | |
| ./configure --prefix="${MPI_DIR}" | |
| make -j | |
| make install | |
| - name: Build zlib | |
| if: steps.cache-deps.outputs.cache-hit != 'true' | |
| run: | | |
| wget -q https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz | |
| tar -xzf zlib-${ZLIB_VERSION}.tar.gz | |
| cd zlib-${ZLIB_VERSION} | |
| ./configure --prefix="${LBPM_ZLIB_DIR}" | |
| make -j | |
| make install | |
| - name: Build HDF5 (parallel) | |
| if: steps.cache-deps.outputs.cache-hit != 'true' | |
| run: | | |
| wget -q https://sourceforge.net/projects/hdf5.mirror/files/hdf5_${HDF5_VERSION}/hdf5-${HDF5_VERSION}.tar.gz/download -O hdf5-${HDF5_VERSION}.tar.gz | |
| tar -xzf hdf5-${HDF5_VERSION}.tar.gz | |
| cd hdf5-${HDF5_VERSION} | |
| CC="${MPI_DIR}/bin/mpicc" CXX="${MPI_DIR}/bin/mpicxx" CXXFLAGS="-fPIC -O3 -std=c++14" \ | |
| ./configure --prefix="${LBPM_HDF5_DIR}" --enable-parallel --enable-shared --with-zlib="${LBPM_ZLIB_DIR}" | |
| make -j | |
| make install | |
| # Ensure the cached/restored MPI is on PATH | |
| - name: Add MPI to PATH | |
| run: echo "${MPI_DIR}/bin" >> $GITHUB_PATH | |
| - name: Configure CMake | |
| run: | | |
| cmake -S LBPM -B build \ | |
| -D USE_SILO=0 \ | |
| -D USE_TIMER=0 \ | |
| -D USE_CUDA=0 \ | |
| -D CMAKE_BUILD_TYPE=Release \ | |
| -D CMAKE_C_COMPILER:PATH="${MPI_DIR}/bin/mpicc" \ | |
| -D CMAKE_CXX_COMPILER:PATH="${MPI_DIR}/bin/mpicxx" \ | |
| -D MPI_CXX_COMPILER="${MPI_DIR}/bin/mpicxx" \ | |
| -D CMAKE_C_FLAGS="-fPIC" \ | |
| -D CMAKE_CXX_FLAGS="-fPIC" \ | |
| -D CMAKE_CXX_STD=14 \ | |
| -D TEST_MAX_PROCS=1 \ | |
| -D HDF5_DIRECTORY="${LBPM_HDF5_DIR}" | |
| - name: build and make | |
| run: | | |
| cd build | |
| make install | |
| - name: tests | |
| run: | | |
| ctest --test-dir build --output-on-failure |