2
votes

I recently started reading about Quarkus, and and followed their documentation to BUILDING A NATIVE EXECUTABLE, but got stuck with 2nd step in the prerequisites:

  • JDK 8 installed with JAVA_HOME configured appropriately

  • A working C development environment

  • GraalVM version 19.3.1 installed and configured appropriately

  • A working container runtime (Docker, podman)

    A working C development environment, check out the documentation in the link https://quarkus.io/guides/building-native-image

I'm using a windows machine and I understand the complexity of setting up the environment on it, according to what I read on the internet, I've install GCC, and the glibc and zlib headers. I was able to install GCC after a painful process, but because I'm not familiar with glibc and zlib installiation process, I kind of stuck now, This is the error I'm getting when I tried to run ./mvnw package -Pnative command :

[getting-started-1.0-SNAPSHOT-runner:22928]        setup:     539.69 ms,  1.50 GB
Error: Unable to compile C-ABI query code. Make sure native software development toolchain is installed on your system.
com.oracle.svm.core.util.UserError$UserException: Unable to compile C-ABI query code. Make sure native software development toolchain is installed on your system.
        at com.oracle.svm.core.util.UserError.abort(UserError.java:79)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.compileAndParseError(CCompilerInvoker.java:103)
        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:387)
        at com.oracle.svm.hosted.NativeImageGenerator.processNativeLibraryImports(NativeImageGenerator.java:1514)
        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)
Caused by: java.io.IOException: Cannot run program "CL" (in directory "C:\Users\xxxx\AppData\Local\Temp\SVM-xxxx"): CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.startCommand(CCompilerInvoker.java:158)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.startCompiler(CCompilerInvoker.java:140)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.compileAndParseError(CCompilerInvoker.java:71)
        ... 13 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:444)
        at java.lang.ProcessImpl.start(ProcessImpl.java:139)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 16 more
Error: Image build request failed with exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  14.150 s
[INFO] Finished at: 2020-03-16T09:56:56-05:00
2

2 Answers

2
votes

First, if you build on Windows, better use GraalVM 20 with Quarkus 1.3.0.Final as they fixed a lot of things in GraalVM 20. We released the Core last week so if you use the quarkus-bom instead of the quarkus-universe-bom, you can already use it. Otherwise, the full release will come as early as Thursday.

Next, we had someone working on contributing some notes about how to build GraalVM native executables on Windows here: https://github.com/quarkusio/quarkus/pull/7871/files .

Could you have a look at these notes, test them and provide feedback in the PR (be it if they work or not)?

0
votes

I was able to run "x86 Native Ttool Command Prompt for VC2017", and got past the native tool chain error.

But now I have a linker error. Question incoming.