Hi,
When I compile julia with my Make.user :
*/////////////////////////////////////////////////////////////////////MARCH=native/////////////////////////////////////////////////////////////////////override
LLDB_VER=masteroverride LLVM_ASSERTIONS=1override LLVM_VER=svnoverride
BUILD_LLVM_CLANG=1override BUILD_LLDB=1override USE_LLVM_SHLIB=1override
LLDB_DISABLE_PYTHON=1/////////////////////////////////////////////////////////////////////prefix
= ${LOCAL}bindir =
....../////////////////////////////////////////////////////////////////////*the
configure script is called by ${JULIA_SRC_DIR}/deps/Makefile with the
following flags :
*../llvm-svn/configure --prefix=$LOCAL --build=x86_64-linux-gnu
--libdir=$LOCAL/lib F77="gfortran -march=native -m64" CC="gcc
-march=native -m64 " CXX="g++ -march=native -m64 " --disable-profiling
--enable-shared --enable-static --enable-targets=host --disable-bindings
--disable-docs --enable-assertions --enable-optimized --disable-threads
CXXFLAGS=" -std=c++0x -DLLDB_DISABLE_PYTHON"
--with-python="/usr/bin/python"make -j4* *install *compiles and links
correctly (modulo the fact that I have to add *-lpthread* at the link for
*liblldb.so
, lldb-mi* and* lldb-server* )
${JULIA_SRC_DIR}/julia runs and
${JULIA_SRC_DIR}/usr/lib/libLLVM-3.7.0svn.so symbolic link to
${JULIA_SRC_DIR}/usr/lib/libLLVM-3.7svn.so
${LOCAL}/bin/julia runs (modulo adding ${LOCAL}/lib/julia/lib to the
LD_LIBRARY_PATH)
Nevermind, I would like to link against my local LLVM because it takes time
and other projects need latest llvm also...
1) if I compile LLVM with cmake ../llvm -DCMAKE_INSTALL_PREFIX=$LOCAL
-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=On && make -j4 && make
install
No need to add manually -lpthread
I end up with ./llvm-config --cxxflags = ... -Wall -W -Wno-unused-parameter
-Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic
-Wno-long-long -Wno-maybe-uninitialized -Wno-comment -std=c++11
-ffunction-sections -fdata-sections ...
and I can't compile julia with these flags (because of -pedantic and zero
size arrays in codegen.cpp ?)
2) if I compile LLVM with configure as in bold above,
I end up with ./llvm-config --cxxflags = ... -D_DEBUG -D_GNU_SOURCE
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3
-fomit-frame-pointer -std=c++11 -fvisibility-inlines-hidden -fno-exceptions
-fno-rtti -fPIC -ffunction-sections -fdata-sections -Wcast-qual ...
and I can compile julia and I'm happy because everything is installed in my
$LOCAL
My questions (thanks to read this giant post by the way) :
1) I would like to compile LLVM with cmake as I'm used to... which flags I
shoud use ?
2) Maybe there is some trick : llvm-config --cxxflags can give flags
different from the llvm compilation flags ? ...
3) Is there, in general, a one-to-one correspondance between cmake flags
and configure flags ? and particularly for llvm ?
3) at the end, can we adapt the build of Cxx.jl for an external LLVM ?
because Pkg.clone("...") and the Pkg.build("...") require the internal llvm.
4) bonus question : is it avoidable , the fact that sagemath comes with his
own python, youcompleteme (vim plugin) comes with it's own llvm/clang,
cling (cern interpreter) comes with it's own llvm/clang ...
Thanks ! Julia is fun.
My system :
Linux 4.0.0-1-amd64 SMP Debian 4.0.2-1
g++ (Debian 4.9.2-16) 4.9.2
ldd (Debian GLIBC 2.19-18) 2.19
julia 1b2f4fa9d75c604978920153388bc9bd62e3dc6c
Best,