Problem building ROOT from source on mac os 10.15 (Catalina)


Please read tips for efficient and successful posting and posting code

ROOT Version: V6-19-01
Platform: mac os 10.15 (Catalina)
Compiler: clang-1100.0.33.16

I followed the recipe given in this thread:

namely, after checking out the latest root version (6.19.01), I execute:

cmake -Dmacos_native=ON …/root

This produces a large number of errors in the file ./CMakeFiles/CMakeError.log. Here are the first couple:

Performing C++ SOURCE FILE Test GLIBCXX_USE_CXX11_ABI failed with the following output:
Change Dir: /Users/johnwalsh/rootgit/makeroot/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_e661b/fast"
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_e661b.dir/build.make CMakeFiles/cmTC_e661b.dir/build
Building CXX object CMakeFiles/cmTC_e661b.dir/src.cxx.o
/Library/Developer/CommandLineTools/usr/bin/c++    -std=c++11 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++ -DGLIBCXX_USE_CXX11_ABI -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -std=c++11 -o CMakeFiles/cmTC_e661b.dir/src.cxx.o -c /Users/johnwalsh/rootgit/makeroot/CMakeFiles/CMakeTmp/src.cxx
/Users/johnwalsh/rootgit/makeroot/CMakeFiles/CMakeTmp/src.cxx:4:4: error: NOCXX11
  #error NOCXX11
   ^
1 error generated.
make[1]: *** [CMakeFiles/cmTC_e661b.dir/src.cxx.o] Error 1
make: *** [cmTC_e661b/fast] Error 2

Source file was:

#include <string>
#if _GLIBCXX_USE_CXX11_ABI == 0
  #error NOCXX11
#endif
int main() {}

Determining if the function uuid_generate_random exists in the uuid failed with the following output:
Change Dir: /Users/johnwalsh/rootgit/makeroot/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_b88ca/fast"
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_b88ca.dir/build.make CMakeFiles/cmTC_b88ca.dir/build
Building C object CMakeFiles/cmTC_b88ca.dir/CheckFunctionExists.c.o
/Library/Developer/CommandLineTools/usr/bin/cc   -m64 -pipe -W -Wall -fsigned-char -fno-common -Qunused-arguments -pthread -DCHECK_FUNCTION_EXISTS=uuid_generate_random -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -o CMakeFiles/cmTC_b88ca.dir/CheckFunctionExists.c.o   -c /Applications/CMake.app/Contents/share/cmake-3.10/Modules/CheckFunctionExists.c
Linking C executable cmTC_b88ca
/Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b88ca.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/cc  -m64 -pipe -W -Wall -fsigned-char -fno-common -Qunused-arguments -pthread -DCHECK_FUNCTION_EXISTS=uuid_generate_random -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  -mmacosx-version-min=10.15  CMakeFiles/cmTC_b88ca.dir/CheckFunctionExists.c.o  -o cmTC_b88ca -luuid 
ld: library not found for -luuid
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_b88ca] Error 1
make: *** [cmTC_b88ca/fast] Error 2

