Hello, folks!
maropu / lljvm-translator Goto Github PK
View Code? Open in Web Editor NEWA lightweight library to inject LLVM bitcode into JVMs
License: Apache License 2.0
A lightweight library to inject LLVM bitcode into JVMs
License: Apache License 2.0
[WARNING] Expected all dependencies to require Scala version: 2.11.8
[WARNING] io.github.maropu:lljvm-core:0.3.0-EXPERIMENTAL requires scala version: 2.11.8
[WARNING] org.scalatest:scalatest_2.11:3.0.3 requires scala version: 2.11.8
[WARNING] org.scalactic:scalactic_2.11:3.0.3 requires scala version: 2.11.8
[WARNING] org.scala-lang:scala-reflect:2.11.8 requires scala version: 2.11.8
[WARNING] org.scala-lang.modules:scala-xml_2.11:1.0.5 requires scala version: 2.11.7
[WARNING] Multiple versions of scala libraries detected!
[INFO] Using zinc server for incremental compilation
[info] 'compiler-interface' not yet compiled for Scala 2.11.8. Compiling...
error: scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
at scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:102)
at scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:105)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:257)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:257)
at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1394)
at scala.tools.nsc.Global$Run.<init>(Global.scala:1215)
at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
at scala.tools.nsc.Driver.process(Driver.scala:51)
at scala.tools.nsc.Main.process(Main.scala)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at sbt.compiler.RawCompiler.apply(RawCompiler.scala:33)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:159)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:155)
at sbt.IO$.withTemporaryDirectory(IO.scala:358)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:155)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:152)
at sbt.IO$.withTemporaryDirectory(IO.scala:358)
at sbt.compiler.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:152)
at sbt.compiler.IC$.compileInterfaceJar(IncrementalCompiler.scala:58)
at com.typesafe.zinc.Compiler$.compilerInterface(Compiler.scala:154)
at com.typesafe.zinc.Compiler$.create(Compiler.scala:55)
at com.typesafe.zinc.Compiler$$anonfun$apply$1.apply(Compiler.scala:42)
at com.typesafe.zinc.Compiler$$anonfun$apply$1.apply(Compiler.scala:42)
at com.typesafe.zinc.Cache.get(Cache.scala:41)
at com.typesafe.zinc.Compiler$.apply(Compiler.scala:42)
at com.typesafe.zinc.Main$.run(Main.scala:96)
at com.typesafe.zinc.Nailgun$.zinc(Nailgun.scala:95)
at com.typesafe.zinc.Nailgun$.nailMain(Nailgun.scala:84)
at com.typesafe.zinc.Nailgun.nailMain(Nailgun.scala)
at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.martiansoftware.nailgun.NGSession.run(NGSession.java:280)
[error] Compile failed at Dec 9, 2019, 4:35:51 PM [0.668s]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] LLJVM Translator Parent POM ........................ SUCCESS [ 0.704 s]
[INFO] LLJVM Core ......................................... FAILURE [ 1.729 s]
[INFO] C Extension for LLJVM .............................. SKIPPED
[INFO] Python Extension for LLJVM ......................... SKIPPED
[INFO] LLJVM Benchmark .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.597 s
[INFO] Finished at: 2019-12-09T16:35:51+08:00
[INFO] Final Memory: 25M/1566M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile (scala-compile-first) on project lljvm-core: Execution scala-compile-first of goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile failed.: CompileFailed -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :lljvm-core
e.g.,
val clazz = LLJVMClassLoader.loadClassFromBytecode(
className = "GeneratedClass",
bitcode = PythonFunc.compile(
s"""def pyfunc(x, y):
| return x + y
"""
))
...
message:
io.github.maropu.lljvm.LLJVMRuntimeException: Package(GeneratedClass20180731HMKjwzxmew) not supported
at io.github.maropu.lljvm.util.analysis.SupportedMethodPackages.checkIfPackageSupported(SupportedMethodPackages.java:42)
at io.github.maropu.lljvm.util.analysis.BytecodeVerifier$SupportedBytecodeChecker$1.visitMethodInsn(BytecodeVerifier.java:144)
at org.objectweb.asm.ClassReader.readCode(ClassReader.java:2211)
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1274)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:679)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:391)
at io.github.maropu.lljvm.util.analysis.BytecodeVerifier.checkIfBytecodeSupported(BytecodeVerifier.java:86)
at io.github.maropu.lljvm.util.analysis.BytecodeVerifier.verify(BytecodeVerifier.java:44)
at io.github.maropu.lljvm.util.JVMAssembler.doCompile(JVMAssembler.java:73)
at io.github.maropu.lljvm.util.JVMAssembler.compile(JVMAssembler.java:47)
at io.github.maropu.lljvm.LLJVMTranslator.main(LLJVMTranslator.java:61)
clang version:
$ ../clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-18.04/bin/clang --version
clang version 7.0.1 (tags/RELEASE_701/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yansendao/opensource/llvm-all/lljvm-translator/../clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-18.04/bin
Is there any way to set it up so that other languages can call out to arbitrary java classes/methods? Something ugly (like the array example in readme) is okay, so long as you can create idiomatic wrappers around the ugly interfaces. (this is common with FFIs anyway)
- boolean *** FAILED ***
io.github.maropu.lljvm.LLJVMRuntimeException: Java array addressing is not supported in Unknown 64-bit Java Runtime (vendor=AdoptOpenJDK)
at io.github.maropu.lljvm.util.ArrayUtils._addressOf(ArrayUtils.java:70)
at io.github.maropu.lljvm.util.ArrayUtils.addressOf(ArrayUtils.java:92)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$1.apply$mcV$sp(ArrayUtilsSuite.scala:27)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$1.apply(ArrayUtilsSuite.scala:25)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$1.apply(ArrayUtilsSuite.scala:25)
at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
at org.scalatest.Transformer.apply(Transformer.scala:22)
at org.scalatest.Transformer.apply(Transformer.scala:20)
at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:186)
...
- byte *** FAILED ***
io.github.maropu.lljvm.LLJVMRuntimeException: Java array addressing is not supported in Unknown 64-bit Java Runtime (vendor=AdoptOpenJDK)
at io.github.maropu.lljvm.util.ArrayUtils._addressOf(ArrayUtils.java:70)
at io.github.maropu.lljvm.util.ArrayUtils.addressOf(ArrayUtils.java:96)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$2.apply$mcV$sp(ArrayUtilsSuite.scala:35)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$2.apply(ArrayUtilsSuite.scala:33)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$2.apply(ArrayUtilsSuite.scala:33)
at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
at org.scalatest.Transformer.apply(Transformer.scala:22)
at org.scalatest.Transformer.apply(Transformer.scala:20)
at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:186)
...
- short *** FAILED ***
io.github.maropu.lljvm.LLJVMRuntimeException: Java array addressing is not supported in Unknown 64-bit Java Runtime (vendor=AdoptOpenJDK)
at io.github.maropu.lljvm.util.ArrayUtils._addressOf(ArrayUtils.java:70)
at io.github.maropu.lljvm.util.ArrayUtils.addressOf(ArrayUtils.java:100)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$3.apply$mcV$sp(ArrayUtilsSuite.scala:43)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$3.apply(ArrayUtilsSuite.scala:41)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$3.apply(ArrayUtilsSuite.scala:41)
at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
at org.scalatest.Transformer.apply(Transformer.scala:22)
at org.scalatest.Transformer.apply(Transformer.scala:20)
at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:186)
...
- int *** FAILED ***
io.github.maropu.lljvm.LLJVMRuntimeException: Java array addressing is not supported in Unknown 64-bit Java Runtime (vendor=AdoptOpenJDK)
at io.github.maropu.lljvm.util.ArrayUtils._addressOf(ArrayUtils.java:70)
at io.github.maropu.lljvm.util.ArrayUtils.addressOf(ArrayUtils.java:104)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$4.apply$mcV$sp(ArrayUtilsSuite.scala:51)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$4.apply(ArrayUtilsSuite.scala:49)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$4.apply(ArrayUtilsSuite.scala:49)
at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
at org.scalatest.Transformer.apply(Transformer.scala:22)
at org.scalatest.Transformer.apply(Transformer.scala:20)
at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:186)
...
- long *** FAILED ***
io.github.maropu.lljvm.LLJVMRuntimeException: Java array addressing is not supported in Unknown 64-bit Java Runtime (vendor=AdoptOpenJDK)
at io.github.maropu.lljvm.util.ArrayUtils._addressOf(ArrayUtils.java:70)
at io.github.maropu.lljvm.util.ArrayUtils.addressOf(ArrayUtils.java:108)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$5.apply$mcV$sp(ArrayUtilsSuite.scala:59)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$5.apply(ArrayUtilsSuite.scala:57)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$5.apply(ArrayUtilsSuite.scala:57)
at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
at org.scalatest.Transformer.apply(Transformer.scala:22)
at org.scalatest.Transformer.apply(Transformer.scala:20)
at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:186)
...
- float *** FAILED ***
io.github.maropu.lljvm.LLJVMRuntimeException: Java array addressing is not supported in Unknown 64-bit Java Runtime (vendor=AdoptOpenJDK)
at io.github.maropu.lljvm.util.ArrayUtils._addressOf(ArrayUtils.java:70)
at io.github.maropu.lljvm.util.ArrayUtils.addressOf(ArrayUtils.java:112)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$7.apply$mcV$sp(ArrayUtilsSuite.scala:67)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$7.apply(ArrayUtilsSuite.scala:65)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$7.apply(ArrayUtilsSuite.scala:65)
at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
at org.scalatest.Transformer.apply(Transformer.scala:22)
at org.scalatest.Transformer.apply(Transformer.scala:20)
at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:186)
...
- double *** FAILED ***
io.github.maropu.lljvm.LLJVMRuntimeException: Java array addressing is not supported in Unknown 64-bit Java Runtime (vendor=AdoptOpenJDK)
at io.github.maropu.lljvm.util.ArrayUtils._addressOf(ArrayUtils.java:70)
at io.github.maropu.lljvm.util.ArrayUtils.addressOf(ArrayUtils.java:116)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$9.apply$mcV$sp(ArrayUtilsSuite.scala:75)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$9.apply(ArrayUtilsSuite.scala:73)
at io.github.maropu.lljvm.ArrayUtilsSuite$$anonfun$9.apply(ArrayUtilsSuite.scala:73)
at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
at org.scalatest.Transformer.apply(Transformer.scala:22)
at org.scalatest.Transformer.apply(Transformer.scala:20)
at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:186)
...
Run completed in 3 seconds, 736 milliseconds.
Total number of tests run: 101
Suites: completed 13, aborted 0
Tests: succeeded 80, failed 21, canceled 0, ignored 3, pending 0
*** 21 TESTS FAILED ***
jdk version:
$ java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)
$ ./bin/lljvm-translator lang.bc
/home/1828_sandbox/src/github.com-maropu-lljvm-translator/lljvm-translator-master/bin/../target/lljvm-core_0.3.0-EXPERIMENTAL-with-dependencies.jar not found, so use pre-compiled /home/1828_sandbox/src/github.com-maropu-lljvm-translator/lljvm-translator-master/bin/../assembly/lljvm-core_0.3.0-EXPERIMENTAL-with-dependencies.jar
io.github.maropu.lljvm.LLJVMRuntimeException: Unsupported types in alloca: Type=StructTyID
at io.github.maropu.lljvm.LLJVMNative.throwException(LLJVMNative.java:65)
at io.github.maropu.lljvm.LLJVMNative.asJVMAssemblyCode(Native Method)
at io.github.maropu.lljvm.LLJVMTranslator.main(LLJVMTranslator.java:50)
Upgraded LLVM from 5.0.2 to 7.0.0, so we need to update the binary for Linux/x86_64: 61050ec
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.