Homebrew-core: Root installed from Homebrew doesn't work under MacOS 10.14

Created on 12 Oct 2018  路  13Comments  路  Source: Homebrew/homebrew-core

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • [x] are reporting a bug others will be able to reproduce and not asking a question. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh
  • [x] have a problem with brew install (or upgrade, reinstall) a single, official formula (not cask)? If it's a general brew problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new/choose. If it's a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • [x] ran brew update and can still reproduce the problem?
  • [x] ran brew doctor, fixed all issues and can still reproduce the problem?
  • [x] ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?

PN-BG-MACRM:~ RM$ brew gist-logs root
Error: No logs.

  • [x] if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

I put it here. There is some output due to me having installed clhep on my own:
https://pastebin.com/9G2aWYRv

To help us debug your issue please explain:

  • What you were trying to do (and why)
    Installing root
  • What happened (include command output)
    There was a warning at install:

==> 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.

When trying to run root. I get this error:

PN-BG-MACRM:~ RM$ root -l
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 Results was:
With exit code 256
input_line_1:1:10: fatal error: 'new' file not found

include

     ^~~~~

input_line_3:37:10: fatal error: 'string' file not found

include

     ^~~~~~~~

input_line_9:1:10: fatal error: 'iostream' file not found

include

     ^~~~~~~~~~

root [0]

  • What you expected to happen
    I expected not to see STL errors.

  • Step-by-step reproduction instructions (by running brew install commands)

brew install root
. /usr/local/bin/thisroot.sh
root -l

Additional information:

The package installed is: https://homebrew.bintray.com/bottles/root-6.14.04_1.mojave.bottle.tar.gz

XCode and command line tools are installed and up-to-date.

I have tried installing the SDK headers:
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14. pkg
That doesn't solve the problem.

10.14 outdated

Most helpful comment

Fixed!

All 13 comments

I'm on macOS 10.14 and have the same warning and problem too.

  1. The warning _鈥渞oot dependency gcc was built with a different C++ standard
    library鈥漘 is irrelevant here.

  2. The error is because in include/root/compiledata.h, root is recording the full PATH to homebrew's compiler shim: #define COMPILER "/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++" which it should not. This is then stored into lib/root/libProof.so, and other object files.

Can you report the issue at https://root-forum.cern.ch/ ?

I've reported it in their bug tracker:

https://sft.its.cern.ch/jira/projects/ROOT/issues/ROOT-9726?filter=allissues

The claim there is that:

The information in compiledata.h is about the compiler location is for information only and is not used at run-time. Actually compiledata.h should be something like:

#define CXX "c++"
#define COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++"

where CXX is used and does not have a path and COMPILER has a path and is not used (except for forensic investigation trying to understanding why a particular build is not working as expected).

So far, I'm running in cirkles here...

@rasmack I have replied directly in the ROOT bug report

Building from source on Mojave, I am seeing a further issue: https://sft.its.cern.ch/jira/browse/ROOT-9734

Note: the original issue (clang++) is fixed by passing -DCLING_CXX_PATH=clang++ to cmake. But the xml2 issue (https://sft.its.cern.ch/jira/browse/ROOT-9734) also needs to be fixed.

Pinging @amadio here: the davix support you added in https://github.com/Homebrew/homebrew-core/pull/27925 is now causing trouble, due to a failure to find libxml2 on recent Mojave versions: https://sft.its.cern.ch/jira/browse/ROOT-9734

Given how complex ROOT's cmake hierarchy is, I have not been able to debug, and the only option I can see at this point is to disable davix. Before we reach that point, I thought maybe you could provide some assistance? Thanks.

Where does libxml2 come from? Also, what directories are listed in libxml2-config.cmake that is installed with it? This looks like the library was configured with prefix /usr for installation, but the headers were then moved away in Mojave to the SDK directory. In High Sierra, the directory /usr/include/libxml2 exists.

@amadio On Mojave:

  • system libxml2 is installed in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib
  • the headers are in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2
  • the library can also be found in /usr/lib/libxml2 if you have command-line tools installed
  • but /usr/include does not exist in any case.

xml2-config gives the correct values:

$ xml2-config --libs
-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm
$ xml2-config --cflags
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2

There is no libxml2-config.cmake file installed anywhere.

Additional information, copied from the bug report at https://sft.its.cern.ch/jira/browse/ROOT-9734:

  • LIBXML2_INCLUDE_DIR has correct path
  • but all PC_LIBXML_ values get incorrectly detected

This looks like a problem with CMake itself. We do not have a FindLibXMl2.cmake anywhere, neither does Davix, so the wrong values must come from find_package(LibXml2) in CMake. On Linux, there is a pkg-config file distributed with libxml2, but on High Sierra, I cannot find one. Is there a pkgconfig file for libxml2 in your /usr/local/lib/pkgconfig directory? That might explain the difference. I see that Homebrew does have a package for libxml2. Something is confusing CMake, but I don't think we (i.e. ROOT) are at fault for this particular problem.

Homebrew does provide a .pc file for system libxml2, and therein lies the issue: https://github.com/Homebrew/brew/issues/5068
Thanks for helping me figure it out @amadio!

Fixed!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xeoneux picture xeoneux  路  3Comments

yuna9 picture yuna9  路  4Comments

faraazkhan picture faraazkhan  路  3Comments

daviderestivo picture daviderestivo  路  4Comments

gregvirgin picture gregvirgin  路  3Comments