Vdt includes

I am trying to compile root from source using mac M3 with system 14.7.1
After cmake, I cannot find in my build directory include/vdt and ginclude/vdt
Notice that vdt is installed in my system (via MacPorts)
I need these directories because a root based software I am using looks for those include files.

I tried to use -D builtin_vdt=ON and/or -D vdt=ON but none of these two options could solve the issue
Any suggestion?

Dear @Giuseppe_Battistoni,
welcome to the ROOT forum. Could you please share the error message you get?

Cheers,
Monica

Hello
There is no error in root compilation, but there is something missing that breaks the compilation of a root-based code. The error is that it does not find in $ROOTSYS/include/ the directory vdt (and in particular vdtMath.h):

/opt/root-6.34.04/builddir/include/ROOT/RVec.hxx:54:10: fatal error: ‘vdt/vdtMath.h’ file not found
#include <vdt/vdtMath.h>

To give more details: this is something that specifically occurs on the macOsx platform. If I download root-6.34.04 (or the 6.32 versions, it’s the same thing) on linux (Fedora 40), using the same cmake options, I do find both $ROOTSYS/include/vdt and $ROOTSYS/ginclude/vdt
Instead, on mac (system 14.7.1) with MacPorts, I do not succeed to make those vdt directories appear. Notice that vdt has been already installed in my mac using MacPorts.
My cmake command (on both linux and mac) normally is:

cmake -Dgdml=ON -Dbuiltin_glew=ON -Dbuiltin_lzma=ON -Dbuiltin_fftw3=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=17 -Drpath=ON -Dunfold=ON …

On mac I also tried the following:

cmake -Dgdml=ON -Dbuiltin_glew=ON -Dbuiltin_lzma=ON -Dbuiltin_fftw3=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=17 -Drpath=ON -Dunfold=ON -Dbuiltin_vdt=ON …

and also this:

cmake -Dgdml=ON -Dbuiltin_glew=ON -Dbuiltin_lzma=ON -Dbuiltin_fftw3=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=17 -Drpath=ON -Dunfold=ON -Dvdt=ON …

but the result is always the same.
Actually, on linux, there was no need to add something about vdt in the cmake options
On mac I can of course solve the issue manually, by ssh coping the vdt directories from the linux installation, but this is quite unsatisfactory.
Can someone give suggestions?
Thank you

Giuseppe

Thank you for detailing your issue. Could you please share the output of your cmake configuration command? It would be useful if you could share how you’re compiling your example requiring vdt.

here it is in attachment.
Notice that at the end vdt appears in the list of the enabled supports

Thank you

(Attachment cmake.log is missing)

The attachment is missing, but indeed I wanted to check whether vdt was showing in the list of enabled support.

How are you compiling your program?

The attachment was rejected.
I try in this way:
-m64 -pipe -W -Wall -fsigned-char -fno-common -Qunused-arguments -pt
hread

  • C (build type specific): -g
  • C++: -Wc++11-narrowing -Wsign-compare
    -Wsometimes-uninitialized -Wconditi
    onal-uninitialized -Wheader-guard -Warray-bounds -Wcomment
    -Wtautological-compare -Wstrncat-size -W
    loop-analysis -Wbool-conversion -m64 -pipe -W -Wall
    -Woverloaded-virtual -fsigned-char -fno-common
    -Qunused-arguments -pthread -stdlib=libc++
  • C++ (build type specific): -g
    – Linker flags:
  • Executable:
  • Module:
  • Shared:

– Enabled support for: asimage asserts builtin_clang builtin_cling
builtin_fftw3 builtin_freetype
builtin_ftgl builtin_glew builtin_llvm builtin_lzma builtin_openui5
builtin_tbb clad cocoa datafra
me davix fftw3 gdml geom http imt libcxx opengl pyroot roofit root7
rpath runtime_cxxmodules shared
spectrum sqlite ssl tmva tmva-cpu tmva-cudnn tmva-pymva tpython
unfold vdt webgui xml xrootd
– Configuring done (5.3s)
– Generating done (2.9s)
– Build files have been written to: /opt/root-6.34.04/builddir

are you linking against ROOT? e.g.

g++ mysource.cxx `root-config --libs --cflags` 

Also, remember to activate ROOT by sourcing thisroot.sh!

Hi @Giuseppe_Battistoni,

about the different CMake options you tried: for sure you need -Dbuiltin_vdt=ON so that ROOT is build and shipped with the vdt headers. -Dvdt=ON means it will look for vdt on the system while building and use that in the build, but it will not copy it inside $ROOTSYS/include.

I couldn’t see builtin_vdt=ON in your logs, so maybe it got disabled by the auto-configuration for some reason? Therefore, I also recommend -Dfail-on-missing=ON, so nothing if disabled without you noticing (the build will fail instead).

Then, so we get some more datapoints, what is your $ROOTSYS pointing to? The build directory, or the install directory? Maybe the headers only ended up in the build tree, but not the install tree?

Yes of course! All this is well known. Actually my problem seems to stem from a different behaviour between macOsx and linux environment

