Compiling Root 6.22/08 from source for Mac High Sierra 10.x

Dear all,

with/for a student I am trying to compile Root 6.22.08 on Mac High Sierra.

The main purpose is to get a root version that is compiled together with python3 (as this is what she needs for her jupyter setup - we have already tried installing from port / package, but that uses a Root version with python2.7). We managed to solve a few configure issues by installing extra packages, however now the compilation fails with
“call to member function ‘find’ ambiguous” when trying to compile TCling.cxx (see attached pictures).

I think it might be a simple version problem but could not find any good suggestion so far.

Could anyone help please?

Thanks & Best

ROOT Version: 6.22.08
Platform: Mac High Sierra 10.x
Compiler: Not Provided

I just recompiled ROOT 6.22 on MacOS 10.15.17
and clang 12.0.0 and it works fine.

Is there any way to specify the Clang version?

And did you use 6.22.08 or an earlier version?

We use the following command - perhaps the cxx version needs to be adapted?

build_cmake \
  root \
  $ROOT_VERSION \${ROOT_VERSION}.source.tar.gz \
  -GNinja \
  -Dfail-on-missing=ON \
  -Dgdml=ON \
  -Dx11=ON \
  -Dpyroot=ON \
  -Ddataframe=ON \
  -Dmysql=OFF \
  -Doracle=OFF \
  -Dpgsql=OFF \
  -Dsqlite=OFF \
  -Dpythia6=OFF \
  -Dpythia8=OFF \
  -Dfftw3=OFF \
  -Dbuiltin_cfitsio=ON \
  -Dbuiltin_xxhash=ON \
  -Druntime_cxxmodules=OFF \
  -Dbuiltin_afterimage=ON \
  -Dbuiltin_openssl=ON \
  -Dbuiltin_ftgl=ON \
  -Dbuiltin_glew=ON \
  -Dbuiltin_gsl=ON \
  -Dbuiltin_gl2ps=ON \
  -Dbuiltin_xrootd=ON \
  -Dgfal=OFF \
  -Ddavix=OFF \
  -Dbuiltin_vdt=ON \
  -Dxrootd=OFF \
macitois21:build sftnight$ root --version
ROOT Version: 6.22/09
Built for macosx64 on Oct 18 2023, 05:04:32
From heads/v6-22-00-patches@v6-22-08-102-g6a7a092dce

macitois21:build sftnight$ clang --version
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
macitois21:build sftnight$ 

To install ROOT I did:

$ git clone
$ cd root 
$ git checkout v6-22-00-patches
$ cd ..
$ mkdir build
$ cd build
$ cmake ../root
$ make -j8

Hi Olivier,

thanks - I also realized, that I mis-understood Clang to be Cling, so I thought it was a part of ROOT itself – (Again I am not a MAC user and it was not clear to me that Clang is the Mac-version of gcc).

Once I get hold of the student and her mac again, we will check the clang version to see if we can do something about it.

It make so much more sense now (and I think I might have seen a similar error for linux related to the gcc version).


1 Like


bad news:

We tried with Clang 12 and it still throws the very same error:

