From de040213e8ca8adbdcfc2de75d01ad6ac794aabf Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Sat, 19 Aug 2023 14:51:19 -0700 Subject: [PATCH] CI: Linux aarch64/arm64 Add native Linux aarch64/arm64 runners with CircleCI. --- .circleci/config.yml | 52 +++++++++++++ .../gcc_py_ompi_h5_ad2_arm64/spack.yaml | 77 +++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 .circleci/config.yml create mode 100644 .github/ci/spack-envs/gcc_py_ompi_h5_ad2_arm64/spack.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..b561a4e78e --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,52 @@ +version: 2 + +jobs: + linux-aarch64: + working_directory: ~/linux-aarch64-wheels + machine: + image: ubuntu-2004:2022.04.1 + # resource_class is what tells CircleCI to use an ARM worker for native arm builds + # https://circleci.com/product/features/resource-classes/ + resource_class: arm.large + steps: + - checkout + - run: + name: Install build dependencies + command: | + sudo apt update + sudo apt install cmake g++ gfortran libfabric-dev libopenmpi-dev libhdf5-openmpi-dev hdf5-tools pkgconf python3 python3-setuptools + sudo .github/workflows/dependencies/install_spack + python3 -m pip install -U pip + python3 -m pip install -U packaging setuptools wheel + python3 -m pip install -U numpy + python3 -m pip install -U mpi4py + python3 -m pip install -U pandas + python3 -m pip install -U dask + python3 -m pip install -U pyarrow + + eval $(spack env activate --sh .github/ci/spack-envs/gcc_py_ompi_h5_ad2_arm64/) + spack install + + share/openPMD/download_samples.sh build + - run: + name: Build openPMD-api + command: | + eval $(spack env activate --sh .github/ci/spack-envs/gcc_py_ompi_h5_ad2_arm64/) + cmake -S . -B build \ + -DopenPMD_USE_PYTHON=ON \ + -DopenPMD_USE_MPI=ON \ + -DopenPMD_USE_HDF5=ON \ + -DopenPMD_USE_ADIOS2=ON \ + -DopenPMD_USE_INVASIVE_TESTS=ON + cmake --build build --parallel 2 + # FIXME: not clear why this reports "no tests were found!!!" + - run: + name: Test openPMD-api + command: | + ctest --test-dir build --output-on-failure + +workflows: + version: 4 + all-tests: + jobs: + - linux-aarch64 diff --git a/.github/ci/spack-envs/gcc_py_ompi_h5_ad2_arm64/spack.yaml b/.github/ci/spack-envs/gcc_py_ompi_h5_ad2_arm64/spack.yaml new file mode 100644 index 0000000000..b42886c2d8 --- /dev/null +++ b/.github/ci/spack-envs/gcc_py_ompi_h5_ad2_arm64/spack.yaml @@ -0,0 +1,77 @@ +# This is a Spack environment file. +# +# Activating and installing this environment will provide all dependencies +# that are needed for full-feature development. +# https//spack.readthedocs.io/en/latest/environments.html#anonymous-environments +# +spack: + specs: + - adios2 + - hdf5 + - openmpi + + packages: + adios2: + variants: ~zfp ~sz ~png ~dataman ~python ~fortran ~ssc ~shared ~bzip2 + cmake: + externals: + - spec: cmake@3.23.0 + prefix: /usr + buildable: False + libfabric: + externals: + - spec: libfabric@1.6.2 + prefix: /usr + buildable: False + openmpi: + externals: + - spec: openmpi@2.1.1 + prefix: /usr + buildable: False + perl: + externals: + - spec: perl@5.26.1 + prefix: /usr + buildable: False + pkgconf: + externals: + - spec: pkgconf@1.6.3 + prefix: /usr + buildable: False + python: + externals: + - spec: python@3.8.10 + prefix: /usr + buildable: False + hdf5: + externals: + - spec: hdf5@1.10.4 + prefix: /usr + buildable: False + all: + target: [aarch64] + variants: ~fortran + compiler: [gcc@9.4.0] + + compilers: + - compiler: + environment: {} + extra_rpaths: [] + flags: {} + modules: [] + operating_system: ubuntu20.04 + paths: + cc: /usr/bin/gcc + cxx: /usr/bin/g++ + f77: /usr/bin/gfortran + fc: /usr/bin/gfortran + spec: gcc@9.4.0 + target: aarch64 + + config: + build_jobs: 2 + + # https://cache.spack.io/tag/v0.20.1/?stack=aws-ahug-aarch64 + mirrors: + E4S: https://cache.e4s.io + AWS: https://binaries.spack.io/v0.20.1/aws-ahug-aarch64