From 1ebda2fdf5000db1fa2aac40ab5ddee474f46633 Mon Sep 17 00:00:00 2001 From: Kiyoon Kim Date: Wed, 16 Oct 2024 15:52:00 +0900 Subject: [PATCH] . --- .gitignore | 2 +- README.md | 22 ++++++++++++++-------- build_glibc_dependencies.txt | 1 - build_reduce_linux.sh | 5 ++--- 4 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 build_glibc_dependencies.txt diff --git a/.gitignore b/.gitignore index 53de076..ee706d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/build_glibc_dependency.txt +/binary_glibc_dependency.txt /build/ /build_python/ # Created by https://www.toptal.com/developers/gitignore/api/python diff --git a/README.md b/README.md index a341af0..3f7a9ae 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ reduce("-h") Supported platforms: -- Linux x86_64 (Ubuntu 20.04 +) +- Linux x86_64 - MacOS x86_64, arm64 (Intel and Apple Silicon) > [!NOTE] @@ -47,7 +47,7 @@ This section describes how it works. To run it locally, first install the dependencies: ```bash -pip install uv +pip install uv --user --break-system-packages uv tool install wheel uv tool install build @@ -59,21 +59,27 @@ Build the app at `buiid/` (reduce): ```bash # Linux -bash build_reduce.sh v4.14 +bash build_reduce_linux.sh v4.14 # Mac (Intel) -MACOSX_DEPLOYMENT_TARGET=10.12 bash build_reduce.sh v4.14 +MACOSX_DEPLOYMENT_TARGET=10.12 bash build_reduce_mac.sh v4.14 # Mac (Apple Silicon) -MACOSX_DEPLOYMENT_TARGET=11.0 bash build_reduce.sh v4.14 +MACOSX_DEPLOYMENT_TARGET=11.0 bash build_reduce_mac.sh v4.14 ``` -The `MACOSX_DEPLOYMENT_TARGET` is the cmake flag. - +> [!NOTE] +> Linux build uses an old version of ubuntu docker to be compatible with old systems. +> It also checks if the glibc dependency is lower than 2.17. +> In the future you may need to increase this version in the script. + +> [!NOTE] +> The `MACOSX_DEPLOYMENT_TARGET` is the cmake flag. +> Build the wheel. It copies the `python` to `build_python/`, built binary into it, modifies the version number and builds the wheel in `build_python/dist/`.: ```bash # One of the following -bash build_python.sh wheel 4.14 manylinux_2_28_x86_64 +bash build_python.sh wheel 4.14 manylinux_2_17_x86_64.manylinux2014_x86_64 bash build_python.sh wheel 4.14 macosx_10_12_x86_64 bash build_python.sh wheel 4.14 macosx_11_0_arm64 bash build_python.sh sdist 4.14 # not used diff --git a/build_glibc_dependencies.txt b/build_glibc_dependencies.txt deleted file mode 100644 index 6b4950e..0000000 --- a/build_glibc_dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -2.4 diff --git a/build_reduce_linux.sh b/build_reduce_linux.sh index 7b8bf25..76029da 100755 --- a/build_reduce_linux.sh +++ b/build_reduce_linux.sh @@ -29,13 +29,12 @@ if [[ "$dependency_lower_than_2_17" != "2.17" ]]; then echo "⚠️ The glibc dependency is higher than 2.17." echo "⚠️ The binary may not run on all systems." echo "⚠️ Dependency: $BINARY_GLIBC_DEPENDENCY" + docker rm -f reducecontainer exit 1 else echo "✅ The glibc dependency is lower than 2.17." echo "✅ The binary should run on most systems." echo "✅ Dependency: $BINARY_GLIBC_DEPENDENCY" - exit 1 fi -# docker rm -f reducecontainer - +docker rm -f reducecontainer