Fatal error modified `<new>`

Hi,
when I run ROOT I get this:

Air-di-Mattia:~ mattia$ root
input_line_1:1:10: fatal error: file
      '/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/new'
      modified since it was first processed
#include <new>
         ^
input_line_3:38:10: fatal error: file
      '/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/string'
      modified since it was first processed
#include <string>
         ^
   ------------------------------------------------------------
  | Welcome to ROOT 6.06/00                [root.cern.ch](http://root.cern.ch) |
  |                               (c) 1995-2014, The ROOT Team |
  | Built for macosx64                                         |
  | From tag v6-06-00, 9 December 2015                         |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

input_line_8:1:10: fatal error: file
      '/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iostream'
      modified since it was first processed
#include <iostream>
         ^
root [0] 

I installed ROOT on last December and I’ve never had such a problem, how can I solve it?

It appears that you have updated xcode.
You should get a consistent ROOT distribution or reconfigure it and recompile it.

Cheers,
Danilo

Hi,

so more concretely, I mean following these instructions: root.cern.ch/building-root

Let’s take ROOT 6.06.06: root.cern.ch/content/release-60606
Now, a possibility is to go for a pre-built binary, either as tarball or as dmg. The dmg can be installed as every other osx package while the tarball just uncompressed.

For what concerns the build from sources, this is the recipe, always 6.06/06, always looking at this page root.cern.ch/content/release-60606

mkdir myROOT; cd myROOT
git clone http://root.cern.ch/git/root.git
cd root
git checkout -b v6-06-06 v6-06-06
cd ..
mkdir build
cd build
echo This takes some seconds. This is the configure step
cmake ../root
echo This takes some minutes. This is the build step. Feel free to increase the number of cores used according to the machine your are building on.
make -j 4

Cheers,
Danilo

Hi,
I installed CMake and followed your recipe, during the build step I got this warning:

/Users/mattia/Applications/myROOT/root/interpreter/llvm/src/include/llvm/ADT/APFloat.h:352:12: warning:
redundant move in return statement [-Wredundant-move]
return std::move(Value);
^
/Users/mattia/Applications/myROOT/root/interpreter/llvm/src/include/llvm/ADT/APFloat.h:352:12: note:
remove std::move call here
return std::move(Value);
^~~~~~~~~~ ~
1 warning generated.

Is that a problem?

Before I can start ROOT do I have to setup the environment? If so, can you help me?

Last thing: I didn’t uninstall the older version of ROOT, can I do it later when I see that the new version works?

Hi Mattia,

this is not a problem.
You can setup root with this command

. my/path/to/root/bin/thisroot.sh

to see what command is being executed you can resort to standard unix utils such as which:

which root

and check the path.

I did it! :mrgreen:
You have been so helpful and kind, thank you a lot.
Cheers,
Mattia.

I’ve attempted to install ROOT v6.06.06 on a fresh install of CentOS 7 with gcc v4.8 by using the binary distributions. I’ve installed the binaries to /opt/root/root_v6.06.06 and use the following line to setup the environment.

Upon starting root I get the following messages

input_line_1:1:10: fatal error: 'new' file not found
#include <new>
         ^
input_line_3:38:10: fatal error: 'string' file not found
#include <string>
         ^
   -------------------------------------------------------------------------
  | Welcome to ROOT 6.06/06                             http://root.cern.ch |
  |                                            (c) 1995-2016, The ROOT Team |
  | Built for linuxx8664gcc                                                 |
  | From heads/v6-06-00-patches@v6-06-04-66-gb9c1d82, Jul 06 2016, 18:28:55 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'              |
   -------------------------------------------------------------------------

input_line_7:1:10: fatal error: 'iostream' file not found
#include <iostream>
         ^

I’ve also seen these same messages when using the package root-6.06.06-2.el7.x86_64 from the epel repository.

Does anyone have any ideas or suggestions on how to resolve these messages? I’ve attempted to build ROOT from the source distribution, but have run into a separate issue there.

Hi,

the development files of the stl library do not seem to be there. Did you install the required development packages?

Cheers,
D

I had thought I had installed them all. I must have missed one. Any idea which is causing this?

I’ve run into the same issue trying to build from the source code. Both autoconfigure and cmake do not identify any missing dependencies, but the compilation has the following error.

input_line_1:1:10: fatal error: 'new' file not found #include <new> ^

I’ve confirmed that I have all the required dependencies as listed on https://root.cern.ch/build-prerequisites for a CentOS 7 system. Still the error persists. Any further advice?

What do you get when you type:
root-config --cxx
root-config --cxx --version
root-config --prefix
root-config --cflags
root-config --libs

Here is the output of a number of root-config commands.

root-config --cxx
c++
root-config --version
6.06/06
root-config --cflags
-pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/opt/root/root_v6.06.06/include
root-config --ldflags
-m64
root-config --libs
-L/opt/root/root_v6.06.06/lib -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -pthread -lm -ldl -rdynamic
root-config --config
COMERR_LIBRARY=/usr/lib64/libcom_err.so JPEG_INCLUDE_DIR=/usr/include JPEG_LIBRARY=/usr/lib64/libjpeg.so KRB5_INCLUDE_DIR=/usr/include/krb5 KRB5_LIBRARY=/usr/lib64/libkrb5.so KRB5_MIT_LIBRARY=/usr/lib64/libk5crypto.so LIBXML2_INCLUDE_DIR=/usr/include/libxml2 LIBXML2_LIBRARIES=/usr/lib64/libxml2.so OPENGL_INCLUDE_DIR=/usr/include OPENGL_gl_LIBRARY=/usr/lib64/libGL.so OPENGL_glu_LIBRARY=/usr/lib64/libGLU.so OPENSSL_CRYPTO_LIBRARY=/usr/lib64/libcrypto.so OPENSSL_INCLUDE_DIR=/usr/include OPENSSL_SSL_LIBRARY=/usr/lib64/libssl.so PC_LIBXML_INCLUDEDIR=/usr/include PC_LIBXML_INCLUDE_DIRS=/usr/include/libxml2 PC_LIBXML_LIBRARIES=xml2 PC_LIBXML_STATIC_INCLUDE_DIRS=/usr/include/libxml2 PNG_LIBRARY=/usr/lib64/libpng.so PNG_LIBRARY_RELEASE=/usr/lib64/libpng.so PNG_PNG_INCLUDE_DIR=/usr/include PYTHON_INCLUDE_DIR=/usr/include/python2.7 PYTHON_LIBRARY=/usr/lib64/libpython2.7.so PYTHON_LIBRARY_RELEASE=/usr/lib64/libpython2.7.so X11_ICE_INCLUDE_PATH=/usr/include X11_SM_INCLUDE_PATH=/usr/include X11_X11_INCLUDE_PATH=/usr/include X11_XShm_INCLUDE_PATH=/usr/include X11_XSync_INCLUDE_PATH=/usr/include X11_Xaccessstr_INCLUDE_PATH=/usr/include X11_Xau_INCLUDE_PATH=/usr/include X11_Xdamage_INCLUDE_PATH=/usr/include X11_Xdmcp_INCLUDE_PATH=/usr/include X11_Xfixes_INCLUDE_PATH=/usr/include X11_Xft_INCLUDE_PATH=/usr/include X11_Xkb_INCLUDE_PATH=/usr/include X11_Xkblib_INCLUDE_PATH=/usr/include X11_Xlib_INCLUDE_PATH=/usr/include X11_Xmu_INCLUDE_PATH=/usr/include X11_Xpm_INCLUDE_PATH=/usr/include X11_Xrender_INCLUDE_PATH=/usr/include X11_Xshape_INCLUDE_PATH=/usr/include X11_Xt_INCLUDE_PATH=/usr/include X11_Xutil_INCLUDE_PATH=/usr/include X11_dpms_INCLUDE_PATH=/usr/include X11_xf86misc_INCLUDE_PATH=/usr/include X11_xf86vmode_INCLUDE_PATH=/usr/include ZLIB_INCLUDE_DIR=/usr/include ZLIB_LIBRARY=/usr/lib64/libz.so

root-config --cxx --version

Sorry I thought that was a mistype.

`root-config --cxx` --version
c++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[url=https://root-forum.cern.ch/t/trouble-compiling-root-6/21722/2 building your ROOT, did you remember to keep the “source code” tree completely separate from your “build” tree (and also from the “install” tree)?[/url]

Yes I have kept them separate. Remember I also observe this issue when getting root from the yum package manager and by trying to the the binary distribution.

I’ve attached the output of cmake if it may be helpful.
configure.txt (5.85 KB)

Try the procedure (modify only ROOT_INSTALL_DIR="/opt/root/root_v6.06.06"): Trouble compiling ROOT 6

It took some time, but I used your script without changing anything. The output is attached, but the relevent piece is that the same compile error was given.

[ 38%] Generating G__IO.cxx, ../../lib/libRIO.rootmap
input_line_1:1:10: fatal error: 'new' file not found
#include <new>
         ^
/bin/sh: line 1: 26859 Segmentation fault      (core dumped) ../../bin/rootcling_tmp -f G__IO.cxx -s /tmp/root-build/lib/libRIO.so -rml libRIO.so -rmf /tmp/root-build/lib/libRIO.rootmap -I/tmp/root-6.06.06 -I/tmp/root-build/include TZIPFile.h TVirtualObject.h TVirtualCollectionIterators.h TVirtualArray.h TStreamerInfoActions.h TStreamerInfo.h TMemFile.h TMapFile.h TMakeProject.h TLockFile.h TKeyMapFile.h TKey.h TGenCollectionStreamer.h TGenCollectionProxy.h TFree.h TFilePrefetch.h TFileMerger.h TFileCacheWrite.h TFileCacheRead.h TFile.h TFPBlock.h TEmulatedMapProxy.h TEmulatedCollectionProxy.h TDirectoryFile.h TContainerConverters.h TCollectionProxyFactory.h TBufferFile.h TArchiveFile.h /tmp/root-6.06.06/io/io/inc/LinkDef.h
gmake[2]: *** [io/io/G__IO.cxx] Error 139
gmake[1]: *** [io/io/CMakeFiles/G__IO.dir/all] Error 2
gmake: *** [all] Error 2

scriptout.txt (324 KB)

It was mentioned by mato in [url]Cannot install ROOT. Make problem? - #9 by ksmith that it may be related to gcc from “Developer Toolset” or “Software Collections”. How do I know if I have installed gcc from these locations? I have used the gcc-4.8.5-4.el7.x86_64 package from the CentOS 7 base repo.