ROOT_GENERATE_DICTIONARY failing with CMake 3.11 and ROOT 6.14.02


_ROOT Version: 6.14.02
Platform: SL6
Compiler: GCC 6.2


Full setup:
source /cvmfs/sft.cern.ch/lcg/views/LCG_94rc1/x86_64-slc6-gcc62-opt/setup.sh

Using ROOT_GENERATE_DICTIONARY in a CMake project to generate dictionaries results in

[ 66%] Generating MyEvent_dict.cxx, ../lib/libMyEvent_dict_rdict.pcm, ../lib/libMy_dict.rootmap
CMake Error: cmake version 3.11.1
Usage: /cvmfs/sft.cern.ch/lcg/releases/CMake/3.11.1-daf3a/x86_64-slc6-gcc62-opt/bin/cmake -E <command> [arguments...]
<snip help text>

I can only assume it comes from this line


As cmake -E rootcling is not a registered command (do the ROOT macros add that)?

Calling ROOT_GENERATE_DICTIONARY with

ROOT_GENERATE_DICTIONARY(MyEvent_dict
    MyEvent.hh
    LINKDEF
MyEvent_LinkDef.h
    )

PS: This is the commit that introduced the change ~8 months ago:

The version of ROOT I used before this issue occurred was 6.04.02

If instead of

list(APPEND CMAKE_MODULE_PATH "$ENV{ROOTSYS}/cmake/modules")
  include(RootNewMacros)

I use

list(APPEND CMAKE_MODULE_PATH "/cvmfs/sft.cern.ch/lcg/releases/LCG_79/ROOT/6.04.02/x86_64-slc6-gcc48-opt/cmake/modules")
  include(RootNewMacros)

I can generate the dictionaries.
→ the previous version of RootNewMacros.cmake works with 6.14.02

I sources LCG_94rc1 and rootcling command is available in PATH, I don’t think the problem is actually there.
Can you try to post an output running make with with VERBOSE=1?

@oshadura Thanks for looking into this.
The problem is not that rootcling is not in PATH, since it is. rootcling by itself works.

But ROOT_GENERATE_DICTIONARY calls cmake -E rootcling which is invalid
→ problem with the macro.

Running VERBOSE=1 make shows:

[ 61%] Generating MyEvent_dict.cxx, ../lib/libMyEvent_dict_rdict.pcm, ../lib/libMyEvent_dict.rootmap
cd /code/sim/myproject/build.x86_64-slc6-gcc62-opt/tools && /cvmfs/sft.cern.ch/lcg/releases/CMake/3.11.1-daf3a/x86_64-slc6-gcc62-opt/bin/cmake -E rootcling -v2 -f MyEvent_dict.cxx -s /code/sim/myproject/build.x86_64-slc6-gcc62-opt/lib/libMyEvent_dict.so -rml libMyEvent_dict.so -rmf /code/sim/myproject/build.x86_64-slc6-gcc62-opt/lib/libMyEvent_dict.rootmap -DG4_STORE_TRAJECTORY -DG4VERBOSE -DG4GEOM_USE_USOLIDS -DVECCORE_ENABLE_VC -DVECGEOM_VC -DVECGEOM_REPLACE_USOLIDS -DVECGEOM_QUADRILATERALS_VC -DVECGEOM_NO_SPECIALIZATION -DVECGEOM_ROOT -DVECGEOM_USOLIDS -DVECGEOM_INPLACE_TRANSFORMATIONS -DVECGEOM_USE_INDEXEDNAVSTATES -DG4UI_USE -DG4VIS_USE -DG4MULTITHREADED -DG4UI_USE_TCSH -DG4INTY_USE_XT -DG4VIS_USE_RAYTRACERX -DG4INTY_USE_QT -DG4UI_USE_QT -DG4VIS_USE_OPENGLQT -DG4UI_USE_XM -DG4VIS_USE_OPENGLXM -DG4VIS_USE_OPENGLX -DG4VIS_USE_OPENGL -DMP_USE_GDML -I/cvmfs/sft.cern.ch/lcg/releases/clhep/2.4.1.0-2c56f/x86_64-slc6-gcc62-opt/lib/CLHEP-2.4.1.0/../../include -I/cvmfs/sft.cern.ch/lcg/views/LCG_94rc1/x86_64-slc6-gcc62-opt/include/Geant4 -I/cvmfs/sft.cern.ch/lcg/releases/XercesC/3.1.3-b3bf1/x86_64-slc6-gcc62-opt/include -I/cvmfs/sft.cern.ch/lcg/releases/veccore/0.4.2-ff84f/x86_64-slc6-gcc62-opt/lib/cmake/VecCore/../../../include -I/cvmfs/sft.cern.ch/lcg/releases/Vc/1.3.2-7fbe0/x86_64-slc6-gcc62-opt/include -I/cvmfs/sft.cern.ch/lcg/releases/ROOT/6.14.02-7ef3a/x86_64-slc6-gcc62-opt/include -I/cvmfs/sft.cern.ch/lcg/releases/VecGeom/v00.05.01-d1d74/x86_64-slc6-gcc62-opt/lib/cmake/VecGeom/../../../include -I/code/sim/myproject/include -I/code/sim/myproject/tools/. -I/code/sim/myproject/tools/include /code/sim/myproject/tools/MyEvent.hh /code/sim/myproject/tools/MyEvent_LinkDef.h
CMake Error: cmake version 3.11.1
Usage: /cvmfs/sft.cern.ch/lcg/releases/CMake/3.11.1-daf3a/x86_64-slc6-gcc62-opt/bin/cmake -E <command> [arguments...]
Available commands:
  capabilities              - Report capabilities built into cmake in JSON format
  chdir dir cmd [args...]   - run command in a given directory
  compare_files file1 file2 - check if file1 is same as file2
  copy <file>... destination  - copy files to destination (either file or directory)
  copy_directory <dir>... destination   - copy content of <dir>... directories to 'destination' directory
  copy_if_different <file>... destination  - copy files if it has changed
  echo [<string>...]        - displays arguments as text
  echo_append [<string>...] - displays arguments as text but no new line
  env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...
                            - run command in a modified environment
  environment               - display the current environment
  make_directory <dir>...   - create parent and <dir> directories
  md5sum <file>...          - create MD5 checksum of files
  sha1sum <file>...         - create SHA1 checksum of files
  sha224sum <file>...       - create SHA224 checksum of files
  sha256sum <file>...       - create SHA256 checksum of files
  sha384sum <file>...       - create SHA384 checksum of files
  sha512sum <file>...       - create SHA512 checksum of files
  remove [-f] <file>...     - remove the file(s), use -f to force it
  remove_directory dir      - remove a directory and its contents
  rename oldname newname    - rename a file or directory (on one volume)
  server                    - start cmake in server mode
  sleep <number>...         - sleep for given number of seconds
  tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]
                            - create or extract a tar or zip archive
  time command [args...]    - run command and display elapsed time
  touch file                - touch a file.
  touch_nocreate file       - touch a file but do not create it.
Available on UNIX only:
  create_symlink old new    - create a symbolic link new -> old

as you can see, cmake complains about incorrect usage of cmake -E

Now I see what you mean, @Luke_K, you are absolutely right!
Thank you for a catch! I will submit a fix in both master and 6.14 patch branches.

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