ROOT 6.11.02 does not compile on Xcode 9.1, macOS 10.13.1

Hi,

I am trying to compile ROOT 6.11.02 from source on my macbook, running macOS 10.13.1 and Xcode 9.1, using a fresh build directory (I have a working build done with Xcode 8 that I don’t want to spoil).

However I cannot go past this error

Scanning dependencies of target G__Core
[ 53%] Generating G__Core.cxx, ../../lib/libCore.rootmap, ../../lib/Core.pcm
fatal error: virtual filesystem overlay file '/root_build_v6-11-02/include/modulemap.overlay.yaml' not found
Compiler error to early in initialization.
Compiler instance could not be created.
Segmentation fault
make[2]: *** [core/base/G__Core.cxx] Error 1
make[1]: *** [core/base/CMakeFiles/G__Core.dir/all] Error 2
make: *** [all] Error 2

and in fact the /root_build_v6-11-02/include/modulemap.overlay.yaml file is missing from the build directory.

This is my compiler version

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.38)
Target: x86_64-apple-darwin17.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I have browsed the forum and found a number of problems with the latest update of Xcode to version 9, but none seems to look like this and anyways this recent version of ROOT should already include all the fixes.

Do you have any ideas?

Thanks!
Ric

This might be a problem with our CMake build script. You can fix it for now by just creating the missing modulemap.overlay.yaml with these contents:

{'version' : 0, 'roots' : []}

thanks for the hint.

Just tried, it does something, but fails again

[ 53%] Generating G__Core.cxx, ../../lib/libCore.rootmap, ../../lib/Core.pcm
input_line_1:1:10: remark: building module 'std' as '/root_build_v6-11-02/lib/std.pcm' [-Rmodule-build]
#include <new>
         ^
input_line_1:1:10: remark: finished building module 'std' [-Rmodule-build]
Error in <GenerateModule>: Couldn't find module with name 'Core' in modulemap!
make[2]: *** [core/base/G__Core.cxx] Error 1
make[1]: *** [core/base/CMakeFiles/G__Core.dir/all] Error 2
make: *** [all] Error 2

Did you maybe enable the build option -Dcxxmodules=On or -Druntime_cxxmodules=On somehow? Also, can you run make with make VERBOSE=1 and post the output that I can see how rootcling is invoked?

To give more context: Somehow ROOT tries to build with the experimental C++ modules features activated. This happens if you somehow have a ROOT_MODULES environment variable defined in your shell or you configured CMake with -Druntime_cxxmodules=On.

Did you maybe enable the build option -Dcxxmodules=On or -Druntime_cxxmodules=On somehow?

yeah, I found out they were enabled. I used ccmake to config the few things I definitely want to include, not sure how and why cxxmodules and runtime_cxxmodules were on, since I don’t even know what they are supposed to do.

Now I set them to OFF and that error is solved.

…but, let me profit from the current thread, I bump into another one

Scanning dependencies of target MetaCling
[ 69%] Building CXX object core/metacling/src/CMakeFiles/MetaCling.dir/TCling.cxx.o
/root/core/metacling/src/TCling.cxx:1161:29: error: ambiguous conversion for functional-style cast from 'const TString' to 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >')
      std::string vfsPath = std::string(TROOT::GetIncludeDir()) + "/modulemap.overlay.yaml";
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:778:31: note: candidate constructor
    _LIBCPP_INLINE_VISIBILITY basic_string(const value_type* __s);
                              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:799:5: note: candidate constructor
    basic_string(__self_view __sv);
    ^
1 error generated.
make[2]: *** [core/metacling/src/CMakeFiles/MetaCling.dir/TCling.cxx.o] Error 1
make[1]: *** [core/metacling/src/CMakeFiles/MetaCling.dir/all] Error 2
make: *** [all] Error 2

this error looks similar to the one reported here
https://sft.its.cern.ch/jira/browse/ROOT-9020

let me see if the patch proposed there is in v6.11.02 or I need to apply it on top

This (should) apply the correct patch in the src directory: curl "https://pastebin.com/raw/9iqcfcEE" | patch -p1

(Actually not sure if there are more similar issues, but that patch at least brings it to the version we have in upstream).

all good, it compiled, thanks a lot!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.