Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build_tools/packaging/wheel/build_from_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ popd

# build mad, statically
pushd libmad-0.15.1b
# See https://stackoverflow.com/a/12864879/23845
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want, you can use: https://github.com/conda-forge/mad-feedstock/blob/master/recipe/mad.patch

I had issues with clang as well, which need this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to build wheels after only this change, so that's kind of interesting.

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
Expand Down
12 changes: 7 additions & 5 deletions build_tools/packaging/wheel/linux_manywheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions build_tools/packaging/wheel/osx_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if [[ ":$PATH:" == *"conda"* ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this, you are prone to accidents. but up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how the accident occurs; the script initializes a fresh conda environment and then sources it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you already have a conda install in path, and you install + source a new conda install, the PATH will have both conda installs at the same time. Then your cmake will find stuff in the first OR the second conda install

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. OK I'll bring it back

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 && \
Expand Down Expand Up @@ -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
Expand Down