diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5ace4600..78635962 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,5 @@ updates: directory: "/" schedule: interval: "weekly" + day: "saturday" + rebase-strategy: "disabled" diff --git a/.github/workflows/build-with-clang.yml b/.github/workflows/build-with-clang.yml new file mode 100644 index 00000000..4d455500 --- /dev/null +++ b/.github/workflows/build-with-clang.yml @@ -0,0 +1,77 @@ +name: Build project with IntelLLVM clang compiler + +on: + pull_request: + push: + branches: [master] + +permissions: read-all + +jobs: + build-with-clang: + runs-on: ubuntu-latest + + strategy: + matrix: + python: ["3.9", "3.10", "3.11", "3.12"] + numpy_version: ["numpy'<2'", "numpy'>=2'"] + + env: + ONEAPI_ROOT: /opt/intel/oneapi + + defaults: + run: + shell: bash -el {0} + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + + - name: Add Intel repository + run: | + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" + sudo apt-get update + + - name: Install Intel OneAPI + run: | + sudo apt-get install intel-oneapi-compiler-dpcpp-cpp + sudo apt-get install intel-oneapi-tbb + sudo apt-get install intel-oneapi-mkl-devel + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + architecture: x64 + + - name: Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install mkl_fft dependencies + run: | + pip install cython setuptools">=77" + pip install ${{ matrix.numpy_version }} + + - name: List oneAPI folder content + run: ls ${{ env.ONEAPI_ROOT }}/compiler + + - name: Build mkl_fft + run: | + source ${{ env.ONEAPI_ROOT }}/setvars.sh + echo $CMPLR_ROOT + export CC=$CMPLR_ROOT/bin/icx + export CFLAGS="${CFLAGS} -fno-fast-math -O2" + pip install -e . --no-build-isolation --no-deps --verbose + + - name: Run mkl_fft tests + run: | + source ${{ env.ONEAPI_ROOT }}/setvars.sh + pip install scipy mkl-service pytest + pytest -s -v --pyargs mkl_fft diff --git a/.github/workflows/conda-package-cf.yml b/.github/workflows/conda-package-cf.yml index f95bc95d..08084e06 100644 --- a/.github/workflows/conda-package-cf.yml +++ b/.github/workflows/conda-package-cf.yml @@ -22,6 +22,11 @@ jobs: matrix: python: ['3.9', '3.10', '3.11', '3.12'] steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -29,6 +34,7 @@ jobs: - name: Set pkgs_dirs run: | echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc + - name: Cache conda packages uses: actions/cache@v4 env: @@ -43,8 +49,10 @@ jobs: - name: Add conda to system path run: echo $CONDA/bin >> $GITHUB_PATH + - name: Install conda-build run: conda install conda-build + - name: Build conda package with NumPy 2.0 run: | CHANNELS="-c conda-forge --override-channels" @@ -56,6 +64,7 @@ jobs: $VERSIONS \ $CHANNELS \ conda-recipe-cf + - name: Upload artifact uses: actions/upload-artifact@v4 with: @@ -81,10 +90,13 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python_ver }} + - name: Add conda to system path run: echo $CONDA/bin >> $GITHUB_PATH + - name: Install conda-build run: conda install conda-build + - name: Create conda channel run: | mkdir -p $GITHUB_WORKSPACE/channel/linux-64 @@ -97,11 +109,14 @@ jobs: run: | CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}" conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME python=${{ matrix.python_ver }} ${{ matrix.numpy }} $CHANNELS --only-deps --dry-run > lockfile + - name: Display lockfile run: cat lockfile + - name: Set pkgs_dirs run: | echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc + - name: Cache conda packages uses: actions/cache@v4 env: @@ -120,6 +135,7 @@ jobs: conda create -n ${{ env.TEST_ENV_NAME }} python=${{ matrix.python_ver }} ${{ matrix.numpy }} $PACKAGE_NAME pytest scipy $CHANNELS # Test installed packages conda list -n ${{ env.TEST_ENV_NAME }} + - name: Run tests run: | source $CONDA/etc/profile.d/conda.sh @@ -133,9 +149,15 @@ jobs: matrix: python: ['3.9', '3.10', '3.11', '3.12'] steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: conda-incubator/setup-miniconda@v3 with: miniforge-version: latest @@ -181,6 +203,7 @@ jobs: defaults: run: shell: cmd /C CALL {0} + strategy: matrix: python_ver: ['3.9', '3.10', '3.11', '3.12'] @@ -227,9 +250,11 @@ jobs: shell: cmd /C CALL {0} run: | conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json + - name: Output content of produced ver.json shell: pwsh run: Get-Content -Path ${{ env.workdir }}\ver.json + - name: Collect dependencies shell: cmd /C CALL {0} run: | @@ -242,9 +267,11 @@ jobs: SET PACKAGE_VERSION=%%F ) conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python_ver }} ${{ matrix.numpy }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile + - name: Display lockfile content shell: pwsh run: Get-Content -Path .\lockfile + - name: Cache conda packages uses: actions/cache@v4 env: @@ -256,6 +283,7 @@ jobs: restore-keys: | ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python_ver }}- ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- + - name: Install mkl_fft shell: cmd /C CALL {0} run: | @@ -269,12 +297,14 @@ jobs: ) SET "TEST_DEPENDENCIES=pytest pytest-cov" conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} ${{ matrix.numpy }} scipy -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} + - name: Report content of test environment shell: cmd /C CALL {0} run: | echo "Value of CONDA enviroment variable was: " %CONDA% echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX% conda info && conda list -n ${{ env.TEST_ENV_NAME }} + - name: Run tests shell: cmd /C CALL {0} run: >- diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 3ddbb8cd..9cbd85c7 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -22,6 +22,11 @@ jobs: matrix: python: ['3.9', '3.10', '3.11', '3.12'] steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -29,6 +34,7 @@ jobs: - name: Set pkgs_dirs run: | echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc + - name: Cache conda packages uses: actions/cache@v4 env: @@ -43,8 +49,10 @@ jobs: - name: Add conda to system path run: echo $CONDA/bin >> $GITHUB_PATH + - name: Install conda-build run: conda install conda-build + - name: Build conda package run: | CHANNELS="-c conda-forge -c https://software.repos.intel.com/python/conda --override-channels" @@ -56,6 +64,7 @@ jobs: $VERSIONS \ $CHANNELS \ conda-recipe + - name: Upload artifact uses: actions/upload-artifact@v4 with: @@ -80,10 +89,13 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} + - name: Add conda to system path run: echo $CONDA/bin >> $GITHUB_PATH + - name: Install conda-build run: conda install conda-build + - name: Create conda channel run: | mkdir -p $GITHUB_WORKSPACE/channel/linux-64 @@ -96,11 +108,14 @@ jobs: run: | CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}" conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile + - name: Display lockfile run: cat lockfile + - name: Set pkgs_dirs run: | echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc + - name: Cache conda packages uses: actions/cache@v4 env: @@ -119,6 +134,7 @@ jobs: conda create -n ${{ env.TEST_ENV_NAME }} python=${{ matrix.python }} $PACKAGE_NAME pytest scipy $CHANNELS # Test installed packages conda list -n ${{ env.TEST_ENV_NAME }} + - name: Run tests run: | source $CONDA/etc/profile.d/conda.sh @@ -132,9 +148,15 @@ jobs: matrix: python: ['3.9', '3.10', '3.11', '3.12'] steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v4.2.0 with: fetch-depth: 0 + - uses: conda-incubator/setup-miniconda@v3 with: miniforge-version: latest @@ -182,6 +204,7 @@ jobs: defaults: run: shell: cmd /C CALL {0} + strategy: matrix: python: ['3.9', '3.10', '3.11', '3.12'] @@ -197,6 +220,7 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} + - uses: conda-incubator/setup-miniconda@v3 with: miniforge-version: latest @@ -226,9 +250,11 @@ jobs: shell: cmd /C CALL {0} run: | conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json + - name: Output content of produced ver.json shell: pwsh run: Get-Content -Path ${{ env.workdir }}\ver.json + - name: Collect dependencies shell: cmd /C CALL {0} run: | @@ -241,9 +267,11 @@ jobs: SET PACKAGE_VERSION=%%F ) conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile + - name: Display lockfile content shell: pwsh run: Get-Content -Path .\lockfile + - name: Cache conda packages uses: actions/cache@v4 env: @@ -255,6 +283,7 @@ jobs: restore-keys: | ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}- ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- + - name: Install mkl_fft shell: cmd /C CALL {0} run: | @@ -268,6 +297,7 @@ jobs: ) SET "TEST_DEPENDENCIES=pytest pytest-cov" conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} scipy -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} + - name: Report content of test environment shell: cmd /C CALL {0} run: |