```.

I'd appreciate any help you can give. 





___

Welcome back!

That error log isn’t useful - it’s CMake internal stuff and not actual errors. Could you post what the actual error message is that triggered you to think that the build fails?

Axel.

...
[ 76%] Built target RIO
Scanning dependencies of target rootcling
[ 76%] Building CXX object main/CMakeFiles/rootcling.dir/src/rootcling.cxx.o
[ 76%] Linking CXX executable ../bin/rootcling
[ 76%] Built target rootcling
Scanning dependencies of target G__Net
Scanning dependencies of target G__MathCore
[ 76%] Generating G__Net.cxx, ../../lib/libNet_rdict.pcm, ../../lib/libNet.rootmap
[ 76%] Generating G__MathCore.cxx, ../../lib/libMathCore_rdict.pcm, ../../lib/libMathCore.rootmap
warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk'
warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk'
In file included from input_line_1:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:85:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:82:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:86:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:94:
/Users/johnwalsh/root/etc/cling/lib/clang/5.0.0/include/stdlib.h:8:15: fatal error: 'stdlib.h' file not found
#include_next <stdlib.h>
              ^~~~~~~~~~
In file included from input_line_3:1:
In file included from /Users/johnwalsh/rootgit/makeroot/include/RtypesCore.h:25:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stddef.h:46:
/Users/johnwalsh/root/etc/cling/lib/clang/5.0.0/include/stddef.h:51:9: error: unknown type name '__PTRDIFF_TYPE__'
typedef __PTRDIFF_TYPE__ ptrdiff_t;
        ^
/Users/johnwalsh/root/etc/cling/lib/clang/5.0.0/include/stddef.h:62:9: error: unknown type name '__SIZE_TYPE__'
typedef __SIZE_TYPE__ size_t;
        ^
/Users/johnwalsh/root/etc/cling/lib/clang/5.0.0/include/stddef.h:90:9: error: unknown type name '__WCHAR_TYPE__'
typedef __WCHAR_TYPE__ wchar_t;
        ^
/Users/johnwalsh/root/etc/cling/lib/clang/5.0.0/include/stddef.h:90:24: error: expected unqualified-id
typedef __WCHAR_TYPE__ wchar_t;
                       ^
...

Did you run xcode-select --install at a prompt?

I thought I did. This installs command line tools, yes?

I think so… It won’t hurt if you try again.

I did this, again as it turn out, since macos told me it that command line tools were already installed.

I tried building again and, of course, it failed in the same way.

Any ideas? Thanks.

It sounds like XCode was upgraded since the last time build ROOT. If that is the case, the simplest is to delete the build directory entirely and rebuild from scratch.

Thanks for the suggestion. I did a fresh build and it failed in the same way. I include below everything I did (since I’m not an expert and may be making some stupid error):


MacBook [680]> git clone https://github.com/root-project/root.git
Cloning into 'root'...
remote: Enumerating objects: 703007, done.
remote: Total 703007 (delta 0), reused 0 (delta 0), pack-reused 703007
Receiving objects: 100% (703007/703007), 745.60 MiB | 30.33 MiB/s, done.
Resolving deltas: 100% (507023/507023), done.
Checking out files: 100% (18900/18900), done.
MacBook [681]>
MacBook [683]> cd root
MacBook [690]> git checkout -b v6-19-01 v6-19-01
Switched to a new branch 'v6-19-01'
MacBook [693]> mkdir build
MacBook [694]> cd build
MacBook [695]> cmake -Dmacos_native=ON ../root
[lots of output not shown]

MacBook [696]> make -j2
Scanning dependencies of target VDT
Scanning dependencies of target move_header_roofit_histfactory
[  0%] Creating directories for 'VDT'
[  0%] Copying header /Users/johnwalsh/rootgit/root/roofit/histfactory/inc/RooStats/HistFactory/Asimov.h to /Users/johnwalsh/rootgit/build/include
[  0%] Copying header /Users/johnwalsh/rootgit/root/roofit/histfactory/inc/RooStats/HistFactory/Channel.h to /Users/johnwalsh/rootgit/build/include
[  0%] Copying header /Users/johnwalsh/rootgit/root/roofit/histfactory/inc/RooStats/HistFactory/ConfigParser.h to /Users/johnwalsh/rootgit/build/include
[  0%] Performing download step (download, verify and extract) for 'VDT'
[  0%] Copying header /Users/johnwalsh/rootgit/root/roofit/histfactory/inc/RooStats/HistFactory/Data.h to /Users/johnwalsh/rootgit/build/include
[  0%] Copying header /Users/johnwalsh/rootgit/root/roofit/histfactory/inc/RooStats/HistFactory/EstimateSummary.h to /Users/johnwalsh/rootgit/build/include
[  0%] Copying header /Users/johnwalsh/rootgit/root/roofit/histfactory/inc/RooStats/HistFactory/FlexibleInterpVar.h to /Users/johnwalsh/rootgit/build/include
[  0%] Copying header /Users/johnwalsh/rootgit/root/roofit/histfactory/inc/RooStats/HistFactory/HistFactoryException.h to /Users/johnwalsh/rootgit/build/include
[  0%] Copying header /Users/johnwalsh/rootgit/root/roofit/histfactory/inc/RooStats/HistFactory/HistFactoryModelUtils.h to /Users/johnwalsh/rootgit/build/include
[  0%] Copying header /Users/johnwalsh/rootgit/root/roofit/histfactory/inc/RooStats/HistFactory/HistFactoryNavigation.h to /Users/johnwalsh/rootgit/build/include
-- VDT download command succeeded.  See also /Users/johnwalsh/rootgit/build/VDT-prefix/src/VDT-stamp/VDT-download-*.log

[lots of output not shown]

Scanning dependencies of target rootcling
[ 76%] Building CXX object main/CMakeFiles/rootcling.dir/src/rootcling.cxx.o
[ 76%] Linking CXX executable ../bin/rootcling
[ 76%] Built target rootcling
Scanning dependencies of target G__Net
Scanning dependencies of target G__MathCore
[ 76%] Generating G__Net.cxx, ../../lib/libNet_rdict.pcm, ../../lib/libNet.rootmap
[ 76%] Generating G__MathCore.cxx, ../../lib/libMathCore_rdict.pcm, ../../lib/libMathCore.rootmap
warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk'
warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk'
In file included from input_line_1:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:85:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:82:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:86:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:94:
/Users/johnwalsh/root/etc/cling/lib/clang/5.0.0/include/stdlib.h:8:15: fatal error: 'stdlib.h' file not found
#include_next <stdlib.h>
              ^~~~~~~~~~
In file included from input_line_3:1:
In file included from /Users/johnwalsh/rootgit/build/include/RtypesCore.h:25:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stddef.h:46:

Thanks in advance for any suggestions you might have.

Is anything in your evironment point to this missing directory (i.e set | grep '10.14'; setenv | grep '10.14'). We don’t hard code this path in our source, so something on your machine is ‘tricking’ cmake and/or clang in wanting to use it.

Thanks for the suggestion. "set | grep ‘10.14’ " did not return anything, but your suggestion reminded me that I execute “thisroot.sh” for an older version of root in my .bash_profile. Removing this and then rebuilding works: I was able to build everything.

Thanks for the help.

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