-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
WIP: meson on windows (clang-cl.exe) #246
Conversation
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
Yup, seems that meson doesn't now
@isuruf wanted to keep the name as-is for now. Given the indications that upstream flang will do the rename to Otherwise, I'd be fine with renaming |
This is necessary if you have multiple compilers installed and you need to use a specific one and ensure the wrong one isn't used. ;) In this case it will just let you detect a compiler you might not otherwise have found at all. This does also assume that meson knows how to identify it based on the I would prefer to avoid adding probes for an experimental-only name, but if it still doesn't work after overriding the compiler name then I'd be happy to help get that working. |
Thanks for the super quick response! 🙏 |
This is gonna be a whack-a-mole for a while I think 🙈
I have to admit that the interplay between MSVC, clang & flang here is something that still confuses me.
scipy-feedstock/recipe/build-output.bat Lines 57 to 59 in 3a08a18
AFAICT that means we're doing compilation with clang, but linkage with MSVC's linker? Not sure how I'd be able to tell meson to check that, much less in a syntax that flang understands. Sidenote: If it helps, I have no issues to switch the linker over to lld, that should at least be the same stack as clang/flang. |
@eli-schwartz, could you maybe share your thoughts how it'd be best to proceed here from your POV? :) |
This reverts commit 8370005.
…nda-forge-pinning 2023.09.13.19.41.36
2028591
to
fc6ce51
Compare
OK, using clang1 as the main compiler on windows allows us to get past the linker check and start compiling. However, we hit a problem pretty immediately:
strdup should be in the Looking at the last successful build with MSVC for windows for that lib, we see that it's linking to:
So it looks like something about the "sysroot" isn't working for our clang-on-win... @conda-forge/clang-win-activation Footnotes
|
7d4bc48
to
8ba8310
Compare
Beyond the setup questions about So I guess I'll retry building flang for osx-64, there at least we'd be able to test the clang+flang combo. And beyond that, I can see what happens with GCC+flang on linux here... |
05d338d
to
5e5df36
Compare
Not sure what's happening, but I doubt the GCC+flang combination is well-supported, or even supported at all:
|
That looks suspiciously like something was supposed to normalize paths but is actually chopping off the |
6d4036b
to
91f355f
Compare
otherwise, we're calling `shutil.which()` on the literal string "%PREFIX%\Library\bin\lld-link.exe", which unsurprisingly fails.
I think this might be the root of the issues here. Even when I try to work around the non-functional linker detection for flang on windows by setting
This probably explains why the syntax for the linker is not the right one, and all the problems that follow from that. I haven't managed to fully dig through the list of class inheritance to understand where the linker detection happens for flang, but if I understand the code for
Somehow, on clang things work (and lld-link) is picked up, not sure where the respective code is. If I set a full path like or
I'll try overriding |
See also the
On Unix, only the latter exists. You can technically invoke
It looks for it first in the compiler version output, and in such a case handles the linker as llvm/clang-cl and expects the compiler itself to act as the driver. If that fails, and guess_win_linker is invoked with |
I think I see the issue now. |
Woohoo 🥳
|
Ah, the joy was shortlived. Now we have the rsp issue also for flang:
|
Aaaaand marking rsp as unsupported for lld-link still triggers the same:
😑 |
From the meson logs:
It looks like this affects regular C compilation as well:
Could it be that we have to adapt the activation for windows to use Similarly, flang ignores
resp. bails when it's done through
What are your thoughts on dealing with this? Can we get away without using PS. I raised this a while ago upstream |
OK, it does seem to work with a ridiculously high threshold (used 320'000 instead of 32'000). That means we passed the first build & install! 🥳 |
🚀 🎉 |
I want to say "it's finally happening", but it'll probably still be a decent chunk of work to get this off the ground...
At least we got conda-forge/flang-feedstock#28 in now. However, the binary is still named
flang-new
, not sure if meson can deal with this yet (upstream naming discussion in LLVM has more details; last blocker for rename has an RFC already...).Then there's the question of mixing msvc, clang & flang, etc. etc...