Error: Unable to compile C-ABI query code. Make sure native software development toolchain is installed on your system

huangapple go评论95阅读模式
英文:

Error: Unable to compile C-ABI query code. Make sure native software development toolchain is installed on your system

问题

我最近开始阅读关于 Quarkus 的资料,并且按照他们的文档进行了构建本机可执行文件的操作,但在先决条件的第二步遇到了问题:

  • 已安装 JDK 8,并已配置适当的 JAVA_HOME
  • 一个可用的 C 开发环境
  • 已安装并适当配置 GraalVM 版本 19.3.1
  • 一个可用的容器运行时环境(Docker、podman)

关于 一个可用的 C 开发环境,请查阅以下链接的文档:https://quarkus.io/guides/building-native-image

我正在使用 Windows 机器,我理解在其上设置环境的复杂性。根据我在互联网上阅读的内容,我已经安装了 GCC,以及 glibczlib 的头文件。我已经在经历了一番痛苦的过程后成功安装了 GCC,但因为我对 glibczlib 的安装过程不太熟悉,我现在陷入了困境。当我尝试运行 ./mvnw package -Pnative 命令时,我遇到了以下错误:

[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)
        ...
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

以上是您提供的内容的翻译部分。

英文:

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

答案1

得分: 2

首先,如果你在Windows上构建,最好使用GraalVM 20与Quarkus 1.3.0.Final,因为他们在GraalVM 20中修复了很多问题。上周我们发布了Core版本,如果你使用quarkus-bom而不是quarkus-universe-bom,你已经可以使用它。否则,完整版本将在最早的周四发布。

接下来,我们有人在这里为Windows上如何构建GraalVM本机可执行文件做出了一些贡献:https://github.com/quarkusio/quarkus/pull/7871/files 。

你可以查阅这些说明,测试并在PR中提供反馈意见(无论它们是否有效)。

英文:

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)?

答案2

得分: 0

我能够运行“x86 Native Ttool Command Prompt for VC2017”,并且成功解决了本机工具链错误。

但是现在我遇到了一个链接器错误。问题即将到来。

英文:

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.

huangapple
  • 本文由 发表于 2020年3月16日 23:11:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/60708501.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定