/Users/maryrawcliffe/build_root_sep2023/root_src/core/metacling/src/TCling.cxx:3157:19: error: call to member function 'find' is ambiguous

         if (line.find(lib) != std::string::npos) {

/Library/Developer/CommandLineTools/usr/include/c++/v1/string:1149:15: note: candidate function
    size_type find(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
/Library/Developer/CommandLineTools/usr/include/c++/v1/string:1152:15: note: candidate function
    size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;

It still looks to me like version error, but potentially in the c++ version?

I guess we are happy to try an older root version (but it needs to be one for which python3 is the default)


I do not see this error in Cling. May be @Axel has some ideas about it.

Just a brief update: We did try now to compile with C++ standard 14 and 11 instead of 17 and that seems to do at least something.

From using version 14, got further than the other two versions (11 and 17).

So I think C++ 14 is to be used, but we still have a library problem.

[6764/9070] Generating G__Core.cxx, …/lib/Core.pcm

FAILED: core/G__Core.cxx lib/Core.pcm /Users/mystudentsname/build_root_sep2023/root_build/core/G__Core.cxx /Users/mystudentsname/build_root_sep2023/root_build/lib/Core.pcm

cd /Users/mystudentsname/build_root_sep2023/root_build/core && /opt/local/bin/cmake -E env LD_LIBRARY_PATH=/Users/mystudentsname/build_root_sep2023/root_build/lib: /Users/mystudentsname/build_root_sep2023/root_build/core/rootcling_stage1/src/rootcling_stage1 -v2 -f G__Core.cxx -cxxmodule -s /Users/mystudentsname/build_root_sep2023/root_build/lib/ -excludePath /Users/mystudentsname/build_root_sep2023/root_src -excludePath /Users/mystudentsname/build_root_sep2023/root_build/ginclude -excludePath /Users/mystudentsname/build_root_sep2023/root_build/externals -excludePath /Users/mystudentsname/build_root_sep2023/root_build/builtins -I/Users/mystudentsname/build_root_sep2023/root_build/include -I/Users/mystudentsname/build_root_sep2023/root_build/ginclude -I/Users/mystudentsname/build_root_sep2023/root_src/core/base/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/foundation/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/cont/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/gui/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/meta/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/clib/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/rint/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/zip/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/thread/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/textinput/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/clingutils/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/base/v7/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/unix/inc -I/Users/mystudentsname/build_root_sep2023/root_src/core/macosx/inc -I/opt/local/include -I/Users/mystudentsname/build_root_sep2023/root_src/builtins/xxhash -writeEmptyRootPCM ROOT/StringConv.hxx ROOT/TExecutor.hxx ROOT/TSequentialExecutor.hxx Buttons.h Bytes.h Byteswap.h KeySymbols.h MessageTypes.h Riostream.h Rtypes.h TApplication.h TAtt3D.h TAttAxis.h TAttBBox2D.h TAttBBox.h TAttFill.h TAttLine.h TAttMarker.h TAttPad.h TAttText.h TBase64.h TBenchmark.h TBuffer3D.h TBuffer3DTypes.h TBuffer.h TColor.h TColorGradient.h TDatime.h TDirectory.h TEnv.h TError.h TException.h TExec.h TFileCollection.h TFileInfo.h TFolder.h TInetAddress.h TMacro.h TMathBase.h TMD5.h TMemberInspector.h TMessageHandler.h TNamed.h TNotifyLink.h TObject.h TObjString.h TParameter.h TPluginManager.h TPoint.h TPRegexp.h TProcessID.h TProcessUUID.h TQClass.h TQCommand.h TQConnection.h TQObject.h TRedirectOutputGuard.h TRefCnt.h TRef.h TRegexp.h TRemoteObject.h TROOT.h TRootIOCtor.h TStopwatch.h TStorage.h TString.h TStringLong.h TStyle.h TSysEvtHandler.h TSystemDirectory.h TSystemFile.h TSystem.h TTask.h TThreadSlots.h TTime.h TTimer.h TTimeStamp.h TUri.h TUrl.h TUUID.h TVersionCheck.h TVirtualAuth.h TVirtualFFT.h TVirtualGL.h TVirtualMonitoring.h TVirtualMutex.h TVirtualPadEditor.h TVirtualPad.h TVirtualPadPainter.h TVirtualPerfStats.h TVirtualPS.h TVirtualQConnection.h TVirtualRWMutex.h TVirtualTableInterface.h TVirtualViewer3D.h TVirtualX.h ROOT/RLogger.hxx ROOT/RDirectoryEntry.hxx ROOT/RError.hxx ROOT/RIndexIter.hxx strlcpy.h snprintf.h ROOT/TSeq.hxx TArrayC.h TArrayD.h TArrayF.h TArray.h TArrayI.h TArrayL64.h TArrayL.h TArrayS.h TBits.h TBtree.h TClassTable.h TClonesArray.h TCollection.h TCollectionProxyInfo.h TExMap.h THashList.h THashTable.h TIterator.h TList.h TMap.h TObjArray.h TObjectTable.h TOrdCollection.h TRefArray.h TRefTable.h TSeqCollection.h TSortedList.h TVirtualCollectionProxy.h ESTLType.h RStringView.h TClassEdit.h ROOT/RIntegerSequence.hxx ROOT/RMakeUnique.hxx ROOT/RNotFn.hxx ROOT/RSpan.hxx ROOT/RStringView.hxx ROOT/span.hxx ROOT/TypeTraits.hxx TMacOSXSystem.h TUnixSystem.h root_std_complex.h GuiTypes.h TApplicationImp.h TBrowser.h TBrowserImp.h TCanvasImp.h TClassMenuItem.h TContextMenu.h TContextMenuImp.h TControlBarImp.h TGuiFactory.h TInspectorImp.h TObjectSpy.h TToggleGroup.h TToggle.h TBaseClass.h TClassGenerator.h TClass.h TClassRef.h TClassStreamer.h TDataMember.h TDataType.h TDictAttributeMap.h TDictionary.h TEnumConstant.h TEnum.h TFileMergeInfo.h TFunction.h TFunctionTemplate.h TGenericClassInfo.h TGlobal.h TInterpreter.h TInterpreterValue.h TIsAProxy.h TListOfDataMembers.h TListOfEnums.h TListOfEnumsWithLock.h TListOfFunctions.h TListOfFunctionTemplates.h TMemberStreamer.h TMethodArg.h TMethodCall.h TMethod.h TProtoClass.h TRealData.h TSchemaHelper.h TSchemaRule.h TSchemaRuleSet.h TStatusBitsChecker.h TStreamerElement.h TStreamer.h TVirtualIsAProxy.h TVirtualRefProxy.h TVirtualStreamerInfo.h TVirtualArray.h TVirtualObject.h Getline.h /Users/mystudentsname/build_root_sep2023/root_src/core/base/inc/LinkDef.h

While building module ‘Core’:

While building module ‘std’ imported from input_line_1:1:

While building module ‘Darwin’ imported from /Library/Developer/CommandLineTools/usr/include/c++/v1/ctype.h:39:

In file included from :1064:

In file included from /usr/include/ncurses.h:141:

/opt/local/include/unctrl.h:61:38: error: cannot initialize a variable of type ‘char *’ with an lvalue of type ‘char *(chtype)’ (aka ‘char *(unsigned int)’)


                                 ^               ~~~~~~

/opt/local/include/unctrl.h:61:61: error: expected ‘;’ after top level declarator



While building module ‘Core’:

While building module ‘std’ imported from input_line_1:1:

In file included from :2:

/Library/Developer/CommandLineTools/usr/include/c++/v1/ctype.h:39:15: fatal error: could not build module ‘Darwin’

#include_next <ctype.h>

input_line_1:1:10: fatal error: could not build module 'std'

#include <new>


Warning in cling::IncrementalParser::CheckABICompatibility():

 Failed to extract C++ standard library version.

Warning in cling::IncrementalParser::CheckABICompatibility():

 Possible C++ standard library mismatch, compiled with _LIBCPP_ABI_VERSION '1'

 Extraction of runtime standard library version was: ''

While building module 'Core':

While building module 'Cling_Runtime' imported from input_line_2:1:

In file included from <module-includes>:1:

/Users/mystudentsname/build_root_sep2023/root_build/etc/cling/Interpreter/RuntimeUniverse.h:26:10: fatal error: could not build module 'std'

#include <new>


/Users/mystudentsname/build_root_sep2023/root_build/etc/cling/Interpreter/DynamicExprInfo.h:13:10: fatal error: could not build module 'std'

#include <string>


While building module 'Core':

While building module '_Builtin_intrinsics':

In file included from <module-includes>:2:

In file included from /Users/mystudentsname/build_root_sep2023/root_build/etc/cling/lib/clang/5.0.0/include/immintrin.h:32:

In file included from /Users/mystudentsname/build_root_sep2023/root_build/etc/cling/lib/clang/5.0.0/include/xmmintrin.h:39:

In file included from /Users/mystudentsname/build_root_sep2023/root_build/etc/cling/lib/clang/5.0.0/include/mm_malloc.h:27:

In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:94:

/Users/mystudentsname/build_root_sep2023/root_build/etc/cling/lib/clang/5.0.0/include/stdlib.h:8:15: fatal error: could not build module 'Darwin'

#include_next <stdlib.h>


While building module 'Core':

<<< cling interactive line includer >>>: fatal error: could not build module '_Builtin_intrinsics'

Failed to load module _Builtin_intrinsics

Error: Error loading the default header files.

[6769/9070] Linking CXX shared library lib/

ninja: build stopped: subcommand failed.

Ms-Air:~ mystudentsname$

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