Skip to content

Commit

Permalink
Image for aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Dec 11, 2024
1 parent feedf76 commit a7b10d2
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 6 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ jobs:
if: ${{ !contains(github.event.head_commit.message, '[skip.all]') }}
runs-on: self-hosted
timeout-minutes: 60
strategy:
matrix:
arch: [ amd64, arm64 ]
steps:
- name: Clone
uses: actions/checkout@v4
Expand All @@ -21,13 +24,17 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: QEMU
if: ${{ matrix.arch == 'arm64' }}
uses: docker/setup-qemu-action@v3
- name: Buildx
uses: docker/setup-buildx-action@v3
- name: Build
- name: Build ${{ matrix.arch }}
uses: docker/build-push-action@v6
with:
context: .
file: ./Script/Rocky.Dockerfile
file: ./Script/Rocky.${{ matrix.arch }}.Dockerfile
platforms: linux/${{ matrix.arch }}
push: true
tags: |
tlcfem/suanpan:latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./Script/Rocky.Dockerfile
file: ./Script/Rocky.amd64.Dockerfile
push: true
tags: |
tlcfem/suanpan:stable
6 changes: 3 additions & 3 deletions Option.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ if (USE_HDF5)
endif ()
else ()
if (USE_SYS_LIB)
find_package(HDF5 REQUIRED)
find_package(HDF5 REQUIRED COMPONENTS C HL)
include_directories(${HDF5_INCLUDE_DIRS})
link_libraries(${HDF5_LIBRARIES})
link_libraries(${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
else ()
include_directories(Include/hdf5)
include_directories(Include/hdf5-${SP_EXTERNAL_LIB_PATH})
Expand Down Expand Up @@ -261,7 +261,7 @@ if (BUILD_MULTITHREAD)
if (USE_SYS_LIB)
find_package(TBB REQUIRED)
include_directories(${TBB_INCLUDE_DIRS})
link_libraries(${TBB_LIBRARIES})
link_libraries(TBB::tbb TBB::tbbmalloc TBB::tbbmalloc_proxy)
else ()
if (COMPILER_IDENTIFIER MATCHES "gcc-win")
link_libraries(tbb12)
Expand Down
File renamed without changes.
32 changes: 32 additions & 0 deletions Script/Rocky.arm64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM arm64v8/rockylinux:9 AS build

RUN dnf install -y epel-release && crb enable
RUN dnf install -y gcc g++ gfortran cmake wget git hdf5-devel

# part 1: openblas
RUN git clone --depth 1 --branch v0.3.28 https://github.com/OpenMathLib/OpenBLAS.git

# change the following configurations to match your needs
RUN cd OpenBLAS && make TARGET=ARMV8 DYNAMIC_ARCH=1 BINARY=64 USE_THREAD=1 USE_OPENMP=1 NUM_THREADS=20 NO_SHARED=1 NO_CBLAS=1 NO_LAPACKE=1 GEMM_MULTITHREAD_THRESHOLD=64

# part 2: tbb
RUN git clone --depth 1 --branch v2021.12.0 https://github.com/oneapi-src/oneTBB.git
RUN mkdir tbb-build && cd tbb-build && cmake -DCMAKE_BUILD_TYPE=Release -DTBB_TEST=OFF ../oneTBB && cmake --build . --target install --config Release --parallel "$(nproc)"

# part 3: suanpan
RUN git clone --depth 1 --branch dev https://github.com/TLCFEM/suanPan.git

RUN cd suanPan && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DUSE_SYS_LIB=ON -DCUSTOM_OPENBLAS=/OpenBLAS -DBUILD_MULTITHREAD=ON -DUSE_HDF5=ON -DUSE_VTK=OFF -DUSE_AVX2=OFF .. && make -j"$(nproc)"

FROM arm64v8/rockylinux:9 AS runtime

RUN dnf install -y epel-release && crb enable
RUN dnf install -y libgomp hdf5

COPY --from=build /tbb-build /tbb-build

RUN cd /tbb-build && make install && cd .. && rm -rf tbb-build

COPY --from=build /suanPan/build/suanPan /usr/local/bin/suanPan

RUN suanPan -v

0 comments on commit a7b10d2

Please sign in to comment.