Installation Error - "cannot run C compiled programs."

Dear ROOT users,

I am a new user who just want to use TFile and TGraph now. I am on macOS 10.12.6. I tried to follow the readme on github https://github.com/root-project/root to compile it on my desktop. But it returns error and stopped on 31% when I run “make -j8” as below

-----------
...
 27% Copying header /Users/jiangminzhi/root/tmva/tmva/inc/TMVA/ModulekNN.h to /Users/jiangminzhi/build/include
 27% Built target move_header_roofit_roostats
 27% Building CXX object interpreter/llvm/src/tools/clang/utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangCommentCommandInfoEmitter.cpp.o
 27% Copying header /Users/jiangminzhi/root/roofit/roofitcore/inc/RooDataSet.h to /Users/jiangminzhi/build/include
 27% Copying header /Users/jiangminzhi/root/tmva/tmva/inc/TMVA/Monitoring.h to /Users/jiangminzhi/build/include
CMake Error at /Users/jiangminzhi/build/LZMA-prefix/src/LZMA-stamp/LZMA-configure-RelWithDebInfo.cmake:16 (message):
  Command failed: 1

   '/Users/jiangminzhi/build/LZMA-prefix/src/LZMA/configure' '--prefix' '/Users/jiangminzhi/build' '--libdir' '/Users/jiangminzhi/build/lib' '--with-pic' '--disable-shared' '--quiet' 'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc' 'CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++' 'CFLAGS=-Wno-format-nonliteral' 'LDFLAGS=-Qunused-arguments'

  See also

    /Users/jiangminzhi/build/LZMA-prefix/src/LZMA-stamp/LZMA-configure-*.log


make2: *** LZMA-prefix/src/LZMA-stamp/LZMA-configure Error 1
make1: *** CMakeFiles/LZMA.dir/all Error 2
make1: *** Waiting for unfinished jobs....
 27% Building CXX object interpreter/llvm/src/tools/clang/utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp.o
...
...
...
 31% Built target move_header_roofit_roofitcore
 31% Building CXX object interpreter/llvm/src/tools/clang/utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/TableGen.cpp.o
-- LZ4 build command succeeded.  See also /Users/jiangminzhi/build/LZ4-prefix/src/LZ4-stamp/LZ4-build-*.log
 31% Performing install step for 'LZ4'
-- LZ4 install command succeeded.  See also /Users/jiangminzhi/build/LZ4-prefix/src/LZ4-stamp/LZ4-install-*.log
 31% Completed 'LZ4'
 31% Built target LZ4
 31% Linking CXX static library ../libLLVMDemangle.a
 31% Built target LLVMDemangle
 31% Built target obj.clang-tblgen
make: *** all Error 2
➜  build
-----------

I checked the config.log file located at “build/LZMA-prefix/src/LZMA/config.log”, and the error message shows that

-----------
...
configure:5324: checking whether we are cross compiling
configure:5332: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -o conftest -Wno-format-nonliteral  -Qunused-arguments conftest.c  >&5
conftest.c:39:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
configure:5336: $? = 1
configure:5343: ./conftest
/Users/jiangminzhi/build/LZMA-prefix/src/LZMA/configure: line 5345: ./conftest: No such file or directory
configure:5347: $? = 127
configure:5354: error: in `/Users/jiangminzhi/build/LZMA-prefix/src/LZMA':
configure:5356: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
...
-----------

I tried to search this “cannot run C compiled programs” error, but cannot find avaiable solution. Does anyone meet such problem before? Thank you very much.

Best regards,
Minzhi

Did you install XCode (9) and its command line tools?

Hi pcanal,

Thank you for your reply. I am using Xcode 9.1 (9B55). I did not install the corresponding command line tools. And after install the command line tools by xcode-select --install, I think I installed the root successfully. Thank you very much!

Best regards,
Minzhi

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