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

[native-image] Document the prerequisites for native-image on Windows #1852

Closed
remkop opened this issue Nov 21, 2019 · 12 comments
Closed

[native-image] Document the prerequisites for native-image on Windows #1852

remkop opened this issue Nov 21, 2019 · 12 comments
Assignees

Comments

@remkop
Copy link

remkop commented Nov 21, 2019

The documentation should be updated to clarify the prerequisites for building Windows native images with GraalVM 19.3.

Comments on this ticket indicate that Visual Studio 2017 is required for the Java 11 version of GraalVM 19.3. Is this correct?

With GraalVM 19.2 and older, which were were JDK 8 based, Windows SDK 7.1. with the 2010 Visual C++ Compilers (from KB2519277) were required. Is this still the case for the Java 8 version of GraalVM 19.3?

Update: The more exact version numbers mentioned in this ticket are also useful:

(...) So the plan for the upcoming 19.3 release is to have a JDK 8 based build with MSVC 2010 SP1, and a JDK 11 based build with MSVC 2017 15.5.5.


It may also be good to provide detailed instructions. For GraalVM 19.2 and older, the following steps were needed to set up:

  1. Install Windows SDK 7.1 and C++ Compilers from KB2519277
choco install windows-sdk-7.1 kb2519277
  1. From the cmd prompt, activate the sdk-7.1 environment:
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"

With GraalVM 19.2, people had issues getting set up until this was clarified. It would be good to have similar steps for GraalVM 19.3.

@borkdude
Copy link

Another question: what should be installed to prevent this error when turning on SSL support in Windows?

LINK : fatal error LNK1181: cannot open input file 'stdc++.lib'

@sogaiu
Copy link

sogaiu commented Nov 23, 2019

Here is a link to a repository with a reproduction:

https://github.com/sogaiu/stdcpp-link-error

Should I make another issue?

#1876

@remkop
Copy link
Author

remkop commented Nov 28, 2019

Note: #1886 has some details for preparing Command Prompt and PowerShell to use graalvm-java11-19.3.0 native-image with Visual Studio 2019.

@remkop
Copy link
Author

remkop commented Nov 30, 2019

To create a native image on Windows with GraalVM 19.3 for Java 11, install Visual Studio 2017 (making sure to include Visual C++ compilers and libraries for ARM64 and Visual C++ tools for CMake). After installation, set up the environment from a Command Prompt with this command:

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"

Then run native-image in that Command Prompt windows.

@sogaiu
Copy link

sogaiu commented Nov 30, 2019

Thanks a lot for this update.

@sogaiu
Copy link

sogaiu commented Jan 10, 2020

For automating in the case of GraalVM 19.3.x with Java 11, the following chocolatey invocation may come in handy:

choco install -y visualstudio2017community --no-progress --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.CMake.Project"

I originally used the --version argument, but it appears older versions don't stick around, so I removed it.

@remkop
Copy link
Author

remkop commented Jan 10, 2020

This worked well for me for GraalVM 19.3+ with Java 11:

choco install visualstudio2017-workload-vctools

After installation, set up the environment from the cmd prompt with this command:

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"

@sogaiu
Copy link

sogaiu commented Jan 10, 2020

That looks nicer -- may give that a try next time around.

Thanks for sharing!

@famod
Copy link

famod commented Jan 27, 2020

Thanks for sharing the choco command!

Is anyone getting unistd.h errors with this setup (see #1675)?

@olyagpl
Copy link
Member

olyagpl commented Apr 15, 2020

We have included the prerequisites for using Native Image on Windows platform for both Java 11 and Java 8 GraalVM builds: https://www.graalvm.org/docs/reference-manual/native-image/#prerequisites
Thank you for sharing user experience!

@borkdude
Copy link

Thanks!

@SuperStarDeveloper
Copy link

Hello remkop.

now i have installed windows SDK 7.1 for GraalVM, but I face an issue.
https://prnt.sc/GYTuq2Q0odyO I am not sure how to fix it. I have confirmed about windows SDK 7.1 installation with your method. if you have an experience with it. please give me advice.

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

7 participants