My $ROOTSYS points to the build directory
My way to build root is the following:
after expanding the tar.gz file, inside the root-6.34.04 directory I create a builddir directory. There I execute cmake and make. The environment is then set by running root-6.34.04/builddir/bin/thisroot.sh
After that, the only include directory is root-6.34.04/builddir/include
There is no other include elsewhere.
I confirm that the log I sent refers to a case in which I did not use buildin_vdt=ON, but, as I already explained, nothing changed when I put it explicitely, However, here below the log in which I added -Dbuiltin_vdt=ON :

– Building ROOT version 6.34.04
– The default C++ standard in use by the detected compiler (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++) is lower than C++17. Setting C++17 as the minimum standard.
– Found a macOS system
– Found an AArch64 system
– ROOT default compression algorithm: zlib
– Checking internet connectivity
– Checking internet connectivity - found
– Looking for ZLib
– Looking for nlohmann/json.hpp
– Found nlohmann/json.hpp in /opt/local/include;/opt/local/include (found version 3.11.3)
– Building freetype version 2.12.1 included in ROOT itself
– Looking for PCRE
– Building LZMA version 5.2.4 included in ROOT itself
– Looking for xxHash
– Found xxHash: /opt/local/lib/libxxhash.dylib (found suitable version “0.8.2”, minimum required is “0.8”)
– Looking for ZSTD
– Looking for LZ4
– Looking for Python
– Found Python3: /opt/local/bin/python3.12 (found suitable version “3.12.9”, minimum required is “3.8”) found components: Interpreter Development NumPy Development.Module Development.Embed
– Looking for OpenGL
– Looking for gl2ps
– Looking for LibXml2
– Looking for SQLite
– Downloading and building FFTW version 3.3.8
– Looking for XROOTD
– Checking for module ‘davix>=0.6.4’
– Found davix, version 0.8.7
– Looking for BLAS for optional parts of TMVA
– PyROOT: development package found. Building for version 3.12.9
– Building LLVM in ‘Release’ mode.
– bolt project is disabled
– clang project is enabled
– clang-tools-extra project is disabled
– compiler-rt project is disabled
– cross-project-tests project is disabled
– libc project is disabled
– libclc project is disabled
– lld project is disabled
– lldb project is disabled
– mlir project is disabled
– openmp project is disabled
– polly project is disabled
– pstl project is disabled
– flang project is disabled
– Found libtool - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
– Found Python3: /opt/local/bin/python3.12 (found suitable version “3.12.9”, minimum required is “3.0”) found components: Interpreter
– LLVM host triple: arm64-apple-darwin23.6.0
– Native target architecture is AArch64
– Threads disabled.
– Doxygen disabled.
– Found ld64 - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld-classic
– Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
– OCaml bindings disabled.
– LLVM default target triple: arm64-apple-darwin23.6.0
– Building with -fPIC
– Targeting AArch64
– Targeting NVPTX
– Clang version: 18.1.6
– Host linker version: 1053.12
– Building Cling as part of ROOT
– Cling version (from VERSION file): ROOT_1.2~dev
– Cling will look for C++ headers in ‘/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1’ at runtime.
– And if not found, will invoke: ‘/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk’ for them.
– Found xxHash: /opt/local/lib/libxxhash.dylib (found version “0.8.2”)
– Found arc4random_buf in stdlib.h
– Use SSL API VERSION 3.4 for civetweb
– Distributed RDataFrame enabled
– RapidYAML not found, only compiling RooFit with nlohmann-json parser
– Found Chrome browser executable /Applications/Google Chrome.app/Contents/MacOS/Google Chrome major version 133
– Found Firefox browser executable /Applications/firefox.app/Contents/MacOS/firefox
– ROOT Configuration

System: Darwin-23.6.0
ROOT Platform: macosx
ROOT Architecture: macosxarm64
Processor: 8 core Apple M3 (arm64)
Build type: Debug
Install path: /usr/local
Compiler: AppleClang 15.0.0.15000309
C++ standard: 17
Compiler flags:

  • C: -m64 -pipe -W -Wall -fsigned-char -fno-common -Qunused-arguments -pthread
  • C (build type specific): -g
  • C++: -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++
  • C++ (build type specific): -g
    – Linker flags:
  • Executable:
  • Module:
  • Shared:

– Enabled support for: asimage asserts builtin_clang builtin_cling builtin_fftw3 builtin_freetype builtin_ftgl builtin_glew builtin_llvm builtin_lzma builtin_openui5 builtin_tbb builtin_vdt clad cocoa dataframe davix fftw3 gdml geom http imt libcxx opengl pyroot roofit root7 rpath runtime_cxxmodules shared spectrum sqlite ssl tmva tmva-cpu tmva-cudnn tmva-pymva tpython unfold vdt webgui xml xrootd
– Configuring done (3.4s)
– Generating done (2.7s)
– Build files have been written to: /opt/root-6.34.04/builddir

Thank you

When you added -Dbuildtin_vdt, did you rebuild from scratch? If not, I would recommend to do so.

Yes, I rebuilt from scratch

I do not have other suggestions to make unfortunately… Maybe @couet can help with this.

Could you run sudo updatedb
and then post here the output of locate vdtMath.h.

Maybe the VDT macport version is outdated and has this header located in a non-standard place.

Sorry, you were completely right and it was my fault! I was not scratching correctly my build. After scratching completely the directory, and inserting -D builtin_vdt=ON in the cmake, during the compilation the include/vdt directory eventually appeared.
Thank you very much for the assistance