Open elliottslaughter opened 5 years ago
The reason this fails is that the current Arch packages for LLVM and Clang 6.0 do not include static libraries for Clang. Therefore, I don't think it will be possible to build Terra with the current Arch packages, without teaching Terra to first build from dynamic libraries.
I have managed to build Terra main binary on arch. It works pretty ok, all tests passed except for the single one. Of course that test is "dynlib" that itself assumes the same thing as the Terra Makefile: that clang and LLVM are static. (edit: nevermind, it just couldn't find the luajit lib because of hacking around with the compiler commands manually instead of letting makefile do stuff by itself... after I also additionally compiled the terra.so
with dynamic link th clang and LLVM like in below command)
But yeah, it can be build on Arch, on dynamic libraries, while making every single test work. It just needs a whack into build statements. Namely, my resulting working statement ended up as
g++ -o release/bin/terra -g -Wl,-export-dynamic -Wl,--whole-archive build/terra.o -Wl,--no-whole-archive -lcurses -lz -ldl -pthread -lclangFrontend -lclangDriver -lclangSerialization -lclangCodeGen -lclangParse -lclangSema -lclangAnalysis -lclangEdit -lclangAST -lclangLex -lclangBasic build/lib/libluajit-5.1.a -lLLVM build/lctype.o build/linenoise.o build/lj_strscan.o build/llex.o build/lobject.o build/lparser.o build/lstring.o build/lzio.o build/main.o build/tcompiler.o build/tcuda.o build/tcwrapper.o build/tdebug.o build/tinline.o build/tinternalizedfiles.o build/tkind.o build/tllvmutil.o build/treadnumber.o build/lib/libluajit-5.1.a```
We may theoretically be able to make this work out of the box now with CMake. I'm not sure that FindClang.cmake is robust enough to handle Clang's dynamic libraries, but I'm sure that can be fixed with some effort.
With the following Dockerfile:
I get the following error: