ROOT stopped working after macOS update to Mojave


_ROOT Version: v6.14/04
_Platform: macOS Mojave
__

Hello!

I’ve been using ROOT for a few weeks, so I’m new to it, and when I updated my macOS to Mojave, ROOT stopped working (cannot compile my .cpp files, and gives out a few error messages whenever started).

This is the starting error message:


ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
  LC_ALL=C /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++   -O2 -DNDEBUG -xc++ -E -v /dev/null 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | GREP_OPTIONS= grep -E "(c|g)\+\+"
Results was:
With exit code 256
input_line_1:1:10: fatal error: 'new' file not found
#include <new>
         ^~~~~
input_line_3:37:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
   ------------------------------------------------------------
  | Welcome to ROOT 6.14/04                http://root.cern.ch |
  |                               (c) 1995-2018, The ROOT Team |
  | Built for macosx64                                         |
  | From tags/v6-14-04@v6-14-04, Aug 23 2018, 17:00:44         |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

input_line_9:1:10: fatal error: 'iostream' file not found
#include <iostream>
         ^~~~~~~~~~
root [0] 


and this is the error I get when trying to compile a file with .L .cpp++


Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/diogopires/Desktop/./muon_histo_cpp.so
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
  LC_ALL=C /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++   -O2 -DNDEBUG -xc++ -E -v /dev/null 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | GREP_OPTIONS= grep -E "(c|g)\+\+"
Results was:
With exit code 256
warning: no such sysroot directory: '-I/usr/local/Cellar/root/6.14.04_1/etc/root'
input_line_1:1:10: fatal error: 'new' file not found
#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: ''
In file included from input_line_3:1:
In file included from /usr/local/Cellar/root/6.14.04_1/include/root/RtypesCore.h:25:
/usr/local/Cellar/root/6.14.04_1/etc/root/cling/lib/clang/5.0.0/include/stddef.h:51:9: error: unknown type name '__PTRDIFF_TYPE__'
typedef __PTRDIFF_TYPE__ ptrdiff_t;
        ^
/usr/local/Cellar/root/6.14.04_1/etc/root/cling/lib/clang/5.0.0/include/stddef.h:62:9: error: unknown type name '__SIZE_TYPE__'
typedef __SIZE_TYPE__ size_t;
        ^
/usr/local/Cellar/root/6.14.04_1/etc/root/cling/lib/clang/5.0.0/include/stddef.h:90:9: error: unknown type name '__WCHAR_TYPE__'
typedef __WCHAR_TYPE__ wchar_t;
        ^
/usr/local/Cellar/root/6.14.04_1/etc/root/cling/lib/clang/5.0.0/include/stddef.h:90:24: error: expected unqualified-id
typedef __WCHAR_TYPE__ wchar_t;
                       ^
input_line_3:2:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~

 *** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/usr/local/Cellar/root/6.14.04_1/lib/root/libCling.so] ROOT::TMetaUtils::TNormalizedCtxtImpl::TNormalizedCtxtImpl(cling::LookupHelper const&) (no debug info)
[/usr/local/Cellar/root/6.14.04_1/lib/root/libCling.so] ROOT::TMetaUtils::TNormalizedCtxt::TNormalizedCtxt(cling::LookupHelper const&) (no debug info)
[/usr/local/Cellar/root/6.14.04_1/lib/root/libCling.so] TCling::TCling(char const*, char const*, char const* const*) (no debug info)
[/usr/local/Cellar/root/6.14.04_1/lib/root/libCling.so] CreateInterpreter (no debug info)
[/usr/local/Cellar/root/6.14.04_1/lib/root/libCore.so] TROOT::InitInterpreter() (no debug info)
[/usr/local/Cellar/root/6.14.04_1/lib/root/libCore.so] ROOT::Internal::GetROOT2() (no debug info)
[/usr/local/Cellar/root/6.14.04_1/lib/root/libCling.so] TCling__GetInterpreter (no debug info)
[/usr/local/Cellar/root/6.14.04_1/lib/root/libCling.so] RootClingMain(int, char**, bool, bool) (no debug info)
[/usr/local/Cellar/root/6.14.04_1/lib/root/libCling.so] ROOT_rootcling_Driver (no debug info)
[/usr/local/Cellar/root/6.14.04_1/bin/rootcling] main (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)
Error in <ACLiC>: Dictionary generation failed!
root [1] 

I’m kind of new to this, so I’m not really used to these kinds of problems…

Can anyone help me with this one?

Thanks in advance!

Updating Mac OS X is almost always going to break ROOT, because Apple changes things in incompatible ways. I’m afraid you will have to reinstall your whole Homebrew installation for the new version of the OS, as other packages are probably broken too. One big change is that they removed /usr/include and moved it into some different place, and any package that relied on /usr/include being there became broken. @Axel may have more to add, since he is fixing the last few issues so that ROOT can be compiled on the new Mac OS X 10.14. Cheers,

Also, see this related post if you plan to build a new ROOT:

ROOT’s master is now working; I am planning to backport to 6.14. The last remaining item is https://github.com/root-project/root/pull/2699 for unuran support (disable with -Dunuran=Off, the default).

Once the new Mac minis are out we will make sure that ROOT supports future versions of MacOS before the official release date - at the moment we simply don’t have hardware to install the betas on…

Now - you’re using Homebrew and Homebrew’s clang. I don’t know what the relationship between that and MacOS’s clang is. I’d start with updating Homebew, especially the compiler part. If echo '#include <vector>' | clang -x c++ -fsyntax-only - gives an error message (i.e. outside ROOT) then it’s worthwhile to check / ask at the Homebrew forum.

Right now homebrew is already up-to-date, so I’m trying to build a new ROOT. Are there any specific build options I need to include or can I just use the default ones?

And just to confirm, there’s no way that brew can currently and correctly install ROOT for me now, right?

Thank you once again!

We don’t maintain ROOT’s brew package. But the brew people are super helpful, so just ask them please!

And yes, installing ROOT from source is always an easy option. No special flags needed; you can use ROOT without installing it, from your build directory. Like that you don’t interfere with existing / other / unrelated ROOT installations.

Okay, it seems like I’ve managed to build ROOT. Now when I start it from its directory, it doesn’t give any erros, but when I try to compile the .cpp file, it tells me:

Error in <TRint::ProcessLine>: macro muon_histo.cpp not found in path .:/Applications/ROOT/macros

Upon seeing this, I just intuitively copied the file “muon_histo.cpp” file to the macros folder, and tried it again. The next error message was:

Info in <TMacOSXSystem::ACLiC>: creating shared library /Applications/ROOT/macros/muon_histo_cpp.so
<<< cling interactive line includer >>>:1:10: fatal error: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' file not found
#include "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/ROOT/macros/muon_histo_cpp_ACLiC_dict.cxx:40:10: fatal error: 
      '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' file not found
#include "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
clang: error: no such file or directory: '/Applications/ROOT/macros/muon_histo_cpp_ACLiC_dict.o'
Error in <ACLiC>: Compilation failed!
root [1] 

I’m kind of lost now!

Homebrew usually builds things for specific versions of Mac OS X, so if you update Mac OS X you also need to update homebrew itself. Please take a look at the bottom of this page: Common Issues — Homebrew Documentation
If after that you have the mojave bottle for ROOT and it still doesn’t work, please let us know and I’ll look into fixing the recipe if needed.

Actually I’ve already done those things. Even so, I tried them out once more after reading your reply:

MacBook-Pro-DI:~ diogopires$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
MacBook-Pro-DI:~ diogopires$ brew upgrade
==> Upgrading 1 outdated package, with result:
valgrind 3.13.0
valgrind: This formula either does not compile or function as expected on macOS
versions newer than Sierra due to an upstream incompatibility.
Error: valgrind: An unsatisfied requirement failed this build.

which gives out an error for the valgrind package, which I don’t think will be a problem regarding ROOT.

Upon doing so, I used brew to install root (I think that’s what you mean by mojave bottle (?) ):

MacBook-Pro-DI:~ diogopires$ brew install root
==> Downloading https://homebrew.bintray.com/bottles/root-6.14.04_1.mojave.bottle.tar.gz
Already downloaded: /Users/diogopires/Library/Caches/Homebrew/downloads/5a2aa4072a5063039ac7cb09d6d505e25054eb91fd28d730aa1f0136a03795a0--root-6.14.04_1.mojave.bottle.tar.gz
==> Pouring root-6.14.04_1.mojave.bottle.tar.gz
Warning: root dependency gcc was built with a different C++ standard
library (libstdc++ from clang). This may cause problems at runtime.
==> Caveats
Because ROOT depends on several installation-dependent
environment variables to function properly, you should
add the following commands to your shell initialization
script (.bashrc/.profile/etc.), or call them directly
before using ROOT.

For bash users:
  . /usr/local/bin/thisroot.sh
For zsh users:
  pushd /usr/local >/dev/null; . bin/thisroot.sh; popd >/dev/null
For csh/tcsh users:
  source /usr/local/bin/thisroot.csh

Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/root
==> Summary
🍺  /usr/local/Cellar/root/6.14.04_1: 5,496 files, 285.3MB

and then I tried to run it:

MacBook-Pro-DI:~ diogopires$ . /usr/local/bin/thisroot.sh
MacBook-Pro-DI:~ diogopires$ root
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
  LC_ALL=C /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++   -O2 -DNDEBUG -xc++ -E -v /dev/null 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | GREP_OPTIONS= grep -E "(c|g)\+\+"
Results was:
With exit code 256
input_line_1:1:10: fatal error: 'new' file not found
#include <new>
         ^~~~~
input_line_3:37:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
   ------------------------------------------------------------
  | Welcome to ROOT 6.14/04                http://root.cern.ch |
  |                               (c) 1995-2018, The ROOT Team |
  | Built for macosx64                                         |
  | From tags/v6-14-04@v6-14-04, Aug 23 2018, 17:00:44         |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

input_line_9:1:10: fatal error: 'iostream' file not found
#include <iostream>
         ^~~~~~~~~~
root [0] 

So I got same error :frowning:

I see. Do you have the package /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14. pkg installed?

I’m afraid I don’t know…How can I check that?

I ran this, is this it?

MacBook-Pro-DI:~ diogopires$ pkgutil --pkgs
com.apple.pkg.CLTools_Executables
com.apple.pkg.IncompatibleAppList.10_14.16U1574
com.apple.pkg.EmbeddedOSFirmware
com.apple.pkg.CLTools_SDK_macOSSDK
com.apple.pkg.GatekeeperConfigData.16U1602
com.apple.pkg.MobileDevice
com.apple.pkg.iTunesX
com.apple.pkg.CoreADI
com.apple.pkg.CustomVoiceUpdate_en_US_nora.16U1535
com.apple.pkg.CLTools_SDK_macOS1013
com.apple.pkg.SecureBoot
com.apple.pkg.CLTools_SDK_macOS1014
com.apple.pkg.MobileDeviceDevelopment
com.apple.pkg.InstallAssistantAuto
com.apple.pkg.SafariTechPreview
com.apple.pkg.iTunesAccess
com.apple.pkg.XcodeSystemResources
com.apple.pkg.Core
com.apple.pkg.CoreFP
com.adobe.acrobat.AcrobatDCUpd1801120058
com.ROOT project.ROOT.extra-headers
com.ROOT project.ROOT.clangFrontend
com.ROOT project.ROOT.clangSema
com.ROOT project.ROOT.LLVMCoroutines
com.ROOT project.ROOT.applications
com.ROOT project.ROOT.LLVMX86Utils
com.ROOT project.ROOT.cmake-exports
com.ROOT project.ROOT.LLVMObject
com.adobe.RdrServicesUpdater
com.ROOT project.ROOT.LLVMIRReader
com.ROOT project.ROOT.LLVMX86CodeGen
com.ROOT project.ROOT.LLVMCore
com.ROOT project.ROOT.LLVMXRay
com.ROOT project.ROOT.LLVMBitReader
com.ROOT project.ROOT.clangAST
com.ROOT project.ROOT.LLVMMIRParser
com.ROOT project.ROOT.clang-headers
com.ROOT project.ROOT.LLVMPasses
com.ROOT project.ROOT.llvm-headers
com.ROOT project.ROOT.LLVMLTO
com.ROOT project.ROOT.LLVMTransformUtils
com.ROOT project.ROOT.LLVMDemangle
com.ROOT project.ROOT.LLVMInstrumentation
com.ROOT project.ROOT.opt-viewer
com.ROOT project.ROOT.LLVMInterpreter
com.microsoft.pkg.licensing.volume
com.adobe.acrobat.AcrobatDCUpd1801120063
com.ROOT project.ROOT.LLVMDebugInfoPDB
com.ROOT project.ROOT.LLVMLinker
com.ROOT project.ROOT.LLVMMCDisassembler
com.ROOT project.ROOT.clangAnalysis
com.ROOT project.ROOT.LLVMCoverage
com.microsoft.package.Microsoft_Excel.app
com.ROOT project.ROOT.LLVMX86AsmPrinter
com.ROOT project.ROOT.LLVMLibDriver
com.ROOT project.ROOT.LLVMAnalysis
com.ROOT project.ROOT.tests
com.ROOT project.ROOT.Unspecified
com.ROOT project.ROOT.LLVMRuntimeDyld
com.ROOT project.ROOT.LLVMBitWriter
com.adobe.PDApp.AdobeApplicationManager.installer.pkg
com.ROOT project.ROOT.clingUtils
com.ROOT project.ROOT.LLVMGlobalISel
com.ROOT project.ROOT.LLVMScalarOpts
com.ROOT project.ROOT.clangBasic
com.ROOT project.ROOT.LLVMX86Desc
com.ROOT project.ROOT.libraries
com.ROOT project.ROOT.clangParse
com.adobe.pkg.FlashPlayer
com.ROOT project.ROOT.LLVMObjCARCOpts
com.ROOT project.ROOT.clangRewriteFrontend
com.ROOT project.ROOT.LLVMMCParser
com.ROOT project.ROOT.clangFormat
com.ROOT project.ROOT.clangSerialization
com.microsoft.package.Microsoft_Word.app
com.ROOT project.ROOT.LLVMDlltoolDriver
com.ROOT project.ROOT.LLVMObjectYAML
com.ROOT project.ROOT.LLVMDebugInfoDWARF
com.ROOT project.ROOT.LLVMMCJIT
com.adobe.acrobat.AcroRdrDCUpd1801120063_MUI
com.ROOT project.ROOT.LLVMSupport
com.ROOT project.ROOT.LLVMDebugInfoCodeView
com.microsoft.package.Microsoft_OneNote.app
com.apple.pkg.Pages7
com.ROOT project.ROOT.LLVMAsmPrinter
com.microsoft.package.Microsoft_Outlook.app
com.ROOT project.ROOT.clangToolingCore
desktop.WhatsApp
com.ROOT project.ROOT.clangIndex
com.ROOT project.ROOT.LLVMX86AsmParser
com.ROOT project.ROOT.LLVMSymbolize
com.ROOT project.ROOT.clangToolingRefactor
com.ROOT project.ROOT.LLVMMC
com.apple.pkg.Xcode
com.ROOT project.ROOT.clangDynamicASTMatchers
com.adobe.AcroServicesUpdater
com.ROOT project.ROOT.LLVMX86Disassembler
com.ROOT project.ROOT.headers
com.microsoft.package.Microsoft_AutoUpdate.app
com.ROOT project.ROOT.LLVMX86Info
com.ROOT project.ROOT.clingInterpreter
com.ROOT project.ROOT.clangASTMatchers
com.ROOT project.ROOT.clangTooling
com.ROOT project.ROOT.clangLex
com.ROOT project.ROOT.clangFrontendTool
com.apple.pkg.Keynote8
com.adobe.acrobat.AcroRdrDCUpd1801120058_MUI
com.ROOT project.ROOT.clang
com.ROOT project.ROOT.LLVMTableGen
com.microsoft.rdc.mac
com.ROOT project.ROOT.LLVMProfileData
com.ROOT project.ROOT.LLVMInstCombine
com.ROOT project.ROOT.LLVMSelectionDAG
com.microsoft.pkg.licensing
com.ROOT project.ROOT.LLVMOption
com.ROOT project.ROOT.LTO
com.ROOT project.ROOT.LLVMBinaryFormat
com.ROOT project.ROOT.LLVMipo
com.ROOT project.ROOT.LLVMCodeGen
com.ROOT project.ROOT.LLVMExecutionEngine
com.apple.pkg.Numbers5
com.ROOT project.ROOT.clangEdit
com.ROOT project.ROOT.LLVMDebugInfoMSF
com.ROOT project.ROOT.clangDriver
com.ROOT project.ROOT.clangCodeGen
com.ROOT project.ROOT.LLVMAsmParser
com.ROOT project.ROOT.LLVMLineEditor
com.ROOT project.ROOT.LLVMTarget
com.ROOT project.ROOT.clangRewrite
com.ROOT project.ROOT.LLVMOrcJIT
com.ROOT project.ROOT.LLVMVectorize
com.microsoft.package.Microsoft_PowerPoint.app
com.ROOT project.ROOT.clingMetaProcessor

