Make: *** [all] Error 2 on MacOS High Sierra v10.13

Hello everyone, I am trying to build ROOT 6.12 on the MacOS High Sierra v10.13 but I get an error message:

[ 76%] Built target root.exe
/Users/harshitprasad/Desktop/root/main/src/nbmain.cxx:176:11: error: call to
      constructor of 'string' (aka 'basic_string<char, char_traits<char>,
      allocator<char> >') is ambiguous
   string rootbin(TROOT::GetBinDir());
          ^       ~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/string:778:31: note: 
      candidate constructor
    _LIBCPP_INLINE_VISIBILITY basic_string(const value_type* __s);
                              ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string:799:5: note: 
      candidate constructor
    basic_string(__self_view __sv);
    ^
/Users/harshitprasad/Desktop/root/main/src/nbmain.cxx:177:11: error: call to
      constructor of 'string' (aka 'basic_string<char, char_traits<char>,
      allocator<char> >') is ambiguous
   string rootlib(TROOT::GetLibDir());
          ^       ~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/string:778:31: note: 
      candidate constructor
    _LIBCPP_INLINE_VISIBILITY basic_string(const value_type* __s);
                              ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string:799:5: note: 
      candidate constructor
    basic_string(__self_view __sv);
    ^
/Users/harshitprasad/Desktop/root/main/src/nbmain.cxx:178:11: error: call to
      constructor of 'string' (aka 'basic_string<char, char_traits<char>,
      allocator<char> >') is ambiguous
   string rootetc(TROOT::GetEtcDir());
          ^       ~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/string:778:31: note: 
      candidate constructor
    _LIBCPP_INLINE_VISIBILITY basic_string(const value_type* __s);
                              ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string:799:5: note: 
      candidate constructor
    basic_string(__self_view __sv);
    ^
3 errors generated.
make[2]: *** [main/CMakeFiles/rootnb.exe.dir/src/nbmain.cxx.o] Error 1
make[1]: *** [main/CMakeFiles/rootnb.exe.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 76%] Built target G__Imt
[ 76%] Built target G__RIO
make: *** [all] Error 2

It would be great if anyone can help me out to solve this error. : )

Which exact version of ROOT 6.12 did you use? (they are not all compatible with the newest XCode).

Did you rebuild from scratch? (i.e the cmake cache file might be remembering the wrong information about the XCode compiler capability).

Hi @pcanal :slight_smile: I’m using ROOT 6.12.06 version. I have followed the rules from here: https://github.com/tmvadnn/root to build ROOT. However instead of cmake ../root command, I have used cmake .. and after that executed make -j8 command due to which I’m facing the above error.

Humm … that seems to be a fork that is not up to date … Try with https://github.com/root-project/root

If it still does not work, please do the following.

* create a new build directory.
* run cmake and capture the output
* send us the the resulting output and the file CMakeCache.txt

Cheers,
Philippe.

Hello again @pcanal :slight_smile: The fork was not up to date. I forked the updated repository and the build was successful. Thank you for the help. I really appreciate it.

@pcanal I have forked this repo: https://github.com/tmvadnn/root and checkout to the branch tmva-dnn-dev-test. I did the build again, I’m again getting the build error:

Harshits-Air:build harshitprasad$ cmake ..
-- Performing Test HAS_LIBCXX11
-- Performing Test HAS_LIBCXX11 - Success
-- Found a Mac OS X System 10.13
-- Found a 64bit system
-- Found LLVM compiler collection
-- ROOT Platform: macosx
-- ROOT Architecture: macosx64
-- Build Type: RelWithDebInfo
-- Compiler Flags:  -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 -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -stdlib=libc++ -O2 -g -DNDEBUG
-- Looking for ZLib
-- Building freetype version 2.6.1 included in ROOT itself
-- Looking for PCRE
-- Looking for LZMA
-- Found LZMA includes at /usr/local/include
-- Found LZMA library at /usr/local/lib/liblzma.dylib
-- Building LZ4 version v1.7.5 included in ROOT itself
-- Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR) 
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR) 
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR) 
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR) 
-- Building AfterImage library included in ROOT itself
-- Looking for OpenGL
-- Looking for LibXml2
-- Looking for PostgreSQL
-- Looking for SQLite
-- Looking for BLAS for optional parts of TMVA
-- A library with BLAS API found.
-- Enabled support for:  asimage astiff builtin_afterimage builtin_freetype builtin_ftgl builtin_gl2ps builtin_glew builtin_llvm builtin_lz4 builtin_tbb builtin_unuran cling cocoa cxx11 exceptions explicitlink gdml genvector http imt libcxx opengl pch pgsql python roofit shared sqlite thread tmva xml
-- Found libtool - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
-- Native target architecture is X86
-- Threads disabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Found ld64 - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
-- OCaml bindings disabled.
-- LLVM host triple: x86_64-apple-darwin17.2.0
-- LLVM default target triple: x86_64-apple-darwin17.2.0
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- SysLibs: curses;/usr/lib/libz.dylib
-- Targeting X86
-- Could NOT find Z3 (missing: Z3_LIBRARIES Z3_INCLUDE_DIR) (Required is at least version "4.5")
-- Clang version: 5.0.0
-- Cling version (from VERSION file): ROOT_0.6~dev
-- Cling will look for C++ headers in '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1' at runtime.
-- And if not found, will invoke: '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ ' for them.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/harshitprasad/Desktop/root/build
Harshits-Air:build harshitprasad$ make -j8
[  0%] Built target move_header_core_unix
[  0%] Built target LZ4
[  0%] Built target move_header_core_macosx
[  0%] Built target move_header_math_matrix
[  0%] Built target move_header_math_minuit
[  1%] Built target move_header_math_mathcore
[  2%] Built target move_header_core_base
[  3%] Built target move_header_roofit_histfactory
[  3%] Built target move_header_math_foam
[  4%] Built target move_header_math_quadp
[  4%] Built target move_header_math_smatrix
[  4%] Built target move_header_math_mlp
[  4%] Built target move_header_math_splot
[  4%] Built target move_header_math_fumili
[  4%] Built target move_header_math_physics
[  4%] Built target move_header_math_genetic
[  6%] Built target move_header_math_genvector
[  7%] Built target move_header_hist_histpainter
[  7%] Built target move_header_hist_hist
[  7%] Built target move_header_core_cont
[  7%] Built target move_header_core_clib
[  7%] Built target move_header_core_foundation
[  8%] Built target move_header_core_meta
[  8%] Built target move_header_core_clingutils
[  8%] Built target move_header_core_multiproc
[  8%] Built target move_header_core_rint
[  8%] Built target move_header_core_textinput
[  8%] Built target move_header_core_thread
[  8%] Built target move_header_core_imt
[  8%] Built target move_header_core_zip
[  8%] Built target move_header_core_lz4
[  8%] Built target move_header_core_lzma
[  8%] Built target move_header_core_newdelete
[  8%] Built target move_header_hist_spectrumpainter
[  8%] Built target move_header_hist_spectrum
[ 10%] Built target move_header_tree_tree
[ 10%] Built target move_header_hist_unfold
[ 10%] Built target move_header_tree_treeplayer
[ 10%] Built target move_header_tree_treeviewer
[ 10%] Built target move_header_io_io
[ 10%] Built target move_header_io_sql
[ 10%] Built target move_header_io_xml
[ 10%] Built target move_header_io_xmlparser
[ 11%] Built target move_header_net_net
[ 11%] Built target move_header_net_auth
[ 11%] Built target move_header_net_http
[ 11%] Built target move_header_graf2d_postscript
[ 12%] Built target move_header_graf2d_gpad
[ 12%] Built target move_header_graf2d_graf
[ 12%] Built target move_header_graf2d_asimage
[ 12%] Built target move_header_graf2d_quartz
[ 12%] Built target move_header_graf3d_g3d
[ 12%] Built target move_header_graf2d_cocoa
[ 13%] Built target move_header_graf3d_eve
[ 14%] Built target move_header_graf3d_gl
[ 14%] Built target move_header_graf3d_glew
[ 14%] Built target move_header_graf3d_gviz3d
[ 15%] Built target move_header_graf3d_ftgl
[ 15%] Built target move_header_gui_ged
[ 16%] Built target move_header_gui_gui
[ 16%] Built target move_header_gui_fitpanel
[ 17%] Built target move_header_gui_guibuilder
[ 17%] Built target move_header_gui_guihtml
[ 17%] Built target move_header_gui_recorder
[ 17%] Built target move_header_gui_sessionviewer
[ 17%] Built target move_header_proof_proof
[ 17%] Built target move_header_proof_proofplayer
[ 17%] Built target move_header_proof_proofbench
[ 17%] Built target move_header_html
[ 17%] Built target move_header_montecarlo_eg
[ 17%] Built target move_header_montecarlo_vmc
[ 17%] Built target move_header_geom_geompainter
[ 17%] Built target move_header_geom_geombuilder
[ 17%] Built target move_header_geom_gdml
[ 19%] Built target move_header_geom_geom
[ 20%] Built target move_header_bindings_pyroot
[ 20%] Built target move_header_sql_pgsql
[ 21%] Built target move_header_sql_sqlite
[ 23%] Built target move_header_tmva_tmva
[ 23%] Built target move_header_tmva_pymva
[ 23%] Built target move_header_tmva_tmvagui
[ 23%] Built target llvm_vcsrevision_h
[ 23%] Built target move_header_roofit_roostats
[ 23%] Built target LLVMMCDisassembler
[ 23%] Built target move_header_roofit_roofit
[ 26%] Built target move_header_roofit_roofitcore
[ 26%] Built target LLVMDemangle
[ 26%] Built target LLVMTableGen
[ 26%] Built target LLVMBinaryFormat
[ 26%] Built target obj.clang-tblgen
[ 26%] Generating include/module.modulemap
[ 26%] Built target LLVMDebugInfoMSF
[ 26%] Built target obj.llvm-tblgen
[ 26%] Built target LLVMOption
[ 26%] Built target LLVMMCParser
Scanning dependencies of target move_headers
[ 26%] Built target copymodulemap
[ 26%] Performing build step for 'TBB'
[ 26%] Built target FREETYPE
[ 26%] Built target move_headers
Scanning dependencies of target Lz4
Scanning dependencies of target Macosx
Scanning dependencies of target Unix
Scanning dependencies of target Foundation_Stage1
[ 26%] Building CXX object core/lz4/CMakeFiles/Lz4.dir/src/ZipLZ4.cxx.o
[ 26%] Building CXX object core/foundation/CMakeFiles/Foundation_Stage1.dir/src/RConversionRuleParser.cxx.o
[ 26%] Building CXX object core/macosx/CMakeFiles/Macosx.dir/src/CocoaUtils.mm.o
CMake Error at /Users/harshitprasad/Desktop/root/build/TBB-prefix/src/TBB-stamp/TBB-build-RelWithDebInfo.cmake:16 (message):
  Command failed: 2

   'make' 'compiler=clang' 'CXXFLAGS= -mno-rtm' 'CPLUS=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++' 'CONLY=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc'

  See also

    /Users/harshitprasad/Desktop/root/build/TBB-prefix/src/TBB-stamp/TBB-build-*.log


make[2]: *** [TBB-prefix/src/TBB-stamp/TBB-build] Error 1
make[1]: *** [CMakeFiles/TBB.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 26%] Building CXX object core/unix/CMakeFiles/Unix.dir/src/TUnixSystem.cxx.o
[ 26%] Built target LLVMDebugInfoCodeView
[ 26%] Building CXX object core/foundation/CMakeFiles/Foundation_Stage1.dir/src/TClassEdit.cxx.o
[ 26%] Building CXX object core/macosx/CMakeFiles/Macosx.dir/src/TMacOSXSystem.mm.o
[ 29%] Built target LLVMSupport
[ 29%] Built target LLVMMC
[ 29%] Built target Lz4
[ 29%] Built target Unix
[ 29%] Built target Macosx
[ 29%] Built target Foundation_Stage1
make: *** [all] Error 2

It would be great if you can help me out again :slight_smile: I have also attached CMakeCache.txtCMakeCache.txt (117.1 KB)

Try applying the following patch in the build directory after seeing the error you mention.

*** TBB-prefix-moved.1/src/TBB/build/macos.inc	2017-03-03 05:34:15.000000000 -0600
--- TBB-prefix/src/TBB/build/macos.inc	2017-10-18 15:16:33.000000000 -0500
*************** ifndef arch
*** 49,55 ****
  endif
  
  ifndef runtime
