From 79f2990c321af012a6dfc3fd437758af2003bfbe Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Thu, 1 Aug 2019 12:44:22 -0700 Subject: [PATCH] Packaging improvements for 0.2.0 Based off of #198 but nightly specific changes were dropped. Signed-off-by: Edward Z. Yang --- build_tools/packaging/wheel/build_from_source.sh | 2 ++ build_tools/packaging/wheel/linux_manywheel.sh | 12 +++++++----- build_tools/packaging/wheel/osx_wheel.sh | 11 +++++------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/build_tools/packaging/wheel/build_from_source.sh b/build_tools/packaging/wheel/build_from_source.sh index 665d3cfece..298f800d22 100755 --- a/build_tools/packaging/wheel/build_from_source.sh +++ b/build_tools/packaging/wheel/build_from_source.sh @@ -28,6 +28,8 @@ popd # build mad, statically pushd libmad-0.15.1b +# See https://stackoverflow.com/a/12864879/23845 +sed -i.bak 's/-march=i486//' configure ./configure --disable-shared --enable-static --prefix="$PREFIX/audio/third_party/mad" CFLAGS=-fPIC CXXFLAGS=-fPIC \ --with-pic --disable-debug --disable-dependency-tracking make -s -j && make install diff --git a/build_tools/packaging/wheel/linux_manywheel.sh b/build_tools/packaging/wheel/linux_manywheel.sh index 66e7daf7f5..3c3875fa99 100755 --- a/build_tools/packaging/wheel/linux_manywheel.sh +++ b/build_tools/packaging/wheel/linux_manywheel.sh @@ -27,13 +27,15 @@ export PREFIX="/tmp" cd /tmp/audio for PYDIR in "${python_installations[@]}"; do - # wheels for numba does not work with python 2.7 - if [[ "$PYDIR" == "/opt/python/cp27-cp27m/" || "$PYDIR" == "/opt/python/cp27-cp27mu/" ]]; then - continue; - fi export PATH=$PYDIR/bin:$OLD_PATH + # For true hermetic builds, you ought to be constructing the docker + # from scratch each time. But this makes things marginally safer if + # you aren't doing this. + pip uninstall -y torch || true pip install --upgrade pip - pip install -r requirements.txt + pip install numpy future torch + # NB: do not actually install requirements.txt; that is only needed for + # testing IS_WHEEL=1 python setup.py clean IS_WHEEL=1 python setup.py bdist_wheel mkdir -p $OUT_DIR diff --git a/build_tools/packaging/wheel/osx_wheel.sh b/build_tools/packaging/wheel/osx_wheel.sh index 7f4cc53a9f..f862e27220 100755 --- a/build_tools/packaging/wheel/osx_wheel.sh +++ b/build_tools/packaging/wheel/osx_wheel.sh @@ -1,7 +1,7 @@ -if [[ ":$PATH:" == *"conda"* ]]; then - echo "existing anaconda install in PATH, remove it and run script" - exit 1 -fi +#!/bin/bash + +set -ex + # download and activate anaconda rm -rf ~/minconda_wheel_env_tmp wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh && \ @@ -40,8 +40,7 @@ do conda create -yn $env_name python="$desired_python" conda activate $env_name - # install torchaudio dependencies - pip install -r requirements.txt + pip install torch numpy future IS_WHEEL=1 python setup.py clean IS_WHEEL=1 python setup.py bdist_wheel