Trouble building master on debian strech/clang-4.0

Hi all,

I’m trying to build ROOT’s master branch on debian stretch with clang-4.0. The compiler is installed correctly, since I can build pretty demanding c++14 projects without issues. I call cmake with the following flags:

mkdir -p /usr/local/src/science/root600/builddir;
cd /usr/local/src/science/root600/builddir
cmake -G Ninja .. -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/root-6.00 \
    -DCMAKE_C_COMPILER=clang-4.0 \
    -DCMAKE_CXX_COMPILER=clang++-4.0 \
    -DCMAKE_F_COMPILER=gfortran \
    -DCMAKE_C_FLAGS="-Qunused-arguments -O2 -g -ffast-math -march=native -fno-omit-frame-pointer" \
    -DCMAKE_CXX_FLAGS="-Qunused-arguments -O2 -g -ffast-math -march=native -fno-omit-frame-pointer" \
    -DCMAKE_F_FLAGS="-O2 -g -ffast-math -march=native -fno-omit-frame-pointer" \
    -Dall=ON -Dtesting=OFF -Dcxx14=ON -Dsoversion=ON -Droofit=ON -Dminuit2=ON \
    -Dunuran=ON -Dbuiltin-freetype=OFF -Dbuiltin-pcre=OFF -Dbuiltin-zlib=OFF \
    -Dtable=ON -Dgsl-shared=ON -Dqt=ON -Dqtgsi=ON -Dafs=ON -Dshadowpw=ON \
    -Dbuiltin-afterimage=OFF -Dbuiltin-freetype=OFF -Druby=OFF -Dr=ON \
    -Dbuiltin-pcre=OFF -Dbuiltin-zlib=OFF -Dbuiltin-lzma=OFF -Dbuiltin_lz4=ON \
    -Dbuiltin-ftgl=OFF -Dbuiltin-glew=OFF -Ddavix=OFF -Dgsl_shared=ON \
    -Dbuiltin_ftgl=OFF -Dbuiltin_glew=OFF -Dbuiltin_vdt=ON -Dbuiltin_vc=ON \

I get the following error:

-- Go bindings enabled.
-- Found OCaml: /usr/bin/ocamlfind
-- OCaml bindings enabled.
-- LLVM host triple: x86_64-unknown-linux-gnu
-- LLVM default target triple: x86_64-unknown-linux-gnu
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Targeting X86
-- Found Z3: /usr/lib/x86_64-linux-gnu/ (Required is at least version "4.5")
-- Clang version: 5.0.0
CMake Error at interpreter/llvm/src/tools/clang/cmake/modules/AddClang.cmake:93 (if):
  if given arguments:


  Unknown arguments specified
Call Stack (most recent call first):
  interpreter/llvm/src/tools/clang/lib/Basic/CMakeLists.txt:65 (add_clang_library)

-- Configuring incomplete, errors occurred!
See also "/usr/local/src/science/root600/builddir/CMakeFiles/CMakeOutput.log".
See also "/usr/local/src/science/root600/builddir/CMakeFiles/CMakeError.log".

I have attached a log file of the CMake run and the two files it mentions at the end. Any pointers would be very much appreciated.

Thanks a lot in advance!


CMakeError.log.txt (17.5 KB)
cmakelog.txt (10.5 KB)
CMakeOutput.log.txt (91.2 KB)

This looks like a bug in the build system. Could you please try again on a fresh build directory without setting your own compiler flags? It could be a problem with flag propagation between ROOT and llvm.

Thanks for the hint! I gave it a try (rm -fr builddir/*; cd builddir; …/, the script I pasted above, but with the custom compiler flags removed), but it does not change anything, unfortunately.

I’d start super simple and add possible sources of problems little by little. For example, you could checkout a commit that should certainly be working (cd /path/to/root/source; git checkout v6-10-00) and simply run cd path/to/build; cmake path/to/root. If this works without problems it should be easy to figure out what is the cause of your error by trying to checkout master (possibly after fetching the latest version) and/or adding flags.

edit: maybe obvious: ROOT’s build directory must be outside of the source directory

That was a good hint indeed, thanks! It seems that there’s something that’s gone wrong in my set of custom patches on top of ROOT (although I usually manage to leave the build files untouched - but I seem to have goofed there). I have a clue what to look for now, thanks!


1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.