Skip to content

Commit

Permalink
Fixed #971 Bump Min NumPy SciPy Versions and OpenMP Problems (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlaw authored May 16, 2024
1 parent d018452 commit 635ab27
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 34 deletions.
45 changes: 27 additions & 18 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,18 @@ jobs:
- name: Run Flake8
run: flake8 ./
shell: bash
- name: Link OpenMP
- name: Install and Link OpenMP
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
echo "Installing OpenMP"
brew install libomp
echo "Linking OpenMP"
brew link --force libomp
echo "Find OpenMP Linking Location"
libfile=`brew list libomp --verbose | grep libomp.dylib`
echo $libfile
echo "Changing @rpath for the omppool.cpython-x-darwin.so shared object to look in $libfile"
ls "$(python -c 'import site; print(site.getsitepackages()[0])')"/numba/np/ufunc/omppool.*.so | xargs install_name_tool -change @rpath/libomp.dylib $libfile
fi
shell: bash
- name: Show Full Numba Environment
Expand Down Expand Up @@ -77,26 +85,19 @@ jobs:
- name: Run Flake8
run: flake8 ./
shell: bash
- name: Link OpenMP
- name: Install OpenMP
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
# Fix libiomp5.dylib
echo "Install OpenMP via Conda"
conda install -c intel -y openmp
echo "Checking $CONDA/lib for OpenMP"
ls $CONDA/lib/libiomp5.dylib
echo "Changing @rpath for the omppool.cpython-x-darwin.so shared object to look in $CONDA/lib"
ls "$(python -c 'import site; print(site.getsitepackages()[0])')"/numba/np/ufunc/omppool.*.so | xargs install_name_tool -change @rpath/libiomp5.dylib $CONDA/lib/libiomp5.dylib
# Fix libomp.dylib
echo "Linking OpenMP into /usr/local/lib"
echo "Installing OpenMP"
brew install libomp
echo "Linking OpenMP"
brew link --force libomp
echo "Checking /usr/local/lib for OpenMP"
ls /usr/local/lib/libomp.dylib
echo "Changing @rpath for the omppool.cpython-x-darwin.so shared object to look in /usr/local/lib"
ls "$(python -c 'import site; print(site.getsitepackages()[0])')"/numba/np/ufunc/omppool.*.so | xargs install_name_tool -change @rpath/libomp.dylib /usr/local/lib/libomp.dylib
echo "Checking Numba OpenMP Access"
python -c "from numba.np.ufunc import omppool"
fi
echo "Find OpenMP Linking Location"
libfile=`brew list libomp --verbose | grep libomp.dylib`
echo $libfile
echo "Changing @rpath for the omppool.cpython-x-darwin.so shared object to look in $libfile"
ls "$(python -c 'import site; print(site.getsitepackages()[0])')"/numba/np/ufunc/omppool.*.so | xargs install_name_tool -change @rpath/libomp.dylib $libfile
fi
shell: bash
- name: Show Full Numba Environment
run: python -m numba -s
Expand Down Expand Up @@ -134,7 +135,15 @@ jobs:
- name: Link OpenMP
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
echo "Installing OpenMP"
brew install libomp
echo "Linking OpenMP"
brew link --force libomp
echo "Find OpenMP Linking Location"
libfile=`brew list libomp --verbose | grep libomp.dylib`
echo $libfile
echo "Changing @rpath for the omppool.cpython-x-darwin.so shared object to look in $libfile"
ls "$(python -c 'import site; print(site.getsitepackages()[0])')"/numba/np/ufunc/omppool.*.so | xargs install_name_tool -change @rpath/libomp.dylib $libfile
fi
shell: bash
- name: Show Full Numba Environment
Expand Down
12 changes: 2 additions & 10 deletions min.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,11 @@ def get_min_numba_numpy_version(min_python):
.pipe(
lambda df: df.assign(
MIN_PYTHON_SPEC=(
df.Python.str.split().str[1].replace({"<": ">"}, regex=True)
df.Python.str.split().str[1].replace({"<": "="}, regex=True)
+ df.Python.str.split().str[0].replace({".x": ""}, regex=True)
).apply(SpecifierSet)
)
)
.pipe(
lambda df: df.assign(
MAX_PYTHON_SPEC=(
df.Python.str.split().str[3].replace({">": "<"}, regex=True)
+ df.Python.str.split().str[4].replace({".x": ""}, regex=True)
).apply(SpecifierSet)
)
)
.pipe(
lambda df: df.assign(
MIN_NUMPY=(df.NumPy.str.split().str[0].replace({".x": ""}, regex=True))
Expand All @@ -70,7 +62,7 @@ def check_python_compatibility(row, min_python):
"""
Determine the Python version compatibility
"""
python_compatible = min_python in (row.MIN_PYTHON_SPEC & row.MAX_PYTHON_SPEC)
python_compatible = min_python in (row.MIN_PYTHON_SPEC)
return python_compatible


Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ maintainers = [
]
license = {text = "3-clause BSD License"}
dependencies = [
"numpy >= 1.18",
"scipy >= 1.5",
"numba >= 0.55.2"
"numpy >= 1.21",
"scipy >= 1.10",
"numba >= 0.57.1"
]

[tool.setuptools]
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
numpy>=1.18
scipy>=1.5
numba>=0.55.2
numpy>=1.21
scipy>=1.10
numba>=0.57.1

0 comments on commit 635ab27

Please sign in to comment.