From 478ab3246665ed4e11467a6376d91f3182cf904c Mon Sep 17 00:00:00 2001 From: Mikhail Katliar Date: Thu, 19 Sep 2024 14:43:02 +0200 Subject: [PATCH] GitHub build workflow for ARM --- .../{cmake.yml => build-and-test-x64.yml} | 0 .github/workflows/build-arm64.yml | 37 ++++++++++++++++ docker/arm64.dockerfile | 44 +++++++++++++++++++ 3 files changed, 81 insertions(+) rename .github/workflows/{cmake.yml => build-and-test-x64.yml} (100%) create mode 100644 .github/workflows/build-arm64.yml create mode 100644 docker/arm64.dockerfile diff --git a/.github/workflows/cmake.yml b/.github/workflows/build-and-test-x64.yml similarity index 100% rename from .github/workflows/cmake.yml rename to .github/workflows/build-and-test-x64.yml diff --git a/.github/workflows/build-arm64.yml b/.github/workflows/build-arm64.yml new file mode 100644 index 00000000..67085489 --- /dev/null +++ b/.github/workflows/build-arm64.yml @@ -0,0 +1,37 @@ +name: CI with ARM build + +on: + push: + branches: + - master + pull_request: + branches: + - master + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Debug + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up QEMU for ARM + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build Docker image for ARM + run: | + docker buildx create --use + docker buildx build --platform linux/arm64 -t my-arm-build --load -f docker/arm64.dockerfile . + + # - name: Run tests on ARM Docker container + # run: | + # docker run --rm my-arm-build ./run-tests.sh diff --git a/docker/arm64.dockerfile b/docker/arm64.dockerfile new file mode 100644 index 00000000..fa91c690 --- /dev/null +++ b/docker/arm64.dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:latest +WORKDIR /root +RUN apt-get update +RUN apt-get upgrade -y +RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y \ + build-essential clang-18 cmake git libopenblas-dev libboost-exception-dev pkg-config + +# Install GTest +RUN git clone https://github.com/google/googletest.git +RUN cd googletest && cmake -DCMAKE_BUILD_TYPE=Release . && make -j `nproc` install + +# Install Google benchmark +RUN git clone https://github.com/google/benchmark.git +RUN cd benchmark && cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_GTEST_TESTS=False . && make -j `nproc` install + +# Install Blaze +RUN git clone https://bitbucket.org/blaze-lib/blaze.git +RUN cd blaze && cmake -DBLAZE_BLAS_MODE=True -DBLAZE_BLAS_USE_MATRIX_MATRIX_MULTIPLICATION=False \ + -DBLAZE_BLAS_USE_MATRIX_VECTOR_MULTIPLICATION=False -DBLAZE_VECTORIZATION=False -DBLAZE_SHARED_MEMORY_PARALLELIZATION=False . && make install + +# Install Eigen3 +RUN apt install libeigen3-dev + +# Install blasfeo +RUN apt-get install -y bc +RUN git clone https://github.com/giaf/blasfeo.git +RUN cd blasfeo && git checkout cc90e146ee9089de518f57dbb736e064bd82394e +COPY docker/blasfeo/Makefile.rule blasfeo +RUN cd blasfeo && make -j `nproc` static_library && make install_static + +# Install libxsmm +RUN apt install libxsmm-dev + +# Build blast +COPY bench blast/bench +COPY cmake blast/cmake +COPY include blast/include +COPY test blast/test +COPY CMakeLists.txt blast +COPY Makefile blast/Makefile +ENV PKG_CONFIG_PATH=/usr/local/lib +RUN mkdir -p blast/build && cd blast/build \ + && cmake CMAKE_CXX_FLAGS "-march=native -DXSIMD_DEFAULT_ARCH='neon64'" .. \ + && make -j `nproc` VERBOSE=1