Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /home/huangli/.linuxbrew/bin/clang++ Build flags: Id flags: The output was: 1 /home/huangli/.linuxbrew/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/libstdc++.so: undefined reference to `__cxa_thread_atexit_impl@GLIBC_2.18' /home/huangli/.linuxbrew/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17' clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation) Determining if the CXX compiler works failed with the following output: Change Dir: /home/huangli/tools/root6/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/gmake" "cmTC_a4173/fast" /usr/bin/gmake -f CMakeFiles/cmTC_a4173.dir/build.make CMakeFiles/cmTC_a4173.dir/build gmake[1]: Entering directory `/home/huangli/tools/root6/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_a4173.dir/testCXXCompiler.cxx.o /home/huangli/.linuxbrew/bin/clang++ -o CMakeFiles/cmTC_a4173.dir/testCXXCompiler.cxx.o -c /home/huangli/tools/root6/CMakeFiles/CMakeTmp/testCXXCompiler.cxx Linking CXX executable cmTC_a4173 /home/huangli/.linuxbrew/Cellar/cmake/3.6.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a4173.dir/link.txt --verbose=1 /home/huangli/.linuxbrew/bin/clang++ CMakeFiles/cmTC_a4173.dir/testCXXCompiler.cxx.o -o cmTC_a4173 /home/huangli/.linuxbrew/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/libstdc++.so: undefined reference to `__cxa_thread_atexit_impl@GLIBC_2.18' /home/huangli/.linuxbrew/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17' clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation) gmake[1]: *** [cmTC_a4173] Error 1 gmake[1]: Leaving directory `/home/huangli/tools/root6/CMakeFiles/CMakeTmp' gmake: *** [cmTC_a4173/fast] Error 2