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

Compiling from source: reproducible builds using nix #8622

Open
arunoruto opened this issue Jan 4, 2025 · 0 comments
Open

Compiling from source: reproducible builds using nix #8622

arunoruto opened this issue Jan 4, 2025 · 0 comments
Labels
question Question on using Taichi

Comments

@arunoruto
Copy link

Hi! I just recently gave taichi a go and was really amazed how good it worked! So thanks for you hard work 💪🏻

Since I am a Nix user, or more specifically NixOS, I wanted to package taichi and make it available on nixpkgs.
I had two options:

  1. Fetch the appropriate wheel from PyPI and patch it for nix, or
  2. Build from source right away!

My first attempt was to package it from pypi, but taichi diverts a bit from the usual naming conveniention and I had to specify the wheel URLs and hashes manually, which is a bit cumbersome. Also, AMDGPU support is only available if compiled with LLVM from ROCm.
So I decided to try option 2, and compile it from source.

While there is a page in the docs on how to compile taichi for development purposes, with the accompanying scripts to go, I used the build.yaml workflow from GitHub to set the correct cmake flags and dove into the build scripts on my own.

I am not able to use the build.py script, since it accesses a read-only folder in the sandbox during build, so I opted for the automated cmake build of nix (if cmake is provided as a dependency, it will execute it automatically).

I was able to hack something together and package taichi, and it seems to be working with OpenGL, but Vulkan and CUDA is not working correctly.

I am not expecting the issue to be resolved by taichi-devs, but maybe give me a hint on how to compile the package correctly without the provided build.py. Maybe someone is using nix themselves and would be eager to collaborate on packaging it 😄

The current PR can be found here: NixOS/nixpkgs#370780
(The previous attempt with packaging from PyPI is here: NixOS/nixpkgs#367617)
When I am home, I can provide additional logs from compiling!

@arunoruto arunoruto added the question Question on using Taichi label Jan 4, 2025
@github-project-automation github-project-automation bot moved this to Untriaged in Taichi Lang Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question on using Taichi
Projects
Status: Untriaged
Development

No branches or pull requests

1 participant