-
Notifications
You must be signed in to change notification settings - Fork 549
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
Installing clang in Windows #8015
Comments
What do you expect to happen? On Linux, outside of our build of clang, I get % clang
clang-16: error: no input files
% echo $?
1 If you don't pass any arguments you always get an error. Try at least to pass
|
Thank you for pointing this out.
|
Ok, the error is the same, code is
According to the Internet ™️ Perhaps the question is: what do you want to do with |
Perhaps this needs to be filed with Clang.jl. |
@ViralBShah I disagree. I have need of direct calling Clang on Windows as well, although I haven't yet tested it |
What I want to do with clang is to compile. My aim is to adapt StaticCompiler to Windows. What clang in this adaotion does is to generate an executable binary from a LLVM IR. |
Ok, that's great, but someone has to figure out what the problem is, and then how to fix it. |
Well, yes, this is the reason why I posted it here: I hoped, someone would have a hint to find the problem and fix it. |
As a matter of fact very few people here around use Windows, so for debugging of Windows-related issues there's a high chance you're on your own. I know people in the past have had some degrees of luck using tools like |
Just running If one clicks "OK" the same error message comes up again, just for different dlls, namely the following ones: On Julia nightly I just get the same error about |
You need to read https://docs.binarybuilder.org/stable/jll/#ExecutableProduct |
@giordano I don't understand what you mean. Can you explain what exactly you are pointing to? |
If you're asking me about #8015 (comment), that was a reply to the immediately preceding message. |
I still don't know what exactly you want to tell by pointing to the description of ExecutableProduct. E.g. What do you think one should pay attention to, or, what is missing? |
I wasn't replying to you, I was telling David that the specific issue he was having was due to not calling the executable product correctly, which is something you were doing already. |
I can get it working on Julia nightly with a little hack to the PATH, not sure why it's failing on earlier versions of Julia. julia> using Clang_jll;
julia> tmp = `$(clang()) --version`;
julia> tmp.env[2] *= ";" * joinpath(joinpath(splitpath(clang().exec[1])[1:end-2]), "bin");
julia> run(tmp)
clang version 17.0.6 (/cache/yggdrasil/downloads/clones/llvm-project.git-5a9787eb535c2edc5dea030cc221c1d60f38c9f42344f410e425ea2139e233aa 0007e48608221f440dce2ea0d3e4f561fc10d3c6)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:\Users\gag\.julia\artifacts\a49b93cab2267cf26cc941887b119c308d7f71e3\tools A minimal PATH is julia> run(setenv(`$(clang()) --version`, "PATH"=>joinpath(joinpath(splitpath(clang().exec[1])[1:end-2]), "bin") * ";C:\\Users\\gag\\.julia\\juliaup\\julia-nightly\\bin"))
clang version 17.0.6 (/cache/yggdrasil/downloads/clones/llvm-project.git-5a9787eb535c2edc5dea030cc221c1d60f38c9f42344f410e425ea2139e233aa 0007e48608221f440dce2ea0d3e4f561fc10d3c6)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:\Users\gag\.julia\artifacts\a49b93cab2267cf26cc941887b119c308d7f71e3\tools
Process(setenv(`'C:\Users\gag\.julia\artifacts\a49b93cab2267cf26cc941887b119c308d7f71e3\tools\clang.exe' --version`,["PATH=C:\\Users\\gag\\.julia\\artifacts\\a49b93cab2267cf26cc941887b119c308d7f71e3\\bin;C:\\Users\\gag\\.julia\\juliaup\\julia-nightly\\bin"]), ProcessExited(0)) |
Thank you! This seems to be very promising. I tried the lines, and the environment is extended by the right bin-directory. Unfortunately I get the same error as above. |
Are you testing on Julia nightly? It's been working multiple times for me even with llvm 18 and LLC. |
I tried with julia nightly and adapting PATH as described, but I get the same error.
|
Which nightly version did you use? |
Presumably what ever was the latest 2 weeks ago, I'll try and get round to checking on a newer version. |
I called clang with help of the following code:
Then I get the following error:
The text was updated successfully, but these errors were encountered: