ashleyj / aura

11 stars 1 forks source link

Compiling jar with aura fails #15

Closed Zubnix closed 8 years ago

Zubnix commented 8 years ago

Trying to compile an existing java jar with aura fails with error (I used the instructions in the wiki): Exception in thread "main" java.lang.UnsatisfiedLinkError: Native library for linux-x86_64 not found at aura.llvm.NativeLibrary.load(NativeLibrary.java:72) at aura.llvm.binding.LLVMJNI.(LLVMJNI.java:804) at aura.llvm.binding.LLVM.getLlvmHostTriple(LLVM.java:3103) at aura.llvm.Target.(Target.java:36) at aura.compiler.config.OS.getDefaultOS(OS.java:55) at aura.compiler.target.ConsoleTarget.init(ConsoleTarget.java:93) at aura.compiler.config.Config.build(Config.java:811) at aura.compiler.config.ConfigBuilder.build(ConfigBuilder.java:402) at aura.compiler.AppCompiler.main(AppCompiler.java:410)

Zubnix commented 8 years ago

when trying to compile the 'llvm' native build, using the provided 'build.sh', I get the following error:

[ 55%] Performing patch step for 'extllvm'
patching file lib/DebugInfo/DWARFContext.cpp
patching file lib/CodeGen/LexicalScopes.cpp
patching file lib/CodeGen/AsmPrinter/DwarfDebug.cpp
patching file lib/CodeGen/AsmPrinter/AsmPrinter.cpp
patching file lib/Target/AArch64/AArch64FrameLowering.cpp
patching file lib/Target/ARM/ARMFrameLowering.cpp
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/tools/clang/tools/libclang/CMakeLists.txt b/tools/clang/tools/libclang/CMakeLists.txt
|index f1c3f4c..92390be 100644
|--- a/tools/clang/tools/libclang/CMakeLists.txt
|+++ b/tools/clang/tools/libclang/CMakeLists.txt
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
CMakeFiles/extllvm.dir/build.make:98: recipe for target 'extllvm-prefix/src/extllvm-stamp/extllvm-patch' failed
make[2]: *** [extllvm-prefix/src/extllvm-stamp/extllvm-patch] Error 1
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/extllvm.dir/all' failed
make[1]: *** [CMakeFiles/extllvm.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
linux-x86_64 build failed

Perhaps it is related?

ashleyj commented 8 years ago

I built this a few hours ago on centos

Scanning dependencies of target extllvm
[ 47%] Creating directories for 'extllvm'
[ 52%] Performing download step for 'extllvm'
[ 57%] Performing patch step for 'extllvm'
patching file lib/DebugInfo/DWARFContext.cpp
patching file lib/CodeGen/LexicalScopes.cpp
patching file lib/CodeGen/AsmPrinter/DwarfDebug.cpp
patching file lib/CodeGen/AsmPrinter/AsmPrinter.cpp
patching file lib/Target/AArch64/AArch64FrameLowering.cpp
patching file lib/Target/ARM/ARMFrameLowering.cpp
patching file tools/clang/tools/libclang/CMakeLists.txt
[ 63%] No update step for 'extllvm'

Only thing I can think of is for some reason libclang/CMakeLists.txt file doesn't exit

$ find . -name CMakeLists.txt | grep libclang
./extclang/tools/libclang/CMakeLists.txt
./extclang/unittests/libclang/CMakeLists.txt
./target.llvm/build/linux-x86_64/extclang-prefix/src/extclang/tools/libclang/CMakeLists.txt
./target.llvm/build/linux-x86_64/extclang-prefix/src/extclang/unittests/libclang/CMakeLists.txt

Can you see it there?

Zubnix commented 8 years ago

yeah looks like it's there:

zubzub@localhost ~/git/aura $ find . -name CMakeLists.txt | grep libclang
./llvm/target.llvm/build/linux-x86_64/extclang-prefix/src/extclang/tools/libclang/CMakeLists.txt
./llvm/target.llvm/build/linux-x86_64/extclang-prefix/src/extclang/unittests/libclang/CMakeLists.txt
./llvm/extclang/tools/libclang/CMakeLists.txt
./llvm/extclang/unittests/libclang/CMakeLists.txt

What patch & cmake version do you use? GNU patch 2.7.5 & cmake version 3.4.3 on this machine.

ashleyj commented 8 years ago

cmake 2.8.11 on centos Patch version: GNU patch 2.7.1

ashleyj commented 8 years ago

Doing some googling looks like there is/was a bug with 'patch' not following symm links -- could be related to that

Zubnix commented 8 years ago

A quick first investigation also makes me suspect that to be the problem.

Zubnix commented 8 years ago

any patch version > 2.7.3 fails (so that means 2.7.4 & 2.7.5). Since 2.7.4 patch refuses to follow symlinks of directories. I advice including it in the wiki :)

Zubnix commented 8 years ago

using 2.7.3 seems to fix the original issue. however I do seem to get an error pretty far on during compilation. (not compatible libxml2 found). Are you willing to provide the info (dependencies) required to build the aura/robovm llvm to the wiki as well?

ashleyj commented 8 years ago

I've added a list of deps I've identified here: https://github.com/ashleyj/aura/wiki/Compiling-Aura If you come across any I've missed, let me know.

Zubnix commented 8 years ago

I was able to fix the libxml2 issue by installing a multilib compatible variant (32 & 64bit x86 ABI). Maybe other distro do this by default (I had to explicitly tell gentoo to enable 32 bit ABI for libxml2).

I did not need to install anything specifically to make the compilation succeed so I can not comment if the dependency list is complete or not.