diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 15078a0d..94c107ad 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -20,6 +20,11 @@ jobs: - RelNoOpenMP - RelWithDebInfo steps: + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64 - name: checkout uses: actions/checkout@v4 with: diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 7dc216a7..4a20f06d 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -11,16 +11,23 @@ on: jobs: conda-build: - name: Build Conda Package on ${{ matrix.os }} for Python ${{ matrix.python }} + name: Build Conda Package on ${{ matrix.os }} for Python ${{ matrix.pyver }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-15-intel, macos-15] - python: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] + os: [windows-latest, macos-15, macos-15-intel, ubuntu-latest] + pyver: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + defaults: run: shell: bash -el {0} + steps: + - name: Set up QEMU + if: matrix.os == 'ubuntu-latest' + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64 - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -31,16 +38,16 @@ jobs: python-version: 3.11 environment-file: conda-recipes/devtools.yml show-channel-urls: true - conda-remove-defaults: 'true' + conda-remove-defaults: "true" - name: Build conda packages run: | - conda build --python ${{ matrix.python }} --output-folder ../conda_packages smurff + conda build --python ${{ matrix.pyver }} --output-folder ../conda_packages smurff working-directory: conda-recipes - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: conda-${{ matrix.os }}-${{ matrix.python }} - path: conda_packages/* + name: conda-${{ matrix.os }}-${{ matrix.pyver }} + path: conda_packages/* merge: name: Merge all Conda artifacts @@ -50,4 +57,4 @@ jobs: - name: Merge Artifacts uses: actions/upload-artifact/merge@v4 with: - name: all-conda-packages \ No newline at end of file + name: all-conda-packages diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 4fa40f7d..6cc8c873 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -11,38 +11,48 @@ on: jobs: build_wheels: - name: wheel ${{ matrix.pyver }}-${{ matrix.os }} + name: Build wheel ${{ matrix.pyver }}-${{ matrix.os }}-${{ matrix.arch }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-15-intel, macos-15] - pyver: [cp39, cp310, cp311, cp312, cp313] + pyver: [cp39, cp310, cp311, cp312, cp313, cp314] + include: + - os: windows-latest + arch: "native" + - os: macos-15 + arch: "native" + - os: macos-15-intel + arch: "native" + - os: ubuntu-latest + arch: "native" + - os: ubuntu-latest + arch: "aarch64" steps: - uses: actions/checkout@v4 with: - submodules: 'true' + submodules: "true" fetch-depth: 0 # Used to host cibuildwheel - uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: "3.x" - name: Install cibuildwheel run: python -m pip install cibuildwheel - name: Build wheels env: - CIBW_BUILD: ${{matrix.pyver}}-* + CIBW_BUILD: ${{ matrix.pyver }}-* + CIBW_ARCHS: ${{ matrix.arch }} run: python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v4 with: - name: cibw-wheels-${{ matrix.os }}-${{ matrix.pyver }} + name: cibw-wheels-${{ matrix.os }}-${{ matrix.pyver }}-${{ matrix.arch }} path: ./wheelhouse/*.whl - merge: name: merge all wheel artifacts runs-on: ubuntu-latest @@ -51,4 +61,4 @@ jobs: - name: Merge Artifacts uses: actions/upload-artifact/merge@v4 with: - name: all-wheels \ No newline at end of file + name: all-wheels diff --git a/ci/docker/Dockerfile.manylinux b/ci/docker/Dockerfile.manylinux index ffce6824..2105a3f9 100644 --- a/ci/docker/Dockerfile.manylinux +++ b/ci/docker/Dockerfile.manylinux @@ -3,29 +3,5 @@ FROM quay.io/pypa/manylinux_2_28_x86_64 RUN yum -y install wget openblas-devel hdf5-devel && \ yum clean all - -#install Eigen -RUN wget -O Eigen.tar.gz https://gitlab.com/libeigen/eigen/-/archive/3.4.1/eigen-3.4.1.tar.gz && \ - tar xzf Eigen.tar.gz && \ - rm Eigen.tar.gz && \ - cd eigen* && \ - mkdir build && \ - cd build && \ - cmake .. && \ - make -j2 && \ - make install && \ - cd ../.. && \ - rm -r eigen* - -#install HighFive -RUN wget -O HighFive.tar.gz https://github.com/BlueBrain/HighFive/archive/v2.10.1.tar.gz && \ - tar xzf HighFive.tar.gz && \ - rm HighFive.tar.gz && \ - cd HighFive* && \ - mkdir build && \ - cd build && \ - cmake .. -DHIGHFIVE_USE_BOOST=OFF && \ - make -j2 && \ - make install && \ - cd ../.. && \ - rm -r HighFive* +COPY install_dependencies.sh /tmp/install_dependencies.sh +RUN chmod +x /tmp/install_dependencies.sh && /tmp/install_dependencies.sh && rm /tmp/install_dependencies.sh diff --git a/ci/docker/Dockerfile.manylinux.aarch64 b/ci/docker/Dockerfile.manylinux.aarch64 new file mode 100644 index 00000000..57002500 --- /dev/null +++ b/ci/docker/Dockerfile.manylinux.aarch64 @@ -0,0 +1,7 @@ +FROM quay.io/pypa/manylinux_2_28_aarch64 + +RUN yum -y install wget openblas-devel hdf5-devel && \ + yum clean all + +COPY install_dependencies.sh /tmp/install_dependencies.sh +RUN chmod +x /tmp/install_dependencies.sh && /tmp/install_dependencies.sh && rm /tmp/install_dependencies.sh diff --git a/ci/docker/Dockerfile.musllinux b/ci/docker/Dockerfile.musllinux index 520597dc..0e6e938c 100644 --- a/ci/docker/Dockerfile.musllinux +++ b/ci/docker/Dockerfile.musllinux @@ -2,15 +2,5 @@ FROM quay.io/pypa/musllinux_1_2_x86_64 RUN apk add wget eigen-dev openblas-dev hdf5-dev -#install HighFive -RUN wget -O HighFive.tar.gz https://github.com/BlueBrain/HighFive/archive/v2.10.1.tar.gz && \ - tar xzf HighFive.tar.gz && \ - rm HighFive.tar.gz && \ - cd HighFive* && \ - mkdir build && \ - cd build && \ - cmake .. -DHIGHFIVE_USE_BOOST=OFF && \ - make -j2 && \ - make install && \ - cd ../.. && \ - rm -r HighFive* +COPY install_dependencies.sh /tmp/install_dependencies.sh +RUN chmod +x /tmp/install_dependencies.sh && /tmp/install_dependencies.sh && rm /tmp/install_dependencies.sh diff --git a/ci/docker/Makefile b/ci/docker/Makefile new file mode 100644 index 00000000..2bbc03fb --- /dev/null +++ b/ci/docker/Makefile @@ -0,0 +1,36 @@ +.PHONY: all alpine manylinux manylinux-aarch64 musllinux ubuntu clean push push-manylinux push-manylinux-aarch64 push-musllinux + +MANYLINUX_X86_64_IMAGE = vanderaa/manylinux_2_28_x86_64_smurff +MANYLINUX_AARCH64_IMAGE = vanderaa/manylinux_2_28_aarch64_smurff +MUSLLINUX_X86_64_IMAGE = vanderaa/musllinux_1_2_x86_64_smurff + +all: alpine manylinux manylinux-aarch64 musllinux ubuntu + +push: push-manylinux push-manylinux-aarch64 push-musllinux + +alpine: + docker build -f Dockerfile.alpine -t smurff:alpine . + +manylinux: + docker build -f Dockerfile.manylinux -t $(MANYLINUX_X86_64_IMAGE) . + +push-manylinux: + docker push $(MANYLINUX_X86_64_IMAGE) + +manylinux-aarch64: + docker build -f Dockerfile.manylinux.aarch64 -t $(MANYLINUX_AARCH64_IMAGE) . + +push-manylinux-aarch64: + docker push $(MANYLINUX_AARCH64_IMAGE) + +musllinux: + docker build -f Dockerfile.musllinux -t $(MUSLLINUX_X86_64_IMAGE) . + +push-musllinux: + docker push $(MUSLLINUX_X86_64_IMAGE) + +ubuntu: + docker build -f Dockerfile.ubuntu -t smurff:ubuntu . + +clean: + docker rmi smurff:alpine $(MANYLINUX_X86_64_IMAGE) $(MANYLINUX_AARCH64_IMAGE) $(MUSLLINUX_X86_64_IMAGE) smurff:ubuntu 2>/dev/null || true diff --git a/ci/docker/install_dependencies.sh b/ci/docker/install_dependencies.sh new file mode 100644 index 00000000..37a06248 --- /dev/null +++ b/ci/docker/install_dependencies.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -e + +# Install Eigen +echo "Installing Eigen..." +wget -O Eigen.tar.gz https://gitlab.com/libeigen/eigen/-/archive/3.4.1/eigen-3.4.1.tar.gz +tar xzf Eigen.tar.gz +rm Eigen.tar.gz +cd eigen* +mkdir build +cd build +cmake .. +make -j2 +make install +cd ../.. +rm -r eigen* + +# Install HighFive +echo "Installing HighFive..." +wget -O HighFive.tar.gz https://github.com/BlueBrain/HighFive/archive/v2.10.1.tar.gz +tar xzf HighFive.tar.gz +rm HighFive.tar.gz +cd HighFive* +mkdir build +cd build +cmake .. -DHIGHFIVE_USE_BOOST=OFF +make -j2 +make install +cd ../.. +rm -r HighFive* + +echo "Done!" diff --git a/conda-recipes/conda_build_config.yaml b/conda-recipes/conda_build_config.yaml index ae614f6b..53fe1487 100644 --- a/conda-recipes/conda_build_config.yaml +++ b/conda-recipes/conda_build_config.yaml @@ -3,10 +3,11 @@ python: - 3.10 - 3.11 - 3.12 - - 3.13 + - 3.13 # [not aarch64] + - 3.14 -blas_impl: # [linux64 or win64] - - openblas # [linux64 or win64] +blas_impl: # [linux64 or aarch64 or win64] + - openblas # [linux64 or aarch64 or win64] - mkl # [linux64 or win64] hdf5: @@ -16,6 +17,13 @@ hdf5: c_compiler: vs2022 # [win] cxx_compiler: vs2022 # [win] +target_platform: # [linux] + - linux-64 # [linux] + - linux-aarch64 # [linux] + pin_run_as_build: libboost: x.x hdf5: x.x.x + python: + min_pin: x.x + max_pin: x.x \ No newline at end of file diff --git a/conda-recipes/smurff/meta.yaml b/conda-recipes/smurff/meta.yaml index 16e0a9ab..4236f263 100644 --- a/conda-recipes/smurff/meta.yaml +++ b/conda-recipes/smurff/meta.yaml @@ -16,11 +16,13 @@ requirements: - ninja - {{ compiler('cxx') }} - {{ compiler('c') }} - - llvm-openmp # [osx] + - llvm-openmp # [osx] + - python # [build_platform != target_platform] + - cross-python_{{target_platform}} # [build_platform != target_platform] host: - - llvm-openmp # [osx] - - mkl-devel <2025 # [blas_impl == 'mkl'] - - openblas # [blas_impl != 'mkl'] + - llvm-openmp # [osx] + - mkl-devel # [blas_impl == 'mkl'] + - openblas # [blas_impl != 'mkl'] - eigen - catch2 - libboost-devel @@ -32,9 +34,9 @@ requirements: - setuptools_scm run: - python {{ python }} - - mkl <2025 # [blas_impl == 'mkl'] - - openblas # [blas_impl != 'mkl'] - - libboost # [not win] + - mkl # [blas_impl == 'mkl'] + - openblas # [blas_impl != 'mkl'] + - libboost # [not win] - numpy - scipy - pandas diff --git a/pyproject.toml b/pyproject.toml index ad095bb0..7e121553 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,6 +76,7 @@ test-command = 'pytest -n auto {project}/python/test' test-requires = 'parameterized pytest pytest-xdist' manylinux-x86_64-image = "vanderaa/manylinux_2_28_x86_64_smurff" +manylinux-aarch64-image = "vanderaa/manylinux_2_28_aarch64_smurff" musllinux-x86_64-image = "vanderaa/musllinux_1_2_x86_64_smurff" # - cibuildwheel on macos -