LoginSignup
1
2

More than 5 years have passed since last update.

ROOTをMacにインストールしたときのエラー対処メモ

Last updated at Posted at 2019-02-26

MacにROOTをインストールする

はじめに

CERNが開発しているデータ分析ソフトであるROOTをMacにインストールしたときにエラーが出たので、その時の対処方法メモ。

Linuxへのインストールはこちらを参考までに。
https://qiita.com/dyamaguc/items/2f723cbc304c4debd82e

自分の環境は次の通り。
- Mac Book Air
- Mac OS X 10.13.6
- Xcodeやコンパイラはインストール済み

インストール

ROOTをこちらのページからダウンロード。
https://root.cern.ch/content/release-61406
今回は
root_v6.14.06.macosx64-10.13-clang100.dmg
このファイルをダウンロードした。
その後、ダウンロードしたファイルをダブルクリックして、インストーラーを起動。
デフォルトのまま進めてインストール自体は完了。

Pathを通す

このインストーラーを使用すると、ROOTは
/Applications/root_v6.14.06
にインストールされる。
ターミナルを開いて、
source /Applications/root_v6.14.06/bin/thisroot.sh
とコマンドを打てば、ROOTの準備は完了。
.bash_profileに上のコマンドを書いておくのがおすすめ)

ROOTを起動とエラー内容

ターミナルを開いて、
rootコマンドをたたくと、次のようなメッセージが表示された。

$root
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
  LC_ALL=C /Library/Developer/CommandLineTools/usr/bin/c++   -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/06                http://root.cern.ch |
  |                               (c) 1995-2018, The ROOT Team |
  | Built for macosx64                                         |
  | From tags/v6-14-06@v6-14-06, Nov 05 2018, 10:35:04         |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

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

なんだかライブラリを読み込めていなさそう...

調べてみたところ、こちらのQAを読むと...
https://root-forum.cern.ch/t/cannot-extract-standard-library-include-paths/27494/6

$xcode-select --install
というコマンドで解決したそうな。

ターミナルを開いて、このコマンドを実行。インストールするか?と聞かれるので、インストールボタンを押す。
しばらく(5分程度)でインストール完了。
ターミナルを起動し直して、再びrootコマンドをたたくと

$root
   ------------------------------------------------------------
  | Welcome to ROOT 6.14/06                http://root.cern.ch |
  |                               (c) 1995-2018, The ROOT Team |
  | Built for macosx64                                         |
  | From tags/v6-14-06@v6-14-06, Nov 05 2018, 10:35:04         |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

root [0] 

直った!

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2