-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1383 from palonso/support-apple-silicon-cross-build
Add changes to support building arm64 macos wheels
- Loading branch information
Showing
5 changed files
with
109 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,12 @@ manylinux-x86_64-image = "mtgupf/essentia-builds:manylinux2014_x86_64" | |
|
||
# Only support x86_64 for essentia-tensorflow | ||
build = "cp**-manylinux_x86_64" | ||
skip = ["pp*", "*-musllinux*", "*i686"] | ||
# TODO: skipping Python 3.12 for now until we create manylinux images supporting this version. | ||
skip = ["pp*", "*-musllinux*", "*i686", "*cp312*"] | ||
|
||
environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1 } | ||
|
||
before-all = [ | ||
before-build = [ | ||
"PYBIN=/opt/python/cp36-cp36m/bin/", | ||
"\"${PYBIN}/python\" waf configure --with-gaia --with-tensorflow --build-static --static-dependencies --pkg-config-path=\"${PKG_CONFIG_PATH}\"", | ||
"\"${PYBIN}/python\" waf", | ||
|
@@ -24,11 +25,13 @@ skip = ["pp*"] | |
|
||
environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1 } | ||
|
||
before-all = [ | ||
before-build = [ | ||
"brew install pkg-config gcc readline sqlite gdbm freetype libpng", | ||
"brew install eigen libyaml fftw [email protected] libsamplerate libtag chromaprint", | ||
"brew install tensorflow", | ||
"brew install eigen libyaml fftw [email protected] libsamplerate libtag", | ||
"brew link --force [email protected]", | ||
"brew install chromaprint", | ||
"brew link --overwrite [email protected]", | ||
"brew install tensorflow", | ||
#"brew tap MTG/essentia", | ||
#"brew install gaia --HEAD", | ||
"python waf configure --with-tensorflow --pkg-config-path=\"${PKG_CONFIG_PATH}\"", | ||
|
@@ -39,6 +42,40 @@ before-all = [ | |
test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter, TensorflowPredict'" | ||
|
||
|
||
[[tool.cibuildwheel.overrides]] | ||
select = "*macosx_arm64*" | ||
|
||
skip = ["pp*"] | ||
|
||
environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, ESSENTIA_MACOSX_ARM64=1 } | ||
|
||
before-build = [ | ||
"brew install pkg-config gcc readline sqlite gdbm libpng", | ||
"brew install eigen libyaml fftw [email protected] libsamplerate libtag", | ||
"brew link --force [email protected]", | ||
"brew install chromaprint", | ||
"brew link --overwrite [email protected]", | ||
"brew install tensorflow", | ||
"python waf configure --with-tensorflow --pkg-config-path=\"${PKG_CONFIG_PATH}\" --arch arm64 --no-msse", | ||
"python waf", | ||
"sudo python waf install", | ||
] | ||
|
||
# On Mac arm64, libavcodec.56.60.100, libavformat.56.40.101 and | ||
# libavutil.54.31.100, depend on libSDL1.2-compat, which is a compatibility | ||
# layer for SDL2. libSDL1.2-compat expects SDL2 to be installed in the default | ||
# brew location (i.e., /opt/homebrew/opt/sdl2/lib), so the user would need to | ||
# install it via brew manually. Alternativelly, we can manualy copy the SDL2 | ||
# libs into the wheel. This is a temporary solution, and in the long term we | ||
# should move to FFmpeg > 2.X. | ||
repair-wheel-command = [ | ||
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}", | ||
"mkdir -p {dest_dir}/essentia/.dylibs", | ||
"cp /opt/homebrew/opt/sdl2/lib/libSDL2*.dylib {dest_dir}/essentia/.dylibs", | ||
"wheel_rel=$(echo {wheel} | grep -o '[^/]*$')", | ||
"cd {dest_dir} && zip -u {dest_dir}/$wheel_rel essentia/.dylibs/*" | ||
] | ||
|
||
[build-system] | ||
|
||
requires = ["wheel", "setuptools", "oldest-supported-numpy"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,12 @@ | |
manylinux-x86_64-image = "mtgupf/essentia-builds:manylinux2014_x86_64" | ||
manylinux-i686-image = "mtgupf/essentia-builds:manylinux2014_i686" | ||
|
||
skip = ["pp*", "*-musllinux*", "*i686"] | ||
# TODO: skipping Python 3.12 for now until we create manylinux images supporting this version. | ||
skip = ["pp*", "*-musllinux*", "*i686", "*cp312*"] | ||
|
||
environment = { PROJECT_NAME="essentia", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1 } | ||
|
||
before-all = [ | ||
before-build = [ | ||
"PYBIN=/opt/python/cp36-cp36m/bin/", | ||
"\"${PYBIN}/python\" waf configure --with-gaia --build-static --static-dependencies --pkg-config-path=\"${PKG_CONFIG_PATH}\"", | ||
"\"${PYBIN}/python\" waf", | ||
|
@@ -24,10 +25,12 @@ skip = ["pp*"] | |
|
||
environment = { PROJECT_NAME="essentia", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1 } | ||
|
||
before-all = [ | ||
before-build = [ | ||
"brew install pkg-config gcc readline sqlite gdbm freetype libpng", | ||
"brew install eigen libyaml fftw [email protected] libsamplerate libtag chromaprint", | ||
"brew install eigen libyaml fftw [email protected] libsamplerate libtag", | ||
"brew link --force [email protected]", | ||
"brew install chromaprint", | ||
"brew link --overwrite [email protected]", | ||
#"brew tap MTG/essentia", | ||
#"brew install gaia --HEAD", | ||
"python waf configure --pkg-config-path=\"${PKG_CONFIG_PATH}\"", | ||
|
@@ -37,6 +40,38 @@ before-all = [ | |
|
||
test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter'" | ||
|
||
[[tool.cibuildwheel.overrides]] | ||
select = "*macosx_arm64*" | ||
|
||
skip = ["pp*"] | ||
|
||
environment = { PROJECT_NAME="essentia", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, ESSENTIA_MACOSX_ARM64=1 } | ||
|
||
before-build = [ | ||
"brew install pkg-config gcc readline sqlite gdbm libpng", | ||
"brew install eigen libyaml fftw [email protected] libsamplerate libtag", | ||
"brew link --force [email protected]", | ||
"brew install chromaprint", | ||
"brew link --overwrite [email protected]", | ||
"python waf configure --pkg-config-path=\"${PKG_CONFIG_PATH}\" --arch arm64 --no-msse", | ||
"python waf", | ||
"sudo python waf install", | ||
] | ||
|
||
# On Mac arm64, libavcodec.56.60.100, libavformat.56.40.101 and | ||
# libavutil.54.31.100, depend on libSDL1.2-compat, which is a compatibility | ||
# layer for SDL2. libSDL1.2-compat expects SDL2 to be installed in the default | ||
# brew location (i.e., /opt/homebrew/opt/sdl2/lib), so the user would need to | ||
# install it via brew manually. Alternativelly, we can manualy copy the SDL2 | ||
# libs into the wheel. This is a temporary solution, and in the long term we | ||
# should move to FFmpeg > 2.X. | ||
repair-wheel-command = [ | ||
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}", | ||
"mkdir -p {dest_dir}/essentia/.dylibs", | ||
"cp /opt/homebrew/opt/sdl2/lib/libSDL2*.dylib {dest_dir}/essentia/.dylibs", | ||
"wheel_rel=$(echo {wheel} | grep -o '[^/]*$')", | ||
"cd {dest_dir} && zip -u {dest_dir}/$wheel_rel essentia/.dylibs/*" | ||
] | ||
|
||
[build-system] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters