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

build: add nix flake #9

Merged
merged 2 commits into from
May 17, 2023
Merged

build: add nix flake #9

merged 2 commits into from
May 17, 2023

Conversation

nekowinston
Copy link
Contributor

@nekowinston nekowinston commented May 12, 2023

Hi again!

This PR adds a Nix flake for this library, which would be used in the LiveCaptions Nix flake, so we can avoid using the nix run ".?submodules=1" parameter.

I had to adjust some things in the CMakeLists.txt (specifying where the headers are built to) and added aprilasr.pc.in for pkg-config, so please review those on a regular Linux system.

I'll make a second PR on LiveCaptions to consume this Flake.


Nix-related notes:
Since onnxruntime@1.14.1 isn't available on official nixpkgs yet, I had to do some patches to get the build to work. I'm pulling in NixOS/nixpkgs#226734 from its PR branch and handling a few errors that this PR introduces. We'd switch back to using pkgs.onnxruntime once that PR is merged, but this is the best way right now to use 1.14 like LiveCaptions requires.

nekowinston and others added 2 commits May 12, 2023 22:33
Co-authored-by: Carsten Kragelund <carsten@kragelund.me>
Co-authored-by: Carsten Kragelund <carsten@kragelund.me>
@abb128
Copy link
Owner

abb128 commented May 13, 2023

Would using onnxruntime 1.13.1 for now instead not work? The library doesn't rely on any 1.14+ features I believe

@nekowinston
Copy link
Contributor Author

I'll give using 1.13 a try.

@nekowinston
Copy link
Contributor Author

nekowinston commented May 14, 2023

It builds successfully on x86_64-linux when I'm using nixos-unstable onnxruntime, but that breaks onnxruntime on aarch64-darwin. I don't have a x86_64-darwin machine to try to see if it works there.

I guess we could use onnxruntime@1.13.1 on Linux, since it will use the cache, and the PR onnxruntime@1.14.1 on Darwin, but I don't know how wise that would be.

I have subscribed to the 1.14.1 PR on nixpkgs and would be happy to maintain both flakes for this & LiveCaptions, eventually trying to upstream it to nixpkgs as well.

@abb128
Copy link
Owner

abb128 commented May 14, 2023

It might be wiser to just stick to one working version then. How long do you think it would take for 1.14.1 to become available officially? Is it on the order of days, weeks, months?

@nekowinston
Copy link
Contributor Author

nekowinston commented May 14, 2023

Hard to say, but I don't think within the next week, and it hitting the shared build cache could take longer.

@nekowinston nekowinston mentioned this pull request May 14, 2023
@abb128
Copy link
Owner

abb128 commented May 15, 2023

I suppose it needs to pull the 1.14.1 PR then. Let me know when this is ready for merge

@nekowinston
Copy link
Contributor Author

I have dropped the last commit using 1.13.1 - should be good to merge if you're happy with the CMakeLists changes.

@abb128 abb128 merged commit 1bb4289 into abb128:main May 17, 2023
@abb128
Copy link
Owner

abb128 commented May 17, 2023

Thanks!

@nekowinston nekowinston deleted the build/add-nix-flake branch May 17, 2023 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants