Skip to content

fix mac float128

fix mac float128 #378

Workflow file for this run

name: build-macos
on:
push:
branches:
- main
release:
types:
- published
jobs:
build:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
# python-version: ['3.10', '3.11', '3.12', '3.13', 'pypy3.10', 'pypy3.11']
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisites
run: |
brew install suite-sparse
# Starting from libomp>=15.0, the libomp installation in homebrew is "keg-only",
# meaning that libomp is only installed in homebrew's directory, but not moved
# to /usr/local to avoid other OpenMP installations (such as with gcc's version
# of OpenMP). To use the homebrew's version of OpenMP,the following symbolic
# links are created. Without these, the installation will fail with the error
# of "fatal error: omp.h file found"
brew install libomp
# libomp_dir=$(brew --prefix libomp)
# brew_prefix=$(brew --prefix)
# mkdir -p ${brew_prefix}/include ${brew_prefix}/lib
# ln -sf ${libomp_dir}/include/omp-tools.h ${brew_prefix}/include/omp-tools.h
# ln -sf ${libomp_dir}/include/omp.h ${brew_prefix}/include/omp.h
# ln -sf ${libomp_dir}/include/ompt.h ${brew_prefix}/include/ompt.h
# ln -sf ${libomp_dir}/lib/libomp.a ${brew_prefix}/lib/libomp.a
# ln -sf ${libomp_dir}/lib/libomp.dylib ${brew_prefix}/lib/libomp.dylib
echo "CPPFLAGS=-I$(brew --prefix libomp)/include" >> $GITHUB_ENV
echo "CFLAGS=-I$(brew --prefix libomp)/include" >> $GITHUB_ENV
echo "CXXFLAGS=-I$(brew --prefix libomp)/include" >> $GITHUB_ENV
echo "LDFLAGS=-L$(brew --prefix libomp)/lib -lomp" >> $GITHUB_ENV
# Install OpenBLAS when PyPy is used, since it tries to compile numpy and scipt from
# source, whic needs OpenBLAS
- name: Install package and dependencies (OpenBLAS, gfortran)
if: (contains(matrix.python-version, 'pypy'))
run: |
brew install openblas
brew reinstall gcc
- name: Install package and dependencies
if: (matrix.python-version == '3.9')
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade . -vvv
env:
USE_LONG_INT: 0
USE_UNSIGNED_LONG_INT: 0
USE_CBLAS: 0
USE_MKL: 0
USE_CUDA: 0
# For python 3.10, 3.11 do not install extras (sparsesuite)
- name: Install package and dependencies
if: (!contains(matrix.python-version, 'pypy'))
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade . -vvv
env:
USE_LONG_INT: 0
USE_UNSIGNED_LONG_INT: 0
USE_CBLAS: 0
USE_MKL: 0
USE_CUDA: 0
# For PyPy, export OpenBLAS pkgconfig file, when pypy tries to build scipy from source
# which needs OpenBLAS
- name: Install package and dependencies
if: (contains(matrix.python-version, 'pypy'))
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade . -vvv
env:
PKG_CONFIG_PATH: /usr/local/opt/openblas/lib/pkgconfig
USE_LONG_INT: 0
USE_UNSIGNED_LONG_INT: 0
USE_CBLAS: 0
USE_MKL: 0
USE_CUDA: 0
# Despite the package is built on both cpython and pypy, here we
# only test it on cpython, not on pypy, since many other required
# dependencies (like matplotlib, etc) need to be compiled on pypy.
- name: Test
if: (!contains(matrix.python-version, 'pypy'))
run: |
python -m pip install --upgrade pytest
python -m pip install --upgrade pytest-cov
mv imate imate-DoNotImport
pytest
- name: Coverage
run: |
python -m pip install codecov
codecov