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

Windows 10, simple hello world program fails #1921

Open
jeanlaroche opened this issue Nov 16, 2021 · 9 comments
Open

Windows 10, simple hello world program fails #1921

jeanlaroche opened this issue Nov 16, 2021 · 9 comments

Comments

@jeanlaroche
Copy link
Contributor

jeanlaroche commented Nov 16, 2021

Windows10, trying to compile with pythran:

#pythran export test()
def test():
    print("hey")

https://pastebin.com/EzRQJAAK

@serge-sans-paille
Copy link
Owner

This looks very similar to scikit-image/scikit-image#3226 (comment)

@jeanlaroche
Copy link
Contributor Author

OK, I was able to fix the issue. The problem arises form the fact that by default, clang-cl.exe is the 32 bit version (or at least, was on my system). If I change my path so the default clang-cl.exe is the 64 bit version, compilation and linking run without any problem.
So, what works for my system:

  • install clang the microsoft visual studio way, (there is an option to install clang when you install visual studio, and I believe that's the recommended way to install clang)
  • Make sure your path is setup so clang-cl.exe is the 64 bit version of clang, not the 32 bit version.

I think this should probably be added to the documentation somewhere, right?

@serge-sans-paille
Copy link
Owner

@jeanlaroche I would be very happy if you updated the documentation, yes ;-)

@AndrewUshakov
Copy link

AndrewUshakov commented Dec 6, 2021

@serge-sans-paille I solved this issue by defining full path to clang-cl.exe in the file .pythranrc but had to use short legacy names to avoid spaces in the path:

[compiler]
CC=C:\PROGRA~2\MIB055~1\2019\BUILDT~1\VC\Tools\Llvm\x64\bin\clang-cl.exe
CXX=C:\PROGRA~2\MIB055~1\2019\BUILDT~1\VC\Tools\Llvm\x64\bin\clang-cl.exe

I tried to use both types of quotes for the usual long path, but generated call was not valid.

@serge-sans-paille
Copy link
Owner

@AndrewUshakov hell that's ugly :-) We should support quote there as we already did in 7fc75bb . I'll implement that.

@serge-sans-paille
Copy link
Owner

@AndrewUshakov on Linux, just the anme with spaces and no quotes works fine. Are you telling me that

[compiler]
CC=C:\Some Path\With Spaces

doesn't work?

@AndrewUshakov
Copy link

@serge-sans-paille If use quotes, output to console looks like:
E: error: Command "'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\Llvm\x64\bin\clang-cl.exe' ... failed with exit status 127

Without quotes, all is Ok, Sorry. Probably I did something wrong yesterday.

@jeanlaroche
Copy link
Contributor Author

@jeanlaroche I would be very happy if you updated the documentation, yes ;-)

Where in the doc should I add that? I tried to find mentions of windows in docs, but couldn't find anything. Simply in MANUAL.rst?

@jeanlaroche
Copy link
Contributor Author

An update on this. With the latest version of pythran. On windows10, pythran uses clang-cl by default, which is good. But the linker it uses is still

Executing "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\link.exe"

which I don't think is right. I'm getting lots of linking errors as a result.
I don't know how to fix that as I can't specify the linker in the config file (or can I?)

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

No branches or pull requests

3 participants