From a8e9d9d374fc4c0ec5491a7da547646a3f131f09 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Thu, 12 Oct 2023 04:42:35 +0200 Subject: [PATCH] More --- .../workflows/{dev-ubuntu.yml => dev-all.yml} | 103 +++++++++++++++- .github/workflows/dev-mkl-vtk.yml | 77 ------------ .github/workflows/dev-vtk.yml | 111 ------------------ .github/workflows/dev.yml | 45 ------- 4 files changed, 100 insertions(+), 236 deletions(-) rename .github/workflows/{dev-ubuntu.yml => dev-all.yml} (55%) delete mode 100644 .github/workflows/dev-mkl-vtk.yml delete mode 100644 .github/workflows/dev-vtk.yml delete mode 100644 .github/workflows/dev.yml diff --git a/.github/workflows/dev-ubuntu.yml b/.github/workflows/dev-all.yml similarity index 55% rename from .github/workflows/dev-ubuntu.yml rename to .github/workflows/dev-all.yml index 98c2febd7..358fdf1ad 100644 --- a/.github/workflows/dev-ubuntu.yml +++ b/.github/workflows/dev-all.yml @@ -14,7 +14,7 @@ jobs: compiler: [ { c: gcc, cpp: g++, fortran: gfortran }, { c: icx, cpp: icpx, fortran: ifx } ] avx: [ ON, OFF ] vtk: [ ON, OFF ] - mkl: [ ON ] + mkl: [ ON, OFF ] steps: - name: Clone uses: actions/checkout@v4 @@ -84,8 +84,6 @@ jobs: fi if [ "${{ matrix.vtk }}" == "ON" ]; then file_name+="-vtk" - else - file_name+="-no-vtk" fi if [ "${{ matrix.mkl }}" == "ON" ]; then file_name+="-mkl" @@ -116,3 +114,102 @@ jobs: uses: codecov/codecov-action@v3 with: gcov: true + macos-dev: + runs-on: macos-11 + timeout-minutes: 100 + strategy: + matrix: + build: [ Debug ] + compiler: [ GCC, CLANG ] + vtk: [ ON, OFF ] + steps: + - name: Clone + uses: actions/checkout@v4 + - name: Golang + uses: actions/setup-go@v4 + - name: VTK + run: | + if [ "${{ matrix.vtk }}" == "ON" ]; then + wget -q https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.6-macos.tar.gz + tar xf VTK-9.2.6-macos.tar.gz + brew install glfw glew + fi + - name: Compile + run: | + go build Checker/updater.go + mkdir build && cd build + if [ "${{ matrix.compiler }}" == "CLANG" ]; then + export CC=$(brew --prefix llvm@15)/bin/clang + export CXX=$(brew --prefix llvm@15)/bin/clang++ + export FC=gfortran-11 + cmake -DCMAKE_C_STANDARD_INCLUDE_DIRECTORIES=$(brew --prefix libomp)/include -DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=$(brew --prefix libomp)/include -DCMAKE_Fortran_STANDARD_INCLUDE_DIRECTORIES=$(brew --prefix libomp)/include -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DUSE_EXTERNAL_VTK=${{ matrix.vtk }} -DVTK_DIR=/Users/runner/work/suanPan/suanPan/lib/cmake/vtk-9.2/ -DCMAKE_INSTALL_PREFIX=suanPan-macos .. + else + export CC=gcc-11 + export CXX=g++-11 + export FC=gfortran-11 + cmake -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DUSE_EXTERNAL_VTK=${{ matrix.vtk }} -DVTK_DIR=/Users/runner/work/suanPan/suanPan/lib/cmake/vtk-9.2/ -DCMAKE_INSTALL_PREFIX=suanPan-macos .. + fi + make install -j4 + - name: Test + run: | + export DYLD_LIBRARY_PATH=/Users/runner/work/suanPan/suanPan/suanPan-macos/lib/ + ./suanPan-macos/bin/suanPan -v + windows-dev: + runs-on: windows-2022 + timeout-minutes: 100 + strategy: + matrix: + build: [ Release, Debug ] + compiler: [ VS, GCC ] + vtk: [ ON, OFF ] + avx: [ ON, OFF ] + steps: + - name: Clone + uses: actions/checkout@v4 + - name: Golang + uses: actions/setup-go@v4 + - name: Install VTK + run: | + C:/msys64/usr/bin/wget.exe -q https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.6-win.7z + 7z x VTK-9.2.6-win.7z + - name: Compile + run: | + go build Checker/updater.go + mkdir build && cd build + if ( ${{ matrix.compiler}} -eq "VS") { + $generator = "Visual Studio 17 2022" + } else { + $generator = "MinGW Makefiles" + } + cmake -G "$generator" -DCMAKE_BUILD_TYPE=${{ matrix.build}} -DUSE_AVX=${{ matrix.avx }} -DBUILD_MULTITHREAD=ON -DUSE_EXTERNAL_VTK=${{ matrix.vtk }} -DVTK_DIR=D:/a/suanPan/suanPan/lib/cmake/vtk-9.2/ -DCMAKE_INSTALL_PREFIX=suanPan-win .. + cmake --build . --target INSTALL -j 4 + - name: Pack + shell: bash + run: | + cp updater.exe build/suanPan-win/bin + cd build/suanPan-win/bin + file_name="suanPan-win" + if [ "${{ matrix.build }}" == "Debug" ]; then + file_name+="-debug" + else + file_name+="-release" + fi + file_name+="-openblas" + if [ "${{ matrix.avx }}" == "ON" ]; then + file_name+="-avx" + else + file_name+="-no-avx" + fi + if [ "${{ matrix.vtk }}" == "ON" ]; then + file_name+="-vtk" + fi + file_name+=".7z" + echo "ARTIFACT=$file_name" >> "$GITHUB_ENV" + 7z a ../../../$file_name ./* + ./suanPan.exe -v + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: ${{ env.ARTIFACT }} + path: ${{ env.ARTIFACT }} + diff --git a/.github/workflows/dev-mkl-vtk.yml b/.github/workflows/dev-mkl-vtk.yml deleted file mode 100644 index 57023d3ea..000000000 --- a/.github/workflows/dev-mkl-vtk.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Dev With MKL VTK -on: - push: - branches: [ dev ] - pull_request: - branches: [ dev ] -jobs: - ubuntu-mkl-vtk-dev: - runs-on: ubuntu-22.04 - timeout-minutes: 60 - steps: - - name: Clone - uses: actions/checkout@v3 - - name: Install VTK - run: | - wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null - echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - wget -q https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.6-linux.tar.gz - tar xf VTK-9.2.6-linux.tar.gz - - name: Golang - uses: actions/setup-go@v3 - - name: Compile - run: | - go build Checker/updater.go - sudo apt-get update && sudo apt-get install mesa-common-dev mesa-utils freeglut3-dev libglvnd-dev dpkg-dev xz-utils intel-oneapi-mkl-devel intel-oneapi-compiler-dpcpp-cpp intel-oneapi-compiler-fortran - source /opt/intel/oneapi/setvars.sh - cmake -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DCMAKE_Fortran_COMPILER=ifx -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_MULTITHREAD=ON -DUSE_HDF5=ON -DUSE_EXTERNAL_VTK=ON -DVTK_DIR=./lib/cmake/vtk-9.2/ -DUSE_MKL=ON -DMKLROOT=/opt/intel/oneapi/mkl/latest/ -DLINK_DYNAMIC_MKL=OFF -DCMAKE_INSTALL_PREFIX=suanPan-linux-mkl-vtk . - make install -j"$(nproc)" - make package - - name: Test - run: | - export LD_LIBRARY_PATH=/home/runner/work/suanPan/suanPan/suanPan-linux-mkl-vtk/lib - ./suanPan-linux-mkl-vtk/bin/suanPan -v - - uses: actions/upload-artifact@v3 - with: - name: suanPan-3.2.0-1.x86_64.deb - path: suanPan-3.2.0-1.x86_64.deb - fedora-mkl-vtk-dev: - runs-on: ubuntu-22.04 - timeout-minutes: 60 - container: fedora:36 - steps: - - name: Setup - run: | - tee > oneAPI.repo << EOF - [oneAPI] - name=Intel oneAPI repository - baseurl=https://yum.repos.intel.com/oneapi - enabled=1 - gpgcheck=1 - repo_gpgcheck=1 - gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - EOF - mv oneAPI.repo /etc/yum.repos.d/ - dnf upgrade --refresh -y - dnf install libglvnd-devel gcc g++ gfortran rpm-build rpm-devel rpmdevtools cmake wget intel-oneapi-mkl-devel intel-oneapi-compiler-dpcpp-cpp intel-oneapi-compiler-fortran git procps -y - git config --global --add safe.directory /__w/suanPan/suanPan - - name: Clone - uses: actions/checkout@v3 - - name: Install MKL VTK - run: | - wget -q https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.6-linux.tar.gz - tar xf VTK-9.2.6-linux.tar.gz - - name: Compile - run: | - source /opt/intel/oneapi/setvars.sh - cmake -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DCMAKE_Fortran_COMPILER=ifx -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_MULTITHREAD=ON -DUSE_HDF5=ON -DUSE_EXTERNAL_VTK=ON -DVTK_DIR=./lib/cmake/vtk-9.2/ -DUSE_MKL=ON -DMKLROOT=/opt/intel/oneapi/mkl/latest/ -DLINK_DYNAMIC_MKL=OFF . - make package -j"$(nproc)" - - name: Test - run: | - dnf install ./suanPan-3.2.0-1.x86_64.rpm -y - suanPan -v - - name: Upload - uses: actions/upload-artifact@v3 - with: - name: suanPan-3.2.0-1.x86_64.rpm - path: suanPan-3.2.0-1.x86_64.rpm diff --git a/.github/workflows/dev-vtk.yml b/.github/workflows/dev-vtk.yml deleted file mode 100644 index 8625265bc..000000000 --- a/.github/workflows/dev-vtk.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: Dev With VTK -on: - push: - branches: [ dev ] - pull_request: - branches: [ dev ] -jobs: - ubuntu-openblas-vtk-dev: - runs-on: ubuntu-22.04 - timeout-minutes: 60 - steps: - - name: Clone - uses: actions/checkout@v3 - - name: Install VTK - run: | - wget -q https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.6-linux.tar.gz - tar xf VTK-9.2.6-linux.tar.gz - - name: Golang - uses: actions/setup-go@v3 - - name: Compile - run: | - go build Checker/updater.go - sudo apt-get update && sudo apt-get install mesa-common-dev mesa-utils freeglut3-dev libglvnd-dev dpkg-dev xz-utils - cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_MULTITHREAD=ON -DUSE_HDF5=ON -DUSE_EXTERNAL_VTK=ON -DVTK_DIR=./lib/cmake/vtk-9.2/ -DCMAKE_INSTALL_PREFIX=suanPan-linux-openblas-vtk . - make install -j"$(nproc)" - make package - - name: Test - run: | - export LD_LIBRARY_PATH=/home/runner/work/suanPan/suanPan/suanPan-linux-openblas-vtk/lib - ./suanPan-linux-openblas-vtk/bin/suanPan -v - - uses: actions/upload-artifact@v3 - with: - name: suanPan-3.2.0-1.x86_64.deb - path: suanPan-3.2.0-1.x86_64.deb - macos-openblas-vtk-dev: - runs-on: macos-11 - timeout-minutes: 100 - steps: - - name: Clone - uses: actions/checkout@v3 - - name: Install VTK - run: | - wget -q https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.6-macos.tar.gz - tar xf VTK-9.2.6-macos.tar.gz - - name: Golang - uses: actions/setup-go@v3 - - name: Compile - run: | - export CC=$(brew --prefix llvm@15)/bin/clang && export CXX=$(brew --prefix llvm@15)/bin/clang++ && export FC=gfortran-11 - go build Checker/updater.go - brew install glfw glew - cmake -DCMAKE_C_STANDARD_INCLUDE_DIRECTORIES=$(brew --prefix libomp)/include -DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=$(brew --prefix libomp)/include -DCMAKE_Fortran_STANDARD_INCLUDE_DIRECTORIES=$(brew --prefix libomp)/include -DCMAKE_BUILD_TYPE=Debug -DBUILD_MULTITHREAD=ON -DUSE_HDF5=ON -DUSE_EXTERNAL_VTK=ON -DVTK_DIR=./lib/cmake/vtk-9.2/ -DCMAKE_INSTALL_PREFIX=suanPan-macos-openblas-vtk . - make install -j4 - - name: Test - run: | - export DYLD_LIBRARY_PATH=/Users/runner/work/suanPan/suanPan/suanPan-macos-openblas-vtk/lib/ - ./suanPan-macos-openblas-vtk/bin/suanPan -v - windows-openblas-vtk-dev: - runs-on: windows-2022 - timeout-minutes: 100 - steps: - - name: Clone - uses: actions/checkout@v3 - - name: Install VTK - run: | - C:/msys64/usr/bin/wget.exe -q https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.6-win.7z - 7z x VTK-9.2.6-win.7z - - name: Golang - uses: actions/setup-go@v3 - - name: Compile - run: | - go build Checker/updater.go - cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_MULTITHREAD=ON -DUSE_HDF5=ON -DUSE_EXTERNAL_VTK=ON -DVTK_DIR=D:/a/suanPan/suanPan/lib/cmake/vtk-9.2/ -DCMAKE_INSTALL_PREFIX=suanPan-win-openblas-vtk . - cmake --build . --target INSTALL --config Release -j 4 - - name: Pack - run: | - cp updater.exe suanPan-win-openblas-vtk/bin - cd suanPan-win-openblas-vtk/bin - 7z a ../../suanPan-win-openblas-vtk.7z ./* - ./suanPan.exe -v - - uses: actions/upload-artifact@v3 - with: - name: suanPan-win-openblas-vtk.7z - path: suanPan-win-openblas-vtk.7z - windows-openblas-vtk-no-avx-dev: - runs-on: windows-2022 - timeout-minutes: 100 - steps: - - name: Clone - uses: actions/checkout@v3 - - name: Install VTK - run: | - C:/msys64/usr/bin/wget.exe -q https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.6-win.7z - 7z x VTK-9.2.6-win.7z - - name: Golang - uses: actions/setup-go@v3 - - name: Compile - run: | - go build Checker/updater.go - cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_MULTITHREAD=ON -DUSE_AVX=OFF -DUSE_HDF5=ON -DUSE_EXTERNAL_VTK=ON -DVTK_DIR=D:/a/suanPan/suanPan/lib/cmake/vtk-9.2/ -DCMAKE_INSTALL_PREFIX=suanPan-win-openblas-vtk-no-avx . - cmake --build . --target INSTALL --config Release -j 4 - - name: Pack - run: | - cp updater.exe suanPan-win-openblas-vtk-no-avx/bin - cd suanPan-win-openblas-vtk-no-avx/bin - 7z a ../../suanPan-win-openblas-vtk-no-avx.7z ./* - ./suanPan.exe -v - - uses: actions/upload-artifact@v3 - with: - name: suanPan-win-openblas-vtk-no-avx.7z - path: suanPan-win-openblas-vtk-no-avx.7z diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml deleted file mode 100644 index b475247f1..000000000 --- a/.github/workflows/dev.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dev -on: - push: - branches: [ dev ] - pull_request: - branches: [ dev ] -jobs: - ubuntu-dev: - runs-on: ubuntu-22.04 - timeout-minutes: 60 - steps: - - name: Clone - uses: actions/checkout@v3 - - name: Golang - uses: actions/setup-go@v3 - - name: Compile - run: | - go build Checker/updater.go - mkdir cmake-build-debug && cd cmake-build-debug - cmake -DCMAKE_BUILD_TYPE=Debug -DTEST_COVERAGE=ON -DUSE_HDF5=ON ../ - make -j"$(nproc)" - chmod +x ../Script/Coverage.sh - ../Script/Coverage.sh . - for SRC in `find . | egrep '\.o'`; do gcov -n $SRC > /dev/null; done - cd .. - - name: Upload - uses: codecov/codecov-action@v3 - with: - gcov: true - macos-dev: - runs-on: macos-11 - timeout-minutes: 100 - steps: - - name: Clone - uses: actions/checkout@v3 - - name: Golang - uses: actions/setup-go@v3 - - name: Compile - run: | - export CC=gcc-11 && export CXX=g++-11 && export FC=gfortran-11 - go build Checker/updater.go - cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_HDF5=ON . - make -j4 - export DYLD_LIBRARY_PATH=Libs/mac/ - ./suanPan -v