-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unable to compile C-ABI query code #1258
Comments
Hi @tsatatwer The error message is misleading in this case. Our Windows support is still early days and the message claims that you have to install GCC. This is not the case for Windows. Instead you need to have Windows SDK for Windows 7 installed and you need to run from the |
Thanks for the fast replay . |
@olpaw , |
Hi, thanks for the information. After installing Windows SDK for Windows 7 (the x64 version), I got further along, but below is the problem I'm still having. I suspect the wrong C++ compiler may be in my path, but I'm not quite sure. Any suggestions are welcome!
|
Hi @philwalk, |
Hi @olpaw I tried to build our client jar to a shared library on Windows 7 with the SDK you mentioned above, some symbols are missing in the last step.
Error: Image build request failed with exit status 1 I checked the graalvm SDK, the symbols can be found in${graalvm_sdk_dir}/jre/bin/sunec.dll and sunmscapi.dll. These two files do not have .lib file and are not linked. |
@tsatatwer The issue @philwalk and I have is caused by missing of sunec.lib and sunmscapi.lib from graalvm SDK. They should included as "ffi.lib |
We do not provide static libs for sunec or sunmscapi on any supported platform. Regarding Security Services the same rules apply as on other platforms. See https://github.com/oracle/graal/blob/master/substratevm/JCA-SECURITY-SERVICES.md#native-implementations |
I ran into lot of errors while installing Windows SDK 7.1 and found a useful link given below. It worked flawlessely for me. |
@borkdude, was fighting the same war last night, had to change registry entries ( + grant full control to myself for those entries ... ). A bit of nightmare before I managed to install SDK, plus I uninstalled some newer .net/c++ stuff. See |
@rsvoboda confirmed that worked |
As the mentioned document requires, native-image --shared -H:Path=.\build ^
-H:ReflectionConfigurationFiles=.\reflection_config.json ^
-H:Name=rocketmq_graalvm ^
-jar .\rocketmq-client-cpp-full.jar ^
-Dio.netty.noUnsafe=true ^
-Djava.library.path=C:\soft\graalvm-ce-19.0.0\jre\bin ^
--report-unsupported-elements-at-runtime ^
--allow-incomplete-classpath ^
-H:+ReportExceptionStackTraces ^
--enable-all-security-services ^
--enable-url-protocols=https ^
-H:+PrintClassInitialization ^
--initialize-at-build-time ^
--initialize-at-run-time=RUN_TIME_CLASS_LIST Native-image command fails on the "generate image step". |
Hi @lizhanhui, |
This is still within the first hits at Google. A quick fix is following chocolatey command:
Afterwards (in
Then, one can execute native-image.cmd |
It may caused by not load .lib file public void beforeAnalysis(BeforeAnalysisAccess access) { it stop ec problem ,but mscapi.lib file not found . tested windows 7 amd64, graalvm 19.2.1 can you add those .lib files |
@olpaw probably stupid question, but could native-image be made to work with newer versions of the Windows SDK? The 7.1 version is a major pain to install on newer systems... |
@nightscape yes of course. There is nothing from Windows API that prevents us to build with later versions of Windows SDK. @pejovica please fill in the details. Also how the situation will be with the upcoming 19.3 release for 8 & 11. |
Great! Hopefully that will allow building Windows native images in GitHub Actions. (Currently cannot install windows-sdk-7.1) |
@remkop We were able to get windows native images to build in Github Actions using docker. It's definitely slow, but it works. We based our docker image on a cached version of servercore that is installed on Github-hosted runners. Here's how we did it: |
@remkop FWIW I have an appveyor running that also builds Windows natives, although the main problem with that is that I cannot redistribute this binary because it depends on external dlls: https://ci.appveyor.com/project/borkdude/clj-kondo |
@mcred Thanks for the Docker links! I will give that a try. @borkdude Yes, I have been able to build Windows native images in AppVeyor and in TravisCI, but not yet in GitHub Actions. About the DLL dependency: the latest news on getting rid of the dependency on msvcr100.dll is not good, unfortunately... :-( |
@nightscape GraalVM builds are based on the supported build platforms used by the corresponding JDKs, see https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms. 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. This means that on JDK 11 you should be able to use any newer compatible MSVC compiler, see https://docs.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?view=vs-2019. |
I had the "opportunity" to go through a setup process for building with the Java 8 based native-image on a Windows 10 VM recently. It came about that it wasn't necessary to use the registry key tweaking method described above. The gist is that for the Java 8 based GraalVM, it appears that after attempting an installation of Windows SDK 7.1, installing Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1 is suffcient. (I am uncertain if the "uninstall Visual C++ 2010 Redistributables before attempting installation" tip in the useful StackOverflow post is necessary. For the record, I did not perform that step, but that was because I didn't notice any such thing already installed.) |
Hi! Windows SDK installed This happens when the maven-command 'package' is run. part of the logs with an error from the IDEA terminal.: [example:6396] classlist: 4,331.29 ms |
I can't install the older SDKs / older C++ stuff. I'm on WIndows 10 and need all the newest .NET / VC++ / SDKS for work. Does this mean I won't be able to use native-image without firing up an old W7 VM? |
@stuartstein777 why don't you use GraalVM for Java 11? There you can use Visual Studio 2015 version 14.0 or later. The requirement to use Windows SDK 7.1 only exists for GraalVM for Java 8. See: Line 144 in e5226bc
|
@olpaw in my circumstances, JDK 11 based GraalVM versions fails does to some weird errors like |
@IvanLuchkin That does not sound like it's related to native tool chain detection / use. |
Hi ,
I am testing windows GraalVM Community Edition 19.0.0 native-image , I got this error:
Error: Unable to compile C-ABI query code. Make sure GCC toolchain is installed on your system. com.oracle.svm.core.util.UserError$UserException: Unable to compile C-ABI query code. Make sure GCC toolchain is installed on your system. at com.oracle.svm.core.util.UserError.abort(UserError.java:65) at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.compileAndParseError(CCompilerInvoker.java:87) at com.oracle.svm.hosted.c.CAnnotationProcessor.compileQueryCode(CAnnotationProcessor.java:131) at com.oracle.svm.hosted.c.CAnnotationProcessor.process(CAnnotationProcessor.java:84) at com.oracle.svm.hosted.c.NativeLibraries.finish(NativeLibraries.java:311) at com.oracle.svm.hosted.NativeImageGenerator.processNativeLibraryImports(NativeImageGenerator.java:1523) at com.oracle.svm.hosted.NativeImageGenerator.setupNativeLibraries(NativeImageGenerator.java:997) at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:829) at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:521) at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:441) 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
The text was updated successfully, but these errors were encountered: