diff --git a/.github/workflows/build-tandem.yml b/.github/workflows/build-tandem.yml new file mode 100644 index 00000000..4007c3d9 --- /dev/null +++ b/.github/workflows/build-tandem.yml @@ -0,0 +1,91 @@ +name: tandem-build + +on: + push: + +env: + PETSC_CACHE_FOLDER: ${{ github.workspace }}/.petsc + ARCHITECTURE: arch-linux-c-opt + +jobs: + build-and-test: + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + compiler: + - cc: gcc-13 + cxx: g++-13 + - cc: clang-18 + cxx: clang++-18 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Dependencies and Compilers + run: | + sudo apt-get update + sudo apt-get install -y \ + gcc-13 g++-13 \ + cmake \ + openmpi-bin libopenmpi-dev \ + libmetis-dev libparmetis-dev \ + libeigen3-dev python3-numpy \ + libopenblas0 libopenblas-dev \ + liblua5.3-0 liblua5.3-dev \ + libomp-dev libgomp1 + # libxsmm + git clone --depth 1 --branch 1.17 https://github.com/libxsmm/libxsmm.git gitbuild && \ + mkdir -p gitbuild && cd gitbuild && \ + make generator -j $(nproc) && sudo cp bin/libxsmm_gemm_generator /usr/bin && \ + cd .. && rm -rf gitbuild + + - name: Get Ubuntu and PETSc Version + id: get_version + run: | + UBUNTU_VERSION=$(lsb_release -r | awk '{print $2}') + echo "UBUNTU_VERSION=$UBUNTU_VERSION" >> $GITHUB_ENV + petsc_version=$(curl -s https://pypi.org/pypi/petsc/json | jq -r '.info.version') + echo "PETSC_VERSION=$petsc_version" >> $GITHUB_ENV + + - name: Cache PETSc Installation + id: cache-petsc + uses: actions/cache@v4 + with: + path: ${{ env.PETSC_CACHE_FOLDER }} + key: ubuntu-${{ env.UBUNTU_VERSION }}-petsc-${{ env.PETSC_VERSION }}-${{ matrix.compiler.cc }}-${{ env.ARCHITECTURE }} + restore-keys: ubuntu-${{ env.UBUNTU_VERSION }}-petsc-${{ env.PETSC_VERSION }}-${{ matrix.compiler.cc }}-${{ env.ARCHITECTURE }} + + - name: Install PETSc + if: steps.cache-petsc.outputs.cache-hit != 'true' + run: | + set -euo pipefail + install_dir=${{ env.PETSC_CACHE_FOLDER }} + version=${{ env.PETSC_VERSION }} + mkdir -p ${install_dir} + wget https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-${version}.tar.gz + tar -xvf petsc-${version}.tar.gz + cd petsc-${version} + ./configure --with-fortran-bindings=0 --with-debugging=0 \ + --with-memalign=32 --with-64-bit-indices \ + --with-cc=${{ matrix.compiler.cc }} --with-cxx=${{ matrix.compiler.cxx }} --with-fc=0 --prefix=${install_dir} \ + --COPTFLAGS="-g -O3" --CXXOPTFLAGS="-g -O3" --with-mpi-dir=/usr/lib/x86_64-linux-gnu/openmpi + make PETSC_DIR=`pwd` PETSC_ARCH=${{ env.ARCHITECTURE }} -j$(nproc) + make PETSC_DIR=`pwd` PETSC_ARCH=${{ env.ARCHITECTURE }} install + cd .. + + - name: Build and Test Tandem + run: | + set -euo pipefail + mkdir build && cd build + cmake .. \ + -DCMAKE_PREFIX_PATH=${{ env.PETSC_CACHE_FOLDER }} \ + -DDOMAIN_DIMENSION=3 \ + -DPOLYNOMIAL_DEGREE=2 \ + -DCMAKE_C_COMPILER=${{ matrix.compiler.cc }} \ + -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} + + make -j$(nproc) + make test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4a2f5a55..00000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -notifications: - email: - on_success: always - on_failure: always - -language: cpp -compiler: gcc -dist: focal -env: - - "OMPI_CC=gcc-9 OMPI_CXX=g++-9 CC=mpicc CXX=mpiCC" - -before_install: - - sudo apt-get update - - sudo apt-get -y install gcc-9 g++-9 cmake openmpi-bin openmpi-common libopenmpi-dev libmetis-dev libparmetis-dev libeigen3-dev python3 python3-numpy libopenblas-base libopenblas-dev liblua5.3-0 liblua5.3-dev - -install: - - wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.3.tar.gz - - tar -xvf petsc-lite-3.13.3.tar.gz - - cd petsc-3.13.3 - - ./configure --with-debugging=0 CC=mpicc CXX=mpicxx --prefix=/usr/local/ - - make PETSC_DIR=`pwd` PETSC_ARCH=arch-linux-c-opt -j4 - - sudo make PETSC_DIR=`pwd` PETSC_ARCH=arch-linux-c-opt install - - cd .. - -script: - - mkdir build && cd build - - cmake .. - - make -j2 - - make test -