Try double-clicking the file, that will make sure it will be installed.

I’m sorry, I’m afraid I dont’ follow :slightly_frowning_face: Which file should I click on? And where is it located?

I meant to try opening the file /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14. pkg and installing it by double clicking on it in Finder.

Done, what should i do now? I tried running root once again, but it gave out the same error.

Then I don’t know. You will probably need to update to the latest master, as that has the fixes for the latest version of Mac OS X.

And how can I do that? Anyhow, thank you both for your availability and help :slight_smile:

Please take a look at https://root.cern/building-root. In short, you need to do something like shown below:

$ git clone https://github.com/root-project/root
$ mkdir build
$ cd build
$ cmake ../root
$ cmake --build .

Okay I’ve done it this morning, but I guess one more try won’t hurt :slight_smile:

One more thing, after building it this morning, I tried to compile the .cpp file, but it gave out the following:

root [0] .L muon_histo.cpp++
Info in <TMacOSXSystem::ACLiC>: creating shared library /Applications/ROOT/macros/muon_histo_cpp.so
<<< cling interactive line includer >>>:1:10: fatal error: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' file not found
#include "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/ROOT/macros/muon_histo_cpp_ACLiC_dict.cxx:40:10: fatal error: 
      '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' file not found
#include "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
clang: error: no such file or directory: '/Applications/ROOT/macros/muon_histo_cpp_ACLiC_dict.o'
Error in <ACLiC>: Compilation failed!

Can I do something else? Or just go ahead and update it to the latest master as you said?