mirror of
https://github.com/mii443/tokenizers.git
synced 2025-08-22 16:25:30 +00:00
Feat/m1 manual build (#936)
* feat(bindings): move target compilation flags to correct config file * feat(bindings): m1 build 'script' * feat(ci): for loop in bdist_wheel script for m1 Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com> Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
This commit is contained in:
14
bindings/python/.cargo/config.toml
Normal file
14
bindings/python/.cargo/config.toml
Normal file
@ -0,0 +1,14 @@
|
||||
[target.x86_64-apple-darwin]
|
||||
rustflags = [
|
||||
"-C", "link-arg=-undefined",
|
||||
"-C", "link-arg=dynamic_lookup",
|
||||
"-C", "link-arg=-mmacosx-version-min=10.11",
|
||||
]
|
||||
|
||||
[target.aarch64-apple-darwin]
|
||||
rustflags = [
|
||||
"-C", "link-arg=-undefined",
|
||||
"-C", "link-arg=dynamic_lookup",
|
||||
"-C", "link-arg=-mmacosx-version-min=10.11",
|
||||
]
|
||||
|
@ -30,8 +30,4 @@ tempfile = "3.1"
|
||||
[features]
|
||||
default = ["pyo3/extension-module"]
|
||||
|
||||
[target.x86_64-apple-darwin]
|
||||
rustflags = [
|
||||
"-C", "link-arg=-undefined",
|
||||
"-C", "link-arg=dynamic_lookup",
|
||||
]
|
||||
|
||||
|
9
bindings/python/tokenizers_manual_m1_build.sh
Normal file
9
bindings/python/tokenizers_manual_m1_build.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#! /bin/bash
|
||||
for VARIABLE in "3.7.12" "3.8.12" "3.9.10" "3.10.2"
|
||||
do
|
||||
MACOSX_DEPLOYMENT_TARGET=10.11 SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" CFLAGS="-I/usr/include/openssl -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" CPPFLAGS="-I/usr/local/opt/zlib/include" LDFLAGS="-L/usr/lib -L/usr/local/opt/readline/lib" pyenv install $VARIABLE
|
||||
|
||||
~/.pyenv/versions/$VARIABLE/bin/pip install setuptools wheel setuptools-rust==0.11.3 --ignore-installed --force-reinstall
|
||||
|
||||
MACOSX_DEPLOYMENT_TARGET=10.11 ~/.pyenv/versions/$VARIABLE/bin/python setup.py bdist_wheel
|
||||
done
|
Reference in New Issue
Block a user