Hi !,
Thanks very much for your answer (and sorry, my mail was not clear at all).
1)3a) mirror the flags, Ok.. so there is no one-to-one correpondance
between cmake and autoconf and it's on a case-by-case basis
2) *llvm-config --cxxflags* is described as : "C++ compiler flags for
files that include LLVM headers.". So the C++ project which uses *llvm-config
--cxxflags* in it's configure script or Makefile will be compiled in
-pedantic if LLVM was compiled in -pedantic... It does not make sense,
right ? For example here, because I dont know how to change Make.user in
order to have a Makefile without lots of Warnings enabled and -pedantic
(otherwise I can't compile codegen.cpp) , I have to rebuild another llvm
with :
cmake ../llvm -DCMAKE_INSTALL_PREFIX=$LOCAL -DCMAKE_BUILD_TYPE=Release
-DLLVM_ENABLE_ASSERTIONS=On *-DLLVM_ENABLE_PEDANTIC=Off
-DLLVM_ENABLE_WARNINGS=Off*
then
*:llvm-config --cxxflags = **-I$LOCAL -fPIC
-fvisibility-inlines-hidden -std=c++11 -ffunction-sections -fdata-sections
-O3 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS*
=> now I can build julia with llvm builded with cmake ...
=> I would prefer a ${JULIA_SRC_DIRECTORY}/src/Makefile (line 71 and 73)
which use ony llvm-config --includedir + some level of warnings (chosen in
Make.user for example) instead of llvm-config --cxxflags
3b) ok, up to now, I only played with packages with *Pkg.add("...")*. For
Cxx.jl, and the Pkg.clone("...")+Pkg.build("..."), I didn't catched at
first that I had to manually change BuildBootstrap.Makefile
<https://github.com/Keno/Cxx.jl/blob/master/deps/BuildBootstrap.Makefile>
4) I supose the way Cling is intricated with LLVM/OrcJIT and Clang
(patches) makes it much more difficult to update when the API changes...
but julia and Cxx.jl are most of the time working with latest
LLVM/Clang/LLDB which is great when you want to learn a bit about LLVM and
directly play with latest API. (for example tutorials
writing_your_own_compiler_with_llvm
<http://gnuu.org/2009/09/18/writing-your-own-toy-compiler/> and
creating_a_toy_language_with_python_and_llvm
<http://www.google.fr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&cad=rja&uact=8&ved=0CDYQtwIwAw&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DG78cTmgeUxI&ei=_hlbVeW-IcrjUd2EgMgP&usg=AFQjCNHSIinMNdhTVYNSEd-7S76YXKRWAg&sig2=spf1g6cr6KBN2xsR9BMEHg>
wont work directly)
Best,
Le mardi 19 mai 2015 03:12:46 UTC+2, Isaiah a écrit :
>
> 1) I would like to compile LLVM with cmake as I'm used to... which flags I
>> shoud use ?
>
>
> see `deps/llvm-svn/build_Release/config.log` for the flags we pass in, and
> try to mirror at least some of those.
>
> 2) Maybe there is some trick : llvm-config --cxxflags can give flags
>> different from the llvm compilation flags
>
>
> I don't follow...
>
> 3) Is there, in general, a one-to-one correspondance between cmake flags
>> and configure flags ? and particularly for llvm ?
>
>
> It depends on the flags. CMake does a lot of platform detection so some
> flags may not be necessary.
>
> 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.
>
>
> Provided you have also built LLDB and Clang with compatible flags, I don't
> see any reason why not. I believe the Cxx.jl build script just uses
> llvm-config, but you might need to teach it where to find some things, if
> it makes any hard-coded assumptions.
>
> 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
>
>
> No idea about Sage/Python, but with respect to Linux and LLVM, part of the
> issue is that some distributions are militant about bumping LLVM versions
> without realizing how much the LLVM API changes from version to version.
> (another issue is that getting patches in to LLVM can sometimes be
> slow/difficult, so groups like Cling maintain their own fork, as we
> unfortunately may have to do)
>
> Relatedly, see: https://github.com/JuliaLang/julia/pull/9422 (although
> IIRC it is not driving the LLVM CMake build directly yet)
>
>