Update dependencies #1477
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: Build and Test (Linux, Arm64) | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-test-linux-arm64: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: # Only a single simple build test for now | |
- compiler: gcc | |
mpi: mpich | |
math-libs: openblas | |
build-shared: shared | |
with-64bit-int: int32 | |
with-openmp: serial | |
with-solver: superlu | |
with-eigensolver: arpack | |
runs-on: palace_ubuntu-latest_16-core | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Install and configure gfortran-14 | |
if: ${{ matrix.with-solver == 'strumpack' }} | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
sudo apt-get update | |
sudo apt-get install -y gfortran-14 | |
sudo update-alternatives --install $(which gfortran) gfortran $(which gfortran-14) 140 | |
sudo update-alternatives --set gfortran $(which gfortran-14) | |
- name: Install and configure GCC 14 | |
if: ${{ matrix.compiler == 'gcc' }} | |
run: | | |
sudo apt-get install -y gcc-14 g++-14 | |
sudo update-alternatives --install $(which gcc) gcc $(which gcc-14) 140 \ | |
--slave $(which g++) g++ $(which g++-14) \ | |
--slave $(which gcov) gcov $(which gcov-14) \ | |
--slave $(which gcc-ar) gcc-ar $(which gcc-ar-14) \ | |
--slave $(which gcc-ranlib) gcc-ranlib $(which gcc-ranlib-14) \ | |
--slave $(which gcc-nm) gcc-nm $(which gcc-nm-14) | |
sudo update-alternatives --set gcc $(which gcc-14) | |
- name: Verify gcc compiler versions | |
if: ${{ matrix.compiler == 'gcc' || matrix.with-solver == 'strumpack' }} | |
run: | | |
${{ matrix.with-solver == 'strumpack' && 'gfortran --version' || '' }} | |
${{ matrix.compiler == 'gcc' && 'gcc --version' || '' }} | |
${{ matrix.compiler == 'gcc' && 'g++ --version' || '' }} | |
- name: Hardware setup, build, and test | |
uses: uraimo/run-on-arch-action@v2 | |
id: runcmd | |
with: | |
arch: aarch64 | |
distro: ubuntu_latest | |
githubToken: ${{ github.token }} | |
env: | | |
CMAKE_BUILD_TYPE: Debug # Speed up builds for run-on-arch | |
NUM_PROC_BUILD_MAX: '32' | |
NUM_PROC_TEST_MAX: '8' | |
install: | | |
# Install dependencies | |
apt-get update -q | |
apt-get install -y build-essential clang cmake curl gfortran git lld \ | |
pkg-config python3 wget | |
# Install MPI | |
if [[ "${{ matrix.mpi }}" == 'openmpi' ]]; then | |
apt-get install -y openmpi-bin libopenmpi-dev | |
elif [[ "${{ matrix.mpi }}" == 'mpich' ]]; then | |
apt-get install -y mpich libmpich-dev | |
fi | |
# Install math libraries (OpenBLAS) | |
if [[ "${{ matrix.math-libs }}" == 'openblas' ]]; then | |
if [[ "${{ matrix.with-openmp }}" == 'openmp' ]]; then | |
apt-get install -y libopenblas-openmp-dev | |
else | |
apt-get install -y libopenblas-serial-dev | |
fi | |
fi | |
# Install math libraries (Arm Performance Libraries) | |
if [[ "${{ matrix.math-libs }}" == 'armpl' ]]; then | |
wget https://developer.arm.com/-/cdn-downloads/permalink/Arm-Performance-Libraries/Version_24.10/arm-performance-libraries_24.10_rpm_gcc.tar | |
tar -xf arm-performance-libraries* && rm -rf arm-performance-libraries*.tar | |
./arm-performance-libraries*/arm-performance-libraries*.sh -a -i /opt/arm | |
fi | |
run: | | |
# Configure environment | |
export FC=gfortran | |
if [[ "${{ matrix.compiler }}" == 'clang' ]]; then | |
export CC=clang | |
export CXX=clang++ | |
export LDFLAGS='-fuse-ld=lld' | |
elif [[ "${{ matrix.compiler }}" == 'gcc' ]]; then | |
export CC=gcc | |
export CXX=g++ | |
fi | |
if [[ "${{ matrix.math-libs }}" == 'armpl' ]]; then | |
export ARMPL_DIR=/opt/arm/armpl_24.10_gcc | |
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+LD_LIBRARY_PATH:}$ARMPL_DIR/lib" | |
fi | |
export NUM_PROC_BUILD=$(nproc 2> /dev/null || sysctl -n hw.ncpu) | |
if [[ "$NUM_PROC_BUILD" -gt "$NUM_PROC_BUILD_MAX" ]]; then | |
NUM_PROC_BUILD=$NUM_PROC_BUILD_MAX | |
fi | |
[[ "${{ matrix.build-shared }}" == 'shared' ]] && BUILD_SHARED='ON' || BUILD_SHARED='OFF' | |
[[ "${{ matrix.with-64bit-int }}" == 'int64' ]] && WITH_INT64='ON' || WITH_INT64='OFF' | |
[[ "${{ matrix.with-openmp }}" == 'openmp' ]] && WITH_OPENMP='ON' || WITH_OPENMP='OFF' | |
[[ "${{ matrix.with-solver }}" == 'superlu' ]] && WITH_SUPERLU='ON' || WITH_SUPERLU='OFF' | |
[[ "${{ matrix.with-solver }}" == 'strumpack' ]] && WITH_STRUMPACK='ON' || WITH_STRUMPACK='OFF' | |
[[ "${{ matrix.with-solver }}" == 'mumps' ]] && WITH_MUMPS='ON' || WITH_MUMPS='OFF' | |
[[ "${{ matrix.with-eigensolver }}" == 'slepc' ]] && WITH_SLEPC='ON' || WITH_SLEPC='OFF' | |
[[ "${{ matrix.with-eigensolver }}" == 'arpack' ]] && WITH_ARPACK='ON' || WITH_ARPACK='OFF' | |
# Build and install | |
mkdir palace-build && cd palace-build | |
cmake .. \ | |
-DCMAKE_INSTALL_PREFIX=/opt/palace \ | |
-DBUILD_SHARED_LIBS=$BUILD_SHARED \ | |
-DPALACE_WITH_64BIT_INT=$WITH_INT64 \ | |
-DPALACE_WITH_OPENMP=$WITH_OPENMP \ | |
-DPALACE_WITH_SUPERLU=$WITH_SUPERLU \ | |
-DPALACE_WITH_STRUMPACK=$WITH_STRUMPACK \ | |
-DPALACE_WITH_MUMPS=$WITH_MUMPS \ | |
-DPALACE_WITH_SLEPC=$WITH_SLEPC \ | |
-DPALACE_WITH_ARPACK=$WITH_ARPACK | |
make -j$NUM_PROC_BUILD | |
# XX TODO: Disable tests for now since Julia precompilation fails | |
# # Install Julia | |
# curl -fsSL https://install.julialang.org | sh -s -- -y | |
# export PATH=~/.juliaup/bin:$PATH |