Error compiling ROOT5.34.36 OSX Sierra with Apple Clang

Hi everyone,

I’m trying to compile ROOT v5.34.36 on OSX Sierra with the Apple Clang compiler (./configure and make) but I get this error:

In file included from /Users/luigipertoldi/Programmi/root_v5.34.36/cint/cint/src/dict/gcc4strm.h:30:
cint/cint/lib/gcc4strm/iostrm.h:85:17: error: no type named '__streambuf_type' in 'std::__1::basic_ostream<char>'
static ostream::__streambuf_type *G__store_cout;
       ~~~~~~~~~^

And other similars. I also followed the suggestions in this post [url]Error compiling ROOT 5 on Mac OS X Yosemite with no success. Has someone managed to compile it with my same environment?

Please use CMake. Instructions are in root.cern.ch/building-root.

Thanks, I was sure the (./configure && make) instruction would have been working the same. What if I want to compile it with my gcc4.8 (I need it as a dependency for a program that only compiles with gcc4.8)? I added the

-DCMAKE_CXX_COMPILER=/usr/local/bin/c++-4.8 
-DCMAKE_C_COMPILER=/usr/local/bin/gcc-4.8 
-DCMAKE_Fortran_COMPILER=/usr/local/bin/gfortran-4.8

in the cmake instruction but the compilation fails at he very beginning:

<stdin>:56591:2: error: ambiguous instructions require an explicit suffix (could be 'fisttps', or 'fisttpl')
        fisttp  -10(%rsp)
        ^

What am I missing?

I have no idea what the problem could be. Can you provide the full information? The exact configuration command, the full output, any environment variable like CXXFLAGS?
Thanks,

Pere

The configuration instruction is as simple as it seems:

cmake ../root -DCMAKE_CXX_COMPILER=/usr/local/bin/c++-4.8 -DCMAKE_C_COMPILER=/usr/local/bin/gcc-4.8 -DCMAKE_Fortran_COMPILER=/usr/local/bin/gfortran-4.8

run in the build directory.

My gcc is:

$ gcc-4.8 --version gcc-4.8 (Homebrew gcc48 4.8.5 --without-multilib) 4.8.5 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.

And you can find the output of the cmake command in the attachments for other details, Is it enough? Thanks
confout.txt (8.37 KB)

Not sure if it will help, but in debian wheezy it worked for me after doing sth like:

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE
export LD_LIBRARY_PATH=/usr/local/lib64/
#(or the path where the gcc related libs are located)
cmake ../root -DCMAKE_CXX_COMPILER=/usr/local/bin/c++-4.8 -DCMAKE_C_COMPILER=/usr/local/bin/gcc-4.8 -DCMAKE_Fortran_COMPILER=/usr/local/bin/gfortran-4.8
make

Check ROOT 6 build from source error gcc 4.7.2

You could also post the output of “printenv”.

Thanks. The configuration, so far so good. Where the problem actually happens during the make step?

<stdin>:56591:2: error: ambiguous instructions require an explicit suffix (could be 'fisttps', or 'fisttpl')
        fisttp  -10(%rsp)
        ^

Here the complete output:

$ make
[  0%] Built target IOSENUM_H
[  0%] Built target move_headers
[  0%] Building CXX object cint/cint/CMakeFiles/Cint_static.dir/src/newlink.cxx.o
<stdin>:52421:2: error: ambiguous instructions require an explicit suffix (could be 'fisttps', or 'fisttpl')
        fisttp  -10(%rsp)
        ^
<stdin>:52526:2: error: ambiguous instructions require an explicit suffix (could be 'fisttps', or 'fisttpl')
        fisttp  -10(%rsp)
        ^
<stdin>:52985:2: error: ambiguous instructions require an explicit suffix (could be 'fisttps', or 'fisttpl')
        fisttp  -10(%rsp)
        ^
<stdin>:54571:2: error: ambiguous instructions require an explicit suffix (could be 'filds', or 'fildl')
        fild    -18(%rsp)
        ^
<stdin>:54591:2: error: ambiguous instructions require an explicit suffix (could be 'filds', or 'fildl')
        fild    (%rdi)
        ^
<stdin>:54610:2: error: ambiguous instructions require an explicit suffix (could be 'filds', or 'fildl')
        fild    -18(%rsp)
        ^
make[2]: *** [cint/cint/CMakeFiles/Cint_static.dir/src/newlink.cxx.o] Error 1
make[1]: *** [cint/cint/CMakeFiles/Cint_static.dir/all] Error 2
make: *** [all] Error 2

Trying to reproduce the problem…

…and managed to?

Yes. I have installed gcc-48 and I can reproduce. Still not understanding what’s wrong. It looks like there is a conflict between the compiler generated assembler and the assembler tool used by the compiler.

Don’t know if this helps:

gcc.gnu.org/bugzilla/show_bug.cgi?id=66509
github.com/dreal/dreal3/issues/179
github.com/Homebrew/legacy-home … sues/41633

I was looking at exactly the same posts. Yes, it seems a bug in gcc that is generating assembly code that the clang assembler cannot digest. The test case for gcc.gnu.org/bugzilla/show_bug.cgi?id=64540 fails for this version of gcc-4.8 installed by Homebrew.

mmmmh ok, then I suppose there’s nothing I can do… I’ll try another approach to my problem. Thanks a lot!

You can get root in Sierra using macports. Install it and

sudo port install root5

installs a copy of root.5.34.37 in /opt/local/libexec/root5

Good to know, I’m not a fan of MacPorts but I’ll give it a try! Thanks for the info