Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements #15

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Improvements #15

wants to merge 4 commits into from

Conversation

ink-splatters
Copy link

@ink-splatters ink-splatters commented Jan 1, 2024

Improvements

ditch rm -rf

I was genuinely embarrassed by its effects, so it inspired me for this PR :)

options

the following options implemented:

--no-clean - suppresses everything but the last ./build.sh invocation.
--ninja - sets Ninja as CMake generator. ninja outperforms gnumake at incremental compilation, above all.
--lto - may or may not result in measurable runtime performance gains, and WILL result in build performance loss, so this switch I consider experimental

test

System info:

airstation:tmp ic$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.2.0, macOS 14.2.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.19.2`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

airstation:tmp ic$  nix-instantiate --eval '<nixpkgs>' --attr lib.version
"24.05pre561758.d6863cbcbbb8"

build env + build/install

#/bin/bash

pyver=3.1

# no Xcode needed
# llvmPackages_latest pulls clang 16.0.6
nix-shell -p \
      micromamba \
      llvmPackages_latest.stdenv \ 
      cmake \
      ninja \
      iconv \
      darwin.apple_sdk.frameworks.Foundation \
      darwin.apple_sdk.frameworks.CoreML

alias m=micromamba

eval "$(m shell hook --shell bash)"

m env create -n onnx-rt
m activate onnx-rt
m install python=$pyver
pip install -U pip wheel

./build-mac.sh --lto --ninja

pip install dist/*.whl

roadmap [maybe]

  • linking using lld
  • nix flake for build env

* fixed `build.sh --clean` to be called with --config Release.

* added --no-clean, which both prevents the repo to be reset and
  suppressess `./build.sh --clean` and `./build.sh --update`
  invocations.

  caveat: it's solely intended to prevent clean rebuilds;
  it's assumed that excluded stages had completed successfully,
  before.
* implemented options parsing
@cansik
Copy link
Owner

cansik commented Jan 19, 2024

Thanks for your contribution, it seems to look good. I am still doing some tests, because I couldn't build it yet, but I guess something has changed on my build system and it is not script related.

@cansik cansik self-assigned this Jan 19, 2024
@cansik cansik added the enhancement New feature or request label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants