内容简介:I've only tested on mac.ModifyThanks sogaiu for helping me get this working. :)
clojure calling c -- compiled to a binary with native-image
Prerequisites
-
graalvm -- tested with
graalvm-ce-java11-20.2.0-dev: https://github.com/graalvm/graalvm-ce-dev-builds/releasesexport GRAALVM_HOME = "/path/to/graalvm-ce-java11-20.2.0-dev/Contents/Home/" export JAVA_HOME = $GRAALVM_HOME
-
install native-image:
$GRAALVM_HOME/bin/gu install native-image(will be installed by./compileotherwise) - leiningen -- https://leiningen.org/
I've only tested on mac.
Steps
Modify src/Headers.java
, specifically: /Users/test/programmering/clojure/graal-native-interaction/graal/src/triple.h
needs to point to your src/triple.h
.
$ make clean CFiles && ./compile && ./woop 1 # this value comes from a c-struct!
Acknowledgements
- Java code from: https://github.com/cornerwings/graal-native-interaction
- Project setup for clojure / native compilation from: https://github.com/borkdude/clj-kondo
Thanks sogaiu for helping me get this working. :)
以上所述就是小编给大家介绍的《Call C from Clojure using GraalVM - then compile a binary using native-image》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
自己动手做iOS App
张子怡 / 电子工业出版社 / 2017-8 / 69.00
《自己动手做iOS App:从设计开发到上架App Store》为想要接触iOS 应用设计、开发的读者提供了由浅入深的详细指导。从iOS 应用制作的步骤是什么,应该使用什么软件,如何发布应用到App Store,到iOS 的设计理念是什么,如何正确书写Swift 语言,再到后端和客户端是如何交互运作的等,本书配合图示,精辟、直观地阐明了iOS 应用制作中的种种疑问。 如果你是一位第一次接触i......一起来看看 《自己动手做iOS App》 这本书的介绍吧!