I can successfully build fallback images for the NetRexx compiler on MacOS and Linux X86-64. These fulfil a need, so while I am studying building completely native executables, I will put these out.
On 64-bit Windows 10 this fails in the following way: (I verified the working of the compiler with a c program and the working of NetRexx itself on the GraalVM installation)
C:\Users\rvjansen\netrexx-code>native-image -cp build/lib/NetRexxC.jar org.netrexx.process.NetRexxC -H:+ReportExceptionStackTraces
[org.netrexx.process.netrexxc:5676] classlist: 6,648.57 ms
[org.netrexx.process.netrexxc:5676] (cap): 1,482.91 ms
[org.netrexx.process.netrexxc:5676] setup: 2,303.88 ms
Error: Error compiling query code (in C:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.cpp). Compiler command CL C:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.cpp /FeC:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.exe output included error: [Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27024.1 for x86, Copyright (C) Microsoft Corporation. All rights reserved., ]
com.oracle.svm.core.util.UserError$UserException: Error compiling query code (in C:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.cpp). Compiler command CL C:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.cpp /FeC:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.exe output included error: [Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27024.1 for x86, Copyright (C) Microsoft Corporation. All rights reserved., ]
at com.oracle.svm.core.util.UserError.abort(UserError.java:114)
at com.oracle.svm.hosted.c.NativeLibraries.reportErrors(NativeLibraries.java:218)
at com.oracle.svm.hosted.NativeImageGenerator.processNativeLibraryImports(NativeImageGenerator.java:1518)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeLibraries(NativeImageGenerator.java:1006)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:835)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:528)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error: Image build request failed with exit status 1
Can someone point me in the right direction?
Many thanks in advance.
Hi @RexxLA
The error reporting of query code compilation on Windows is only fixed on master, See:
See https://github.com/oracle/graal/issues/1675#issuecomment-578451083
Thanks! Are there nightly builds to be gotten somewhere?
Are there nightly builds to be gotten somewhere?
Yes ... https://github.com/graalvm/graalvm-ce-dev-builds/releases
Unfortunately currently, the native-image-installable-svm for Windows are missing. Likely some copy scripts need to be adjusted. I will let you know when this gets fixed.
The latest nightly builds now contain the native-image installables.
For example you can test the latest 20.0.0 nightly snapshot:
https://github.com/graalvm/graalvm-ce-dev-builds/releases/tag/20.0.0-dev-20200204_1306
ah thank you so much
Oops ... same thing (well slightly different thing because it now reports an actual C++ compile error) with this nightly build:
C:\Users\rvjansen\netrexx-code>native-image -cp build\lib\NetRexxC.jar org.netrexx.process.NetRexxC -H:+ReportExceptionStackTraces
[org.netrexx.process.netrexxc:120] classlist: 6,554.51 ms, 1.13 GB
[org.netrexx.process.netrexxc:120] (cap): 2,217.32 ms, 1.13 GB
[org.netrexx.process.netrexxc:120] setup: 4,222.35 ms, 1.13 GB
Error: Error compiling query code (in C:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.cpp). Compiler command CL C:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.cpp /FeC:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.exe output included error: [WindowsDirectives.cpp, C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(180): error C2371: 'size_t': redefinition; different basic types, predefined C++ types (compiler internal)(16): note: see declaration of 'size_t']
com.oracle.svm.core.util.UserError$UserException: Error compiling query code (in C:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.cpp). Compiler command CL C:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.cpp /FeC:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.exe output included error: [WindowsDirectives.cpp, C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(180): error C2371: 'size_t': redefinition; different basic types, predefined C++ types (compiler internal)(16): note: see declaration of 'size_t']
at com.oracle.svm.core.util.UserError.abort(UserError.java:135)
at com.oracle.svm.hosted.c.NativeLibraries.reportErrors(NativeLibraries.java:228)
at com.oracle.svm.hosted.NativeImageGenerator.processNativeLibraryImports(NativeImageGenerator.java:1515)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeLibraries(NativeImageGenerator.java:1010)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:841)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:528)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error: Image build request failed with exit status 1
@pejovica are you familiar with this issue?
@olpaw No, I haven't seen it before. But the initial error indicates that a 32-bit toolchain was used, so perhaps that is still the case.
@RexxLA Could you try with the 64-bit toolchain because 32-bit is not supported.
@RexxLA if you use a 20.1 snapshot release should get better diagnostic output (see 7444772482f520ef56c7ed29c77ee5caf2c0eb30). Please try https://github.com/graalvm/graalvm-ce-dev-builds/releases/tag/20.1.0-dev-20200208_0320 and report back which error message you get. Thanks.
@olpaw I had the same errors and after trying with 20.1.0 this is the error that I get:
[IWS_BCS_Clocking_Helper-1.0-dev:12168] classlist: 1,979.06 ms, 0.96 GB
[IWS_BCS_Clocking_Helper-1.0-dev:12168] setup: 1,070.16 ms, 0.96 GB
Error: Native-image building on Windows currently only supports target architecture: AMD64 (x86 unsupported)
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1
I don't know why it is targeting x86 or how I can force x64. I've tried both VS 2017 and VS 2019 (both Professional editions) and Windows SDK 7.1 is installed (and has support for both x86 and x64).
@olpaw By the way, is there any chance you'll remove the dependency on Windows SDK 7.1 and move to something more recent with support for Windows 10? The install process is a pain.
@olpaw By the way, is there any chance you'll remove the dependency on Windows SDK 7.1 and move to something more recent with support for Windows 10? The install process is a pain.
For Java 8 we cannot move to a more recent native-toolchain because the static jdk libs that we are using there are built with that old toolchain. For GraalVM Java 11 version you can use Visual Studio 2015 version 14.0 or later (C/C++ Optimizing Compiler Version 19.* or later).
@olpaw By the way, is there any chance you'll remove the dependency on Windows SDK 7.1 and move to something more recent with support for Windows 10? The install process is a pain.
For Java 8 we cannot move to a more recent native-toolchain because the static jdk libs that we are using there are built with that old toolchain. For GraalVM Java 11 version you can use Visual Studio 2015 version 14.0 or later (C/C++ Optimizing Compiler Version 19.* or later).
Oh, so Windows SDK 7.1 is not needed for the Java 11 version. That is good.
The error above is given by the Java 11 version, by the way.
I don't know why it is targeting x86 or how I can force x64. I've tried both VS 2017 and VS 2019 (both Professional editions) and Windows SDK 7.1 is installed (and has support for both x86 and x64).
Sounds like you are using the wrong developer prompt. You need to run from
x64 Native Tools Command Prompt for VS 2019

My bad, I was using the Developer Command Prompt. It's working now, but I'm having an unsupported feature error. I start another issue about it.
I don't know why it is targeting x86 or how I can force x64. I've tried both VS 2017 and VS 2019 (both Professional editions) and Windows SDK 7.1 is installed (and has support for both x86 and x64).
Sounds like you are using the wrong developer prompt. You need to run from
x64 Native Tools Command Prompt for VS 2019
thanks! nice answer
Most helpful comment