Building for ROOT7

I am trying to install ROOT v6.22 from source on my Mac - I can get it wokring without ROOT7 but I want to use some of the development features so I tried this:

cmake -DCMAKE_INSTALL_PREFIX=../root_install/ ../root_src/ -DCMAKE_CXX_STANDARD=17 -Dhttp=ON -Droot7=ON

it seems OK (no error) then when I attempt to make I am seeing this error:

[ 75%] Built target Cling
[ 75%] Generating G__Core.cxx, ../lib/Core.pcm
In file included from input_line_10:101:
/Users/user/NewROOT/root_build/include/ROOT/RError.hxx:142:55: error: no member named 'make_unique' in namespace 'std'
   explicit RResultBase(RError &&error) : fError(std::make_unique<RError...
                                                 ~~~~~^
/Users/user/NewROOT/root_build/include/ROOT/RError.hxx:142:67: error: 'RError' does not refer to a value
   explicit RResultBase(RError &&error) : fError(std::make_unique<RError...
                                                                  ^
/Users/user/NewROOT/root_build/include/ROOT/RError.hxx:76:7: note: declared here
class RError {
      ^
Error: /Users/user/NewROOT/root_build/core/rootcling_stage1/src/rootcling_stage1: compilation failure (/Users/user/NewROOT/root_build/lib/libCoreb85654445f_dictUmbrella.h)
make[2]: *** [core/G__Core.cxx] Error 1
make[1]: *** [core/CMakeFiles/G__Core.dir/all] Error 2
make: *** [all] Error 2
[ 75%] Built target Cling
[ 75%] Generating G__Core.cxx, ../lib/Core.pcm
In file included from input_line_10:101:
/Users/user/NewROOT/root_build/include/ROOT/RError.hxx:142:55: error: no member named 'make_unique' in namespace 'std'
   explicit RResultBase(RError &&error) : fError(std::make_unique<RError...
                                                 ~~~~~^
/Users/user/NewROOT/root_build/include/ROOT/RError.hxx:142:67: error: 'RError' does not refer to a value
   explicit RResultBase(RError &&error) : fError(std::make_unique<RError...
                                                                  ^
/Users/user/NewROOT/root_build/include/ROOT/RError.hxx:76:7: note: declared here
class RError {
      ^
Error: /Users/user/NewROOT/root_build/core/rootcling_stage1/src/rootcling_stage1: compilation failure (/Users/user/NewROOT/root_build/lib/libCoreb85654445f_dictUmbrella.h)
make[2]: *** [core/G__Core.cxx] Error 1
make[1]: *** [core/CMakeFiles/G__Core.dir/all] Error 2
make: *** [all] Error 2

Any ideas what the issue might be - I have the latest gcc and clang installed so it should have access to c++17

I hope, @jblomer can help you

Hm, std::make_unique should be part of the memory header, which is included. Could you try if it helps to #include <ROOT/RMakeUnique.hxx> and, if that doesn’t help, to replace in RError.hxx line 142

std::make_unique<RError>

by

std::make_unique<ROOT::Experimental::RError>

I tried your suggestions but I’m still seeing:

[ 75%] Generating G__Core.cxx, ../lib/Core.pcm
In file included from input_line_10:101:
/Users/user/NewROOT/root_build/include/ROOT/RError.hxx:142:55: error: no member named 'make_unique' in namespace 'std'
   explicit RResultBase(RError &&error) : fError(std::make_unique<ROOT::...
                                                 ~~~~~^
/Users/user/NewROOT/root_build/include/ROOT/RError.hxx:142:93: error: expected '(' for function-style cast or type construction
  ...&&error) : fError(std::make_unique<ROOT::Experimental::RError>(std::move...
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~^
Error: /Users/user/NewROOT/root_build/core/rootcling_stage1/src/rootcling_stage1: compilation failure (/Users/user/NewROOT/root_build/lib/libCored8c4b8eee2_dictUmbrella.h)
make[2]: *** [core/G__Core.cxx] Error 1
make[1]: *** [core/CMakeFiles/G__Core.dir/all] Error 2
make: *** [all] Error 2
[3]   Done                    atom /Users/user/NewROOT/root_build/include/ROOT/RError.hxx
MacBook-Pro:root_build user$ 

Can you let me know your version of macOS and which compiler you are using? The strange thing is that we don’t see this on any of our mac nodes.

Hi,

I am using MAC OS v 10.14.6 and my compiler is Apple clang version 11.0.0 (clang-1100.0.33.8).

Thanks,
Sophie

Thanks! I tried here successfully on a macOS 10.14.6 with clang 10 and your cmake options:

$ which clang
/usr/bin/clang
$ clang --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

So perhaps it’s clang 11 vs. clang 10. On your machine, is the output of which clang and clang --version identical (except for the version number)?

@oshadura Do you perhaps have an idea what could cause the compile error?

The version and which seem to be in the same place.

Out of interest is there a CVFMS install which might have ROOT7 enabled - if it turns out my local install is incompatible that might be useful?

Can you post please your CMake configuration step log?

We test the same flags in ROOT nightlies builds on Mac OS X so it should be a working combination.

The error means that somehow CMAKE_CXX_STANDARD is not picked up properly and I suspect because maybe you have both compilers installed…

Here is the output from the CMake command:

"
– Detected ROOT_VERSION 6.22.99
– Looking for Python
– ROOT default compression algorithm: zlib
– PyROOT will be built for versions 3.7.7 (Main) and 2.7.16
– Found a Mac OS X System 10.14
– Found a 64bit system
– Found LLVM compiler collection
– ROOT Platform: macosx
– ROOT Architecture: macosx64
– Build Type: Release (flags = ‘-O3 -DNDEBUG’)
– Compiler Flags: -O3 -DNDEBUG -std=c++1z -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++
– Looking for ZLib
– Building freetype version 2.6.1 included in ROOT itself
– Looking for LZMA
– Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR)
– Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
– Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
– Building AfterImage library included in ROOT itself
– Looking for GSL
– Looking for OpenGL
– Looking for LibXml2
– Looking for SQLite
– Downloading and building XROOTD version
– Cannot select cudnn without selecting cuda or tmva-gpu. Option is ignored
– Looking for BLAS for optional parts of TMVA
– Building LLVM in ‘Release’ mode.
– Found libtool - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
– Native target architecture is X86
– Threads disabled.
– Doxygen disabled.
– Go bindings disabled.
– Found ld64 - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
– LLVM host triple: x86_64-apple-darwin18.7.0
– LLVM default target triple: x86_64-apple-darwin18.7.0
– Building with -fPIC
– Constructing LLVMBuild project information
– SysLibs: curses;/usr/lib/libz.dylib
– Targeting X86
– Targeting NVPTX
– Clang version: 5.0.0
– Cling version (from VERSION file): ROOT_0.7~dev
– Cling will look for C++ headers in ‘/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1’ at runtime.
– And if not found, will invoke: '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ ’ for them.
– Performing Test found_stdstringview
– Performing Test found_stdstringview - Success
– Performing Test found_stod_stringview
– Performing Test found_stod_stringview - Failed
– Performing Test found_stdapply
– Performing Test found_stdapply - Success
– Performing Test found_stdinvoke
– Performing Test found_stdinvoke - Success
– Performing Test found_stdindexsequence
– Performing Test found_stdindexsequence - Success
Running /Users/user/NewROOT/root_src/build/unix/compiledata.sh
Changing /Users/user/NewROOT/root_build/ginclude/compiledata.h
– Enabled support for: asimage builtin_afterimage builtin_clang builtin_freetype builtin_ftgl builtin_gl2ps builtin_glew builtin_llvm builtin_lz4 builtin_openssl builtin_pcre builtin_tbb builtin_vdt builtin_xrootd builtin_xxhash builtin_zstd clad cocoa dataframe exceptions gdml http imt libcxx mathmore mlp opengl pyroot roofit root7 runtime_cxxmodules shared sqlite ssl tmva tmva-cpu tmva-pymva spectrum vdt xml xrootd
– Configuring done
– Generating done
– Build files have been written to: /Users/user/NewROOT/root_build

"

ROOT version ROOT_VERSION 6.22.99 indicates a work-in-progress git branch. Does it work with the 6.22.02 release (https://root.cern/download/root_v6.22.02.source.tar.gz)?

Hi, this produced the same error

@Axel Do you perhaps have an idea what could cause this?

Hey,

How did you guys get 10.0.1 (@jblomer) and 11.0.0 (@smd) on your 10.14.6? I have the same osx version and clang 10.0.0 and can’t find a way to update it :slight_smile:

Alja has osx-15 and clang 11.0.3 there.

Is it possible some headers from osx-14 interfere with clang-11?

Cheers,
Matevz

These are our build & test mac boxes, I think @Axel would know how the compiler gets installed.

10.0.1 is command line tools, as downloaded from https://developer.apple.com/download/more/

OK let’s see. @smd could you upload the file CMakeCache.txt? What does cmake --version say?

It’s strange that CMake sets -std=c++1z, I would have expected -std=c++17.

std::make_unique exists since C++14, so indeed, rootcling isn’t built with the proper C++ standard. Is this on an existing build directory? Can you do make -j4 clean; rm CMakeCache.txt; cmake -DCMAKE_INSTALL_PREFIX=../root_install/ ../root_src/ -DCMAKE_CXX_STANDARD=17 -Dhttp=ON -Droot7=ON; make -j 12 - does that help?

O, and if C++17 is an issue, maybe try with -DCMAKE_CXX_STANDARD=14? ROOT7 should happily build with that, too!

Coming back to this old issue, could you try if this patch solves it: https://github.com/root-project/root/pull/6790

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