From 0ce7b93f6075ee1b80516e2da2a0a2dca4fa7e0f Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Sat, 10 Feb 2024 07:42:48 +0100 Subject: [PATCH 1/3] Added linux workflow --- .github/workflows/linux.yml | 90 +++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 2 +- azure-pipelines.yml | 8 ++-- readthedocs.yml | 4 +- 4 files changed, 97 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..3d08f5a --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,90 @@ +name: Linux +on: + workflow_dispatch: + pull_request: + push: + branches: [master] +concurrency: + group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }} + cancel-in-progress: true +defaults: + run: + shell: bash -e -l {0} +jobs: + build: + runs-on: ubuntu-20.04 + name: ${{ matrix.sys.compiler }} ${{ matrix.sys.version }} - ${{ matrix.sys.blas }} + strategy: + fail-fast: false + matrix: + sys: + - {compiler: gcc, version: '8', blas: OpenBLAS} + - {compiler: gcc, version: '8', blas: mkl} + - {compiler: gcc, version: '9', blas: OpenBLAS} + - {compiler: gcc, version: '9', blas: mkl} + - {compiler: gcc, version: '10', blas: OpenBLAS} + - {compiler: gcc, version: '10', blas: mkl} + - {compiler: gcc, version: '11', blas: OpenBLAS} + - {compiler: gcc, version: '11', blas: mkl} + - {compiler: clang, version: '15', blas: OpenBLAS} + - {compiler: clang, version: '15', blas: mkl} + - {compiler: clang, version: '16', blas: OpenBLAS} + - {compiler: clang, version: '16', blas: mkl} + + steps: + + - name: Setup GCC + if: ${{ matrix.sys.compiler == 'gcc' }} + run: | + GCC_VERSION=${{ matrix.sys.version }} + sudo apt-get update + sudo apt-get --no-install-suggests --no-install-recommends install g++-$GCC_VERSION + CC=gcc-$GCC_VERSION + echo "CC=$CC" >> $GITHUB_ENV + CXX=g++-$GCC_VERSION + echo "CXX=$CXX" >> $GITHUB_ENV + + - name: Setup clang + if: ${{ matrix.sys.compiler == 'clang' }} + run: | + LLVM_VERSION=${{ matrix.sys.version }} + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1 + sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$LLVM_VERSION main" || exit 1 + sudo apt-get update || exit 1 + sudo apt-get --no-install-suggests --no-install-recommends install clang-$LLVM_VERSION || exit 1 + sudo apt-get --no-install-suggests --no-install-recommends install g++-9 g++-9-multilib || exit 1 + sudo ln -s /usr/include/asm-generic /usr/include/asm + CC=clang-$LLVM_VERSION + echo "CC=$CC" >> $GITHUB_ENV + CXX=clang++-$LLVM_VERSION + echo "CXX=$CXX" >> $GITHUB_ENV + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set conda environment + uses: mamba-org/setup-micromamba@main + with: + environment-name: myenv + environment-file: environment-dev.yml + init-shell: bash + cache-downloads: true + + - name: Install mkl + if: ${{ matrix.sys.blas == 'mkl' }} + run: micromamba install mkl + + - name: Install OpenBLAS + if: ${{ matrix.sys.blas == 'OpenBLAS' }} + run: micromamba install openblas==0.3 blas-devel + + - name: Configure using CMake + run: cmake -Bbuild -DDOWNLOAD_GTEST=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib + + - name: Build + working-directory: build + run: cmake --build . --target test_xtensor_blas --parallel 8 + + - name: Run tests + working-directory: build/test + run: ./test_xtensor_blas diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f66350..e2889fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ # The full license is in the file LICENSE, distributed with this software. # ############################################################################ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) project(xtensor-blas) set(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 29081a9..b6bd8be 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,7 @@ trigger: - master jobs: -- template: ./.azure-pipelines/azure-pipelines-win.yml -- template: ./.azure-pipelines/azure-pipelines-linux-clang.yml -- template: ./.azure-pipelines/azure-pipelines-linux-gcc.yml -- template: ./.azure-pipelines/azure-pipelines-osx.yml + #- template: ./.azure-pipelines/azure-pipelines-win.yml + #- template: ./.azure-pipelines/azure-pipelines-linux-clang.yml + #- template: ./.azure-pipelines/azure-pipelines-linux-gcc.yml + #- template: ./.azure-pipelines/azure-pipelines-osx.yml diff --git a/readthedocs.yml b/readthedocs.yml index 38f414b..c9eaf4f 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -1,9 +1,9 @@ version: 2 build: - os: "ubuntu-22.04" + os: ubuntu-22.04 tools: - python: "mambaforge-22.9" + python: mambaforge-22.9 conda: environment: docs/environment.yml From d627cc21c51879d5c974c19ff119c49bcca5da35 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Mon, 12 Feb 2024 19:29:25 +0100 Subject: [PATCH 2/3] Added OSX workflow --- .github/workflows/osx.yml | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/osx.yml diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml new file mode 100644 index 0000000..7d99475 --- /dev/null +++ b/.github/workflows/osx.yml @@ -0,0 +1,49 @@ +name: OSX +on: + workflow_dispatch: + pull_request: + push: + branches: [master] +concurrency: + group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }} + cancel-in-progress: true +defaults: + run: + shell: bash -e -l {0} +jobs: + build: + runs-on: macos-${{ matrix.os }} + name: macos-${{ matrix.os }} - mkl + strategy: + fail-fast: false + matrix: + os: + - 11 + - 12 + + steps: + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set conda environment + uses: mamba-org/setup-micromamba@main + with: + environment-name: myenv + environment-file: environment-dev.yml + init-shell: bash + cache-downloads: true + + - name: Install mkl + run: micromamba install mkl + + - name: Configure using CMake + run: cmake -Bbuild -DDOWNLOAD_GTEST=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib + + - name: Build + working-directory: build + run: cmake --build . --target test_xtensor_blas --parallel 8 + + - name: Run tests + working-directory: build/test + run: ./test_xtensor_blas From cc0f63a25db4fdd28d39322bc1e05355964c7610 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Mon, 12 Feb 2024 19:41:10 +0100 Subject: [PATCH 3/3] Added Windows workflow --- .github/workflows/windows.yml | 62 +++++++++++++++++++++++++++++++++++ test/CMakeLists.txt | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..57ff188 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,62 @@ +name: Windows +on: + workflow_dispatch: + pull_request: + push: + branches: [master] +concurrency: + group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }} + cancel-in-progress: true +defaults: + run: + shell: bash -e -l {0} +jobs: + build: + runs-on: ${{ matrix.runs-on }} + name: ${{ matrix.sys.compiler }} + strategy: + fail-fast: false + matrix: + runs-on: [windows-latest] + sys: + - {compiler: default} + #- {compiler: clang} + + steps: + + - name: Setup MSVC + if: matrix.sys.compiler == 'default' + uses: ilammy/msvc-dev-cmd@v1 + + - name: Setup clang + if: matrix.sys.compiler == 'clang' + run: | + echo "CC=clang" >> $GITHUB_ENV + echo "CXX=clang++" >> $GITHUB_ENV + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set conda environment + uses: mamba-org/setup-micromamba@main + with: + environment-name: myenv + environment-file: environment-dev.yml + init-shell: bash + cache-downloads: true + create-args: | + ninja + + - name: Install mkl + run: micromamba install mkl-devel + + - name: Configure using CMake + run: cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DDOWNLOAD_GTEST=ON -G Ninja + + - name: Build + working-directory: build + run: cmake --build . --target test_xtensor_blas --parallel 8 + + - name: Run tests + working-directory: build/test + run: ./test_xtensor_blas diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3abc6c7..4817e13 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,7 +7,7 @@ # The full license is in the file LICENSE, distributed with this software. # ############################################################################ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) project(xtensor-blas-test)