-
Notifications
You must be signed in to change notification settings - Fork 8
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
Unable to build on MacOS #145
Comments
Hi, yes indeed I have been ignoring MacOS support a bit since I had no good way of debugging it. I am happy to take an hour one of these days to sit down for some co-programming and adjust the paths and file endings to whatever Apple prefers, but other than that I have no good way of making progress here beside of waiting for PRs fixing this. Would you be interested to work on it? |
Hey, I’m generally very happy to help with debugging path problems, as long as no understanding of compiler internals or LLVM stuff is needed! |
Yep no worries that's not needed, the bugs are likely that I either hardcoded some paths or file endings that don't exist on linux. So if you are fine with screen-sharing, we can just compile it on your PC with some debug flags and fix all the bugs along the way. Do either Thursday or Friday after 8am PDT work for you? |
Great, Thursday 8am PDT / 3pm UTC works! I can send you a Teams link if that's ok! |
Here is the full stack trace:
|
rust/src/bootstrap/src/core/build_steps/compile.rs |
Changing
results in
|
Looking through old PRs and online docs, you can apparently get rid of |
I managed to get it to build (I'll try to re-trace my steps later)! I then ran
But now I'm stuck with
Adding |
(unrelated, but looks like Zed just got support for |
What fixed it in the end was mainly EnzymeAD/Enzyme#1683 plus some file naming shenanigans, so that the compiler can find the right dylib. |
Can you share your final rust changes so we can merge them? |
Hoewever, building using those changes seems to result in a runtime dependency on
|
But only of rustc which I'd expect, but not of your binary, right? I.e. if you run |
No, looks its weirdly an actual dependency of the binary: (this is with
|
That's bad, but by default (if Enzyme isn't moved between compiling and running the binary) is going to work, right? cc @tgymnich since we just talked about it. |
Well, I only noticed this because I tried to build and import a Python module using Pyo3 and Python's importlib gives a helpful error when it can't locate a dynaimc library. |
I just merged a different fix from Tim, @marcpabst can you try to rebuild and see if A) it works and B) if you still have the runtime dependency of your resulting test/example binaries on LLVM and Enzyme? |
This is what I'm seeing:
|
Can you share what file it's looking for, and how your Enzyme build folder looks like? |
It's looking for
|
Ah good, only the file ending is wrong (so vs dylib), but at least the libenzyme version exists. Do you want to quickly test a fix and make a PR if you find that we're under macos? |
@ZuseZ4 maybe I overlooked some error. It should use .dylib on mac. Possibly also .dll on windows? |
Some quick changes in if let Some(enzyme_install) = enzyme_install {
let src_lib = enzyme_install.join("build/Enzyme/libEnzyme-17.so");
let libdir = builder.sysroot_libdir(build_compiler, build_compiler.host);
let target_libdir = builder.sysroot_libdir(target_compiler, target_compiler.host);
let dst_lib = libdir.join("libEnzyme-17.so");
let target_dst_lib = target_libdir.join("libEnzyme-17.so");
builder.copy(&src_lib, &dst_lib);
builder.copy(&src_lib, &target_dst_lib);
} if let Some(enzyme_install) = enzyme_install {
let src_lib = enzyme_install.join("build/Enzyme/libEnzyme-17.dylib");
let libdir = builder.sysroot_libdir(build_compiler, build_compiler.host);
let target_libdir = builder.sysroot_libdir(target_compiler, target_compiler.host);
let dst_lib = libdir.join("libEnzyme-17.dylib");
let target_dst_lib = target_libdir.join("libEnzyme-17.dylib");
builder.copy(&src_lib, &dst_lib);
builder.copy(&src_lib, &target_dst_lib);
} |
Windows is unfortunately unsupported anyway by Enzyme core, since MSVC dislikes Enzyme's interesting ok, then I can make a quick PR. |
Unfortunately, looks like the runtime dependency issue persists - here's the
|
Enzyme is supported on Windows -- you just have to use clang to build not msvc |
Agree there are workarounds including also e.g. WSL2, but as long as the default Rust |
If this is an MSVC-related issue, does the |
windows-gnu should work (iirc. someone confirmed it in another issue here), but please feel free to test and confirm that if you have a machine at hand. |
@marcpabst Can you test if the dependency still exists on the latest master? Since I rebased, you probably want to delete the whole folder and clone it again. https://enzyme.mit.edu/index.fcgi/rust/installation.html |
Hey, I've been having a bit of trouble cloning the repo - will give it another try tonight! |
Something is still wrong withc cloning the repos:
|
Maybe try to use https, like I do it in this PR? |
@ZuseZ4 The error is here Line 52 in ab54904
|
That's the link I posted ^^ Edit: Nevermind, my bad: https://github.com/EnzymeAD/rust/pull/166/files#diff-fe7afb5c9c916e521401d3fcfb4277d5071798c3baf83baf11d6071742823584 |
Thanks, I'll give it another go later! |
I think this issue is settled, but just noting that |
@marcpabst now that this code is partly in upstream rustc, can you please do me a favour and open an issue there (potentially linking here)? |
Hi, enzyme looks super cool, and now that it’s on its way into nightly, I’d like to play around with it a bit. I’m following the instructions in the README, but the build always errors with the following output:
Any idea how to address this? I'm on an a Macbook Pro M2
Edit: Looks like I'm not the only one with this problem: #27 (comment)
The text was updated successfully, but these errors were encountered: