Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyoon committed Oct 16, 2024
1 parent 0a4b07c commit 1ebda2f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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

Expand All @@ -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.
<https://cmake.org/cmake/help/latest/envvar/MACOSX_DEPLOYMENT_TARGET.html>
> [!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.
> <https://cmake.org/cmake/help/latest/envvar/MACOSX_DEPLOYMENT_TARGET.html>
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
Expand Down
1 change: 0 additions & 1 deletion build_glibc_dependencies.txt

This file was deleted.

5 changes: 2 additions & 3 deletions build_reduce_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1ebda2f

Please sign in to comment.