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

how to use --target #3986

Closed
hanxiao34 opened this issue Nov 4, 2021 · 2 comments
Closed

how to use --target #3986

hanxiao34 opened this issue Nov 4, 2021 · 2 comments
Assignees

Comments

@hanxiao34
Copy link

I saw the parameter -- target. I thought it could compile software packages on different platforms on a set of environment. But when I execute -- target = windows-amd64 on Linux, it prompts

Caused by: java.nio.file.NoSuchFileException: /home/hx/graalvm/graalvm-ce-java11-21.3.0/lib/svm/clibraries/windows-amd64

and then, i copy windows-amd64 into there from window sdk and try again ,it prompts:

Error: Substitution target for com.oracle.svm.core.jdk.Target_java_io_WinNTFileSystem is not loaded. Use field onlyWith in the TargetClass annotation to make substitution only active when needed.
com.oracle.svm.core.util.UserError$UserException: Substitution target for com.oracle.svm.core.jdk.Target_java_io_WinNTFileSystem is not loaded. Use field onlyWith in the TargetClass annotation to make substitution only active when needed.
at com.oracle.svm.core.util.UserError.abort(UserError.java:73)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.findTargetClass(AnnotationSubstitutionProcessor.java:945)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleClass(AnnotationSubstitutionProcessor.java:288)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.init(AnnotationSubstitutionProcessor.java:266)
at com.oracle.svm.hosted.NativeImageGenerator.createDeclarativeSubstitutionProcessor(NativeImageGenerator.java:912)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:839)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:527)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:488)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:569)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:122)
at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:599)

@rodrigar-mx rodrigar-mx self-assigned this Nov 8, 2021
@rodrigar-mx
Copy link
Contributor

Hi @hanxiao34. Cross compilation between different OS is not possible for the moment. There is already an open issue about that #407. Possible alternatives are using VMs or docker images.
--target option is used, for example, for building native images for mobile apps in gluon project https://github.com/gluonhq/gluon-samples.

@hanxiao34
Copy link
Author

OK,tkx!

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

2 participants