!   clang_version:=$(shell clang -v 2>&1 >/dev/null | grep version | sed -e "s/.*version \(.*[0-9]\) .*/\1/")
    ifndef os_version
      os_version:=$(shell /usr/bin/sw_vers -productVersion)
    endif
--- 49,55 ----
  endif
  
  ifndef runtime
!   clang_version:=$(shell clang -v 2>&1 >/dev/null | grep 'LLVM version' | sed -e "s/.*version \(.*[0-9]\) .*/\1/")
    ifndef os_version
      os_version:=$(shell /usr/bin/sw_vers -productVersion)
    endif

if it does not help, please provide the file(s) /Users/harshitprasad/Desktop/root/build/TBB-prefix/src/TBB-stamp/TBB-build-*.log

Cheers,
Philippe.

@pcanal

TBB-build-out.log

Created ./build/macos_intel64_clang_cc9.0.0 Found CUDA installation: /usr/local/cuda, version unknown_os10.13.1_release and ..._debug directories

TBB-build-err.log

make[4]: ../../build/Makefile.tbb: No such file or directory
make[4]: *** No rule to make target `../../build/Makefile.tbb'.  Stop.
make[3]: *** [tbb] Error 2

Now, I have pasted the patch in TBB-build-RelWithDebInfo.cmake. Now I get this error:

CMake Error at /Users/harshitprasad/Desktop/gsoc/root/build/TBB-prefix/src/TBB-stamp/TBB-build-RelWithDebInfo.cmake:1:
  Parse error.  Expected a command name, got unquoted argument with text
  "***".


CMake Error: Error processing file: /Users/harshitprasad/Desktop/gsoc/root/build/TBB-prefix/src/TBB-stamp/TBB-build-RelWithDebInfo.cmake
make[2]: *** [TBB-prefix/src/TBB-stamp/TBB-build] Error 1
make[1]: *** [CMakeFiles/TBB.dir/all] Error 2
make: *** [all] Error 2

Looks like I’m not appyling patch properly. In which file I have to apply the patch to overcome the above issue? :slight_smile:

I apply the patch with

cd build_directory
make # this step will fail.
patch -p0 < path_to_patch_file/fixTBB-build.patch
make

I have created the patch file in build directory by name fixTBB-build.patch. Here is the output:

Harshits-MacBook-Air:build harshitprasad$ patch -p0 < fixTBB-build.patch
patch unexpectedly ends in middle of line
patching file TBB-prefix/src/TBB/build/macos.inc
patch unexpectedly ends in middle of line
patch: **** Can't rename file /var/folders/c7/b45s17816zn_b1dh3g7yzxrm0000gn/T//po39oXnZ to TBB-prefix/src/TBB/build/macos.inc : Permission denied

You seems (see also the fact that you had to use sudo to run make) to have problem with the permission on the output directories/files. You may want to make sure that the build directory is owned by your local user.

Executing command with sudo gives me this output:

Harshits-MacBook-Air:build harshitprasad$ sudo patch -p0 < fixTBB-build.patch
Password:
patch unexpectedly ends in middle of line
patching file TBB-prefix/src/TBB/build/macos.inc
patch unexpectedly ends in middle of line

I recommend then that you do the modification by hand (i.e. edit TBB-prefix/src/TBB/build/macos.inc )

1 Like

Thank you for helping me out @pcanal. Your solution worked. :slight_smile:

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