diff --git a/pkgs/onnx.sh b/pkgs/onnx.sh index d1bdc93d..40b39460 100644 --- a/pkgs/onnx.sh +++ b/pkgs/onnx.sh @@ -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.]' # ------------------------------------------------------------ diff --git a/pkgs/pytorch.sh b/pkgs/pytorch.sh index a49cce16..a0894b6a 100644 --- a/pkgs/pytorch.sh +++ b/pkgs/pytorch.sh @@ -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 diff --git a/pkgs/utils/pip_install_from_git.sh b/pkgs/utils/pip_install_from_git.sh index 6b44f40b..e47f9ca4 100755 --- a/pkgs/utils/pip_install_from_git.sh +++ b/pkgs/utils/pip_install_from_git.sh @@ -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 )