Compiling xmlparser on Mac OS X Mojave

ROOT Version: 6.14.06
Platform: Mac OS X 10.14.2
Compiler: CLang 6.0.1

Hi all,

I’m trying to install ROOT on my new Mac Book Pro.
It seems I can’t get xmlparser compiled.

I do execute the following command:

cmake -DCMAKE_INSTALL_PREFIX=/Applications/root/ -DX11=ON -DBUILTINXROOTD=ON -DROOFIT=ON -DPYTHON=ON -Dmathmore=ON -Dxml=ON /Applications/root-sources/

I get the following output :
– The C compiler identification is Clang 6.0.1
– The CXX compiler identification is Clang 6.0.1
– Check for working C compiler: /opt/local/bin/clang-mp-6.0
– Check for working C compiler: /opt/local/bin/clang-mp-6.0 – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /opt/local/bin/clang+±mp-6.0
– Check for working CXX compiler: /opt/local/bin/clang+±mp-6.0 – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– ROOT default compression algorithm is zlib
– Found Clang. Major version 6, minor version 0
– Performing Test HAS_CXX11
– Performing Test HAS_CXX11 - Success
– Looking for pthread.h
– Looking for pthread.h - found
– Looking for pthread_create
– Looking for pthread_create - found
– Found Threads: TRUE
– Found a Mac OS X System 10.14
– Found a 64bit system
– Found LLVM compiler collection
– Performing Test GLIBCXX_USE_CXX11_ABI
– Performing Test GLIBCXX_USE_CXX11_ABI - Failed
– 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++
– Looking for ZLib
– Found ZLIB: /usr/lib/libz.dylib (found version “1.2.11”)
– Building freetype version 2.6.1 included in ROOT itself
– Looking for PCRE
– Found PCRE: /usr/local/include
– Looking for LZMA
– Found LZMA includes at /usr/local/include
– Found LZMA library at /usr/local/lib/liblzma.dylib
– Looking for xxHash
– Could NOT find xxHash (missing: xxHash_LIBRARY xxHash_INCLUDE_DIR)
– xxHash not found. Switching on builtin_xxhash option
– Looking for LZ4
– Found LZ4: /opt/local/lib/liblz4.dylib (found version “1.8.3”)
– Found GIF: /opt/local/lib/libgif.dylib (found version “4.2.3”)
– Found TIFF: /opt/local/lib/libtiff.dylib (found version “4.0.10”)
– Found PNG: /usr/X11R6/lib/libpng.dylib (found version “1.6.26”)
– Found JPEG: /opt/local/lib/libjpeg.dylib (found version “90”)
– Building AfterImage library included in ROOT itself
– Looking for GSL
– Found GSL: /opt/local/include (found suitable version “2.5”, minimum required is “1.10”)
– Found PythonInterp: /opt/local/bin/python (found version “3.6.8”)
– Found PythonLibs: /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib (found version “3.6.8”)
– Found NUMPY: /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/core/include (found version “1.15.4”)
– Looking for OpenGL
– Found OpenGL: /Applications/
– Looking for gl2ps
– Found GL2PS: /opt/local/lib/libgl2ps.dylib
– Looking for LibXml2
– Found LibXml2: /opt/local/lib/libxml2.dylib (found version “2.9.7”)
– Found OpenSSL: /opt/local/lib/libcrypto.dylib (found version “1.0.2q”)
– Looking for Castor
– Castor not found. Switching off castor option
– Looking for MySQL
– MySQL not found. Switching off mysql option
– Looking for Oracle
– Oracle not found.
– Oracle: You can specify includes: -DORACLE_PATH_INCLUDES=/usr/include/oracle/
– currently found includes:
– Oracle: You can specify libs: -DORACLE_PATH_LIB=/usr/lib/oracle/
– Oracle not found. Switching off oracle option
– Looking for PostgreSQL
– Could NOT find PostgreSQL (missing: POSTGRESQL_INCLUDE_DIR)
– PostgreSQL not found. Switching off pgsql option
– Looking for SQLite
– Found PkgConfig: /opt/local/bin/pkg-config (found version “0.29.2”)
– Found Sqlite: /opt/local/include
– Looking for Pythia6
– Pythia6 not found. Switching off pythia6 option
– Looking for Pythia8
– Could NOT find Pythia8 (missing: PYTHIA8_INCLUDE_DIR)
– Pythia8 not found. Switching off pythia8 option
– Looking for FFTW3
– Found fftw3 includes at /opt/local/include
– Found fftw3 library at /opt/local/lib/libfftw3.dylib
– Looking for CFITSIO
– CFITSIO not found. You can enable the option ‘builtin_cfitsio’ to build the library internally’
– For the time being switching off ‘fitsio’ option
– Looking for XROOTD
– XROOTD not found. Set environment variable XRDSYS to point to your XROOTD installation
– Alternatively, you can also enable the option ‘builtin_xrootd’ to build XROOTD internally
– For the time being switching OFF ‘xrootd’ option
– GFAL library not found. Set variable GFAL_DIR to point to your gfal installation
and the variable SRM_IFCE_DIR to the srm_ifce installation
– For the time being switching OFF ‘gfal’ option
– Checking for module ‘davix>=0.6.4’
– No package ‘davix’ found
– Looking for uuid_generate_random in uuid
– Looking for uuid_generate_random in uuid - not found
– Found uuid: /Applications/
– Davix not found, switching ON ‘builtin_davix’ option.
– Looking for clock_gettime
– Looking for clock_gettime - found
– Looking for TBB
– Could NOT find TBB (missing: TBB_ROOT_DIR TBB_INCLUDE_DIR)
– TBB not found. Switching on builtin_tbb option
– Performing Test CXX_HAS_mno_rtm
– Performing Test CXX_HAS_mno_rtm - Success
– Looking for VDT
– VDT not found. Ensure that the installation of VDT is in the CMAKE_PREFIX_PATH
– Switching ON ‘builtin_vdt’ option
– Looking for BLAS for optional parts of TMVA
– Looking for sgemm_
– Looking for sgemm_ - not found
– Looking for dgemm_
– Looking for dgemm_ - found
– Found BLAS: /Applications/
– Enabled support for: asimage astiff builtin_afterimage builtin_davix builtin_freetype builtin_ftgl builtin_glew builtin_llvm builtin_clang builtin_tbb builtin_vdt builtin_xxhash cling cocoa cxx11 davix exceptions explicitlink fftw3 gdml genvector http imt libcxx mathmore opengl pch python roofit shared sqlite ssl thread tmva tmva-cpu vdt xml
– The ASM compiler identification is Clang
– Found assembler: /opt/local/bin/clang-mp-6.0
– Found libtool - /Applications/
– Looking for backtrace
– Looking for backtrace - found
– backtrace facility detected in default set of libraries
– Found Backtrace: /Applications/
– Native target architecture is X86
– Threads disabled.
– Doxygen disabled.
– Go bindings disabled.
– Found ld64 - /Applications/
– OCaml bindings disabled.
– LLVM host triple: x86_64-apple-darwin18.2.0
– LLVM default target triple: x86_64-apple-darwin18.2.0
– Building with -fPIC
– Constructing LLVMBuild project information
– SysLibs: curses;/usr/lib/libz.dylib
– Targeting X86
– Clang version: 5.0.0
– Cling version (from VERSION file): ROOT_0.6~dev
– Cling will look for C++ headers in ‘/opt/local/libexec/llvm-6.0/include/c++/v1’ at runtime.
– And then fallback to: ‘clang+±mp-6.0’
– Performing Test CXX_HAS_fno_rtti
– Performing Test CXX_HAS_fno_rtti - Success
– Performing Test CXX_HAS_Wno_conditional_uninitialized
– Performing Test CXX_HAS_Wno_conditional_uninitialized - Success
– Performing Test C_HAS_Wno_strict_overflow
– Performing Test C_HAS_Wno_strict_overflow - Success
– Performing Test C_HAS_Wno_maybe_uninitialized
– Performing Test C_HAS_Wno_maybe_uninitialized - Failed
– Performing Test C_HAS_Wno_parentheses_equality
– Performing Test C_HAS_Wno_parentheses_equality - Success
– Performing Test CXX_HAS_Wno_deprecated_declarations
– Performing Test CXX_HAS_Wno_deprecated_declarations - Success
– Performing Test CXX_HAS_fno_strict_aliasing
– Performing Test CXX_HAS_fno_strict_aliasing - Success
– Performing Test CXX_HAS_Wno_parentheses_equality
– Performing Test CXX_HAS_Wno_parentheses_equality - Success
– Using TMVA-DNN with BLAS installation
– Performing Test found_setresuid
– Performing Test found_setresuid - Failed
– Performing Test found_stdstringview
– Performing Test found_stdstringview - Success
– Performing Test found_stdexpstringview
– Performing Test found_stdexpstringview - Success
– Performing Test found_stod_stringview
– Performing Test found_stod_stringview - Failed
– Performing Test found_stdapply
– Performing Test found_stdapply - Failed
– Performing Test found_stdinvoke
– Performing Test found_stdinvoke - Failed
– Performing Test found_stdindexsequence
– Performing Test found_stdindexsequence - Failed
– Performing Test found_attribute_always_inline
– Performing Test found_attribute_always_inline - Success
Running /Applications/root-sources/build/unix/
Making /Applications/root-build/include/compiledata.h
– Configuring done
– Generating done
– Build files have been written to: /Applications/root-build

Then I go for:
cmake --build . – -j4

And I can’t get to the end of the compilation. The following error message appear:

[ 74%] Building CXX object io/xmlparser/CMakeFiles/XMLParser.dir/src/TDOMParser.cxx.o
In file included from /Applications/root-sources/io/xmlparser/src/TDOMParser.cxx:28:
In file included from /opt/local/include/libxml2/libxml/tree.h:1307:
In file included from /opt/local/include/libxml2/libxml/xmlmemory.h:218:
In file included from /opt/local/include/libxml2/libxml/threads.h:35:
In file included from /opt/local/include/libxml2/libxml/globals.h:18:
In file included from /opt/local/include/libxml2/libxml/parser.h:810:
/opt/local/include/libxml2/libxml/encoding.h:31:10: fatal error: ‘unicode/ucnv.h’ file not found
#include <unicode/ucnv.h>
1 error generated.
gmake[2]: *** [io/xmlparser/CMakeFiles/XMLParser.dir/build.make:101: io/xmlparser/CMakeFiles/XMLParser.dir/src/TDOMParser.cxx.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:23075: io/xmlparser/CMakeFiles/XMLParser.dir/all] Error 2
gmake[1]: *** Attente des tâches non terminées…

If anyone has an idea…

Thank you very much for your help

It seems you are picking a custom installed version of libxml2 at /opt/local. Maybe you need to compile ROOT from a shell in which Homebrew, MacPorts, etc, are not enabled so that you use only system software instead. Or make sure to use all software from just one place. If you just want ROOT installed and already have Homebrew, it’s as easy as brew install root.

Hi Amadio,

I’m so used to compile root by myself… I did not thought about homebrew.
Does Homebrew install all the root packages and enable python support?


Yes, ROOT installed with Homebrew can use python and has support for xml. More information can be found at Just remember to set PYTHONPATH if needed. I think it’s the only thing that needs to be set by hand for it to work. Also, make sure to use python from Homebrew if you install ROOT from there.

Ok I installed ROOT with brew… It worked fine (with no surprise to be honest)
But when it comes to my application I still get the following error message:
ld: library not found for -lXMLParser

This is the reason why I explicitly tried to compile root by myself

(this is linked to this post: Font error on mac os)

You probably just need to set the DYLD_LIBRARY_PATH to where ROOT libraries are installed.

We solved it in between… Sometimes a make clean saves the day.

The rest should be my problem… for now

Thanks again for the help

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