Skip to content

Commit

Permalink
Inject pkg-config path for fallback to work around scipy build bug on…
Browse files Browse the repository at this point in the history
… finding OpenBLAS.

- scipy/scipy#16308
  • Loading branch information
xkszltl committed Jul 29, 2022
1 parent c6a2b71 commit 8b6611d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
23 changes: 22 additions & 1 deletion pkgs/onnx.sh
Expand Up @@ -10,7 +10,28 @@
benjaminp/six \
'pytest-dev/pytest,[3.6=7.0.]' \
'numpy/numpy,v[3.6=v1.19.|3.7=v1.21.]' \
'scipy/scipy,v[3.6=v1.5.|3.7=v1.7.]' \

# Known issues:
# - SciPy meson build uses the wrong casing of OpenBLAS for CMake.
# On Debian, pkg-config also searches in /usr/local and works as a fallback, but not on CentOS 7.
# https://github.com/scipy/scipy/issues/16308
(
set -xe

case "$DISTRO_ID" in
'centos' | 'fedora' | 'rhel' | 'scientific')
export PKG_CONFIG_PATH="$(rpm -ql roaster-openblas | grep -v '/src/' | grep '\.pc' | xargs -rI{} dirname {} | sort -u | paste -sd: -)"
;;
'debian' | 'linuxmint' | 'ubuntu')
export PKG_CONFIG_PATH="$(dpkg -L roaster-openblas | grep -v '/src/' | grep '\.pc' | xargs -rI{} dirname {} | sort -u | paste -sd: -)"
;;
esac

"$ROOT_DIR/pkgs/utils/pip_install_from_git.sh" \
'scipy/scipy,v[3.6=v1.5.|3.7=v1.7.]' \
)

"$ROOT_DIR/pkgs/utils/pip_install_from_git.sh" \
'scikit-learn/scikit-learn,[3.6=0.24.|3.7=1.0.]'

# ------------------------------------------------------------
Expand Down
23 changes: 22 additions & 1 deletion pkgs/pytorch.sh
Expand Up @@ -13,7 +13,28 @@
'pytest-dev/pytest,[3.6=7.0.]' \
Frozenball/pytest-sugar,master \
'numpy/numpy,v[3.6=v1.19.|3.7=v1.21.]' \
'scipy/scipy,v[3.6=v1.5.|3.7=v1.7.]' \

# Known issues:
# - SciPy meson build uses the wrong casing of OpenBLAS for CMake.
# On Debian, pkg-config also searches in /usr/local and works as a fallback, but not on CentOS 7.
# https://github.com/scipy/scipy/issues/16308
(
set -xe

case "$DISTRO_ID" in
'centos' | 'fedora' | 'rhel' | 'scientific')
export PKG_CONFIG_PATH="$(rpm -ql roaster-openblas | grep -v '/src/' | grep '\.pc' | xargs -rI{} dirname {} | sort -u | paste -sd: -)"
;;
'debian' | 'linuxmint' | 'ubuntu')
export PKG_CONFIG_PATH="$(dpkg -L roaster-openblas | grep -v '/src/' | grep '\.pc' | xargs -rI{} dirname {} | sort -u | paste -sd: -)"
;;
esac

"$ROOT_DIR/pkgs/utils/pip_install_from_git.sh" \
'scipy/scipy,v[3.6=v1.5.|3.7=v1.7.]' \
)

"$ROOT_DIR/pkgs/utils/pip_install_from_git.sh" \
'networkx/networkx,networkx-[3.6=networkx-2.5.]' \
micheles/decorator
case "$(python3 --version | cut -d' ' -f2 | cut -d. -f-2)" in
Expand Down
2 changes: 1 addition & 1 deletion pkgs/utils/pip_install_from_git.sh
Expand Up @@ -129,7 +129,7 @@ for i in 'pypa/setuptools,v60.[3.6=v59.6.]' 'pypa/pip,[3.6=21.]' pypa/wheel Pyth
set +x
for opt in '' '-I' ';'; do
[ "_$opt" != '_;' ]
! /usr/bin/sudo -E PATH="$PATH" PIP_INDEX_URL="$PIP_INDEX_URL" "$py" -m pip install --no-clean -Uv $opt "$URL" || break
! /usr/bin/sudo -E PATH="$PATH" PIP_INDEX_URL="$PIP_INDEX_URL" PKG_CONFIG_PATH="$PKG_CONFIG_PATH" "$py" -m pip install --no-clean -Uv $opt "$URL" || break
done
)

Expand Down

0 comments on commit 8b6611d

Please sign in to comment.