Unverified Commit 474d87b8 authored by Omkar Salpekar's avatar Omkar Salpekar Committed by GitHub
Browse files

[Nova] Fix extensions in wheels build (#6972)

* Fix extensions in wheels build

* pass pre-script from caller

* add pre-script to run relocate on wheel

* install auditwheel for relocate

* reorder numpy install

* use jpeg80 for py3.9 and py3.10 mac builds

* revert back to jpeg9

* printing the found jpeg libs during build time and reintro circle for comparison

* more debug logs, remove extra linux builds

* typo fix

* brew uninstall conflicting jpeg libraries on mac machines

* fix path for unittests

* ufmt
parent 57a0c32e
...@@ -22,8 +22,8 @@ jobs: ...@@ -22,8 +22,8 @@ jobs:
matrix: matrix:
include: include:
- repository: pytorch/vision - repository: pytorch/vision
pre-script: "" pre-script: packaging/pre_build_script.sh
post-script: "" post-script: packaging/post_build_script.sh
smoke-test-script: test/smoke_test.py smoke-test-script: test/smoke_test.py
package-name: torchvision package-name: torchvision
name: ${{ matrix.repository }} name: ${{ matrix.repository }}
......
...@@ -22,8 +22,8 @@ jobs: ...@@ -22,8 +22,8 @@ jobs:
matrix: matrix:
include: include:
- repository: pytorch/vision - repository: pytorch/vision
pre-script: "" pre-script: packaging/pre_build_script.sh
post-script: "" post-script: packaging/post_build_script.sh
smoke-test-script: test/smoke_test.py smoke-test-script: test/smoke_test.py
package-name: torchvision package-name: torchvision
name: ${{ matrix.repository }} name: ${{ matrix.repository }}
......
...@@ -22,8 +22,8 @@ jobs: ...@@ -22,8 +22,8 @@ jobs:
matrix: matrix:
include: include:
- repository: pytorch/vision - repository: pytorch/vision
pre-script: "" pre-script: packaging/pre_build_script.sh
post-script: "" post-script: packaging/post_build_script.sh
smoke-test-script: test/smoke_test.py smoke-test-script: test/smoke_test.py
package-name: torchvision package-name: torchvision
name: ${{ matrix.repository }} name: ${{ matrix.repository }}
......
LD_LIBRARY_PATH="/usr/local/lib:$CUDA_HOME/lib64:$LD_LIBRARY_PATH" python packaging/wheel/relocate.py
if [[ "$(uname)" == Darwin || "$OSTYPE" == "msys" ]]; then
# Uninstall Conflicting jpeg brew formulae
jpeg_packages=$(brew list | grep jpeg)
echo "Existing Jpeg-related Brew libraries"
echo $jpeg_packages
for pkg in $jpeg_packages; do
brew uninstall --ignore-dependencies --force $pkg || true
done
# Install libpng from Anaconda (defaults)
conda install ${CONDA_CHANNEL_FLAGS} libpng "jpeg<=9b" -y
conda install -yq ffmpeg=4.2 -c pytorch
conda install -yq wget
else
# Install native CentOS libJPEG, freetype and GnuTLS
yum install -y libjpeg-turbo-devel freetype gnutls
# Download all the dependencies required to compile image and video_reader
# extensions
mkdir -p ext_libraries
pushd ext_libraries
popd
export PATH="$(pwd)/ext_libraries/bin:$PATH"
pip install auditwheel
# Point to custom libraries
export LD_LIBRARY_PATH=$(pwd)/ext_libraries/lib:$LD_LIBRARY_PATH
export TORCHVISION_INCLUDE=$(pwd)/ext_libraries/include
export TORCHVISION_LIBRARY=$(pwd)/ext_libraries/lib
fi
pip install numpy pyyaml future ninja
pip install --upgrade setuptools
"""Run smoke tests""" """Run smoke tests"""
import os
import torchvision import torchvision
from torchvision.io import read_image
image_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "assets", "encode_jpeg", "grace_hopper_517x606.jpg"
)
print("torchvision version is ", torchvision.__version__) print("torchvision version is ", torchvision.__version__)
img = read_image(image_path)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment