Hello everyone, I’m trying to setup and run ROOT on my MacOS v10.13 but facing some error messages when I run source bin/thisroot.sh and root commands. I have followed instructions as per the readme file provided here: https://github.com/root-project/root
Harshits-MacBook-Air:build harshitprasad$ source bin/thisroot.sh
-bash: root-config: command not found
Harshits-MacBook-Air:build harshitprasad$ root
-bash: root: command not found
It would be great if anyone can help me out to solve this error.
I’m getting this error now after running . bin/thisroot.sh command:
Harshits-MacBook-Air:build harshitprasad$ . bin/thisroot.sh
sed: 1: "s;:/Users/harshitprasad ...": unterminated substitute pattern
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: root-config: command not found
-bash: grep: command not found
-bash: grep: command not found
Thank you for quick reply After running xcode-select --install it seems like I have already command line tools installed. I have also checked the version of grep:
Hi @couet. I have again checked my installation of xcode. It has been installed properly. I’m sharing the terminal errors which I get when I run . bin/thisroot.sh more than one time:
Harshits-MacBook-Air:build harshitprasad$ . bin/thisroot.sh
-bash: root-config: command not found
Harshits-MacBook-Air:build harshitprasad$ . bin/thisroot.sh
sed: 1: "s;:/Users/harshitprasad ...": unterminated substitute pattern
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: root-config: command not found
-bash: grep: command not found
-bash: grep: command not found
Harshits-MacBook-Air:build harshitprasad$ . bin/thisroot.sh
-bash: dirname: command not found
-bash: cat: command not found
-bash: sed: command not found
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: sed: No such file or directory
-bash: root-config: command not found
-bash: grep: command not found
-bash: grep: command not found
In the starting, what I did cd build then cmake ../root was giving me error. So, I run the command cmake .. after that run make -j8 and the build was successful. I’m facing above issue only. Am I doing something wrong here?
Here is the error which I was getting while running cmake ../root
Harshits-MacBook-Air:root harshitprasad$ cmake ../root
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- 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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 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.13
-- 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++ -O2 -g -DNDEBUG
CMake Error at cmake/modules/RootNewMacros.cmake:1041 (message):
ROOT should be built as an out of source build, to keep the source
directory clean. Please create a extra build directory and run the command
'cmake <path_to_source_dir>' in this newly created directory. You have
also to delete the directory CMakeFiles and the file CMakeCache.txt in the
source directory. Otherwise cmake will complain even if you run it from an
out-of-source directory.
Call Stack (most recent call first):
CMakeLists.txt:107 (ROOT_CHECK_OUT_OF_SOURCE_BUILD)
-- Configuring incomplete, errors occurred!
See also "/Users/harshitprasad/Desktop/GSoC/root/CMakeFiles/CMakeOutput.log".
See also "/Users/harshitprasad/Desktop/GSoC/root/CMakeFiles/CMakeError.log".
Indeed the script bin/thisroot.sh is the right one to use. I do not understand when you source it the grep and sed command is not found whereas they are when you type directly the command at the prompt. May be my colleague @amadio will have an idea ?
Dear @harshit.prasad, I am not sure that you actually finished building ROOT. Can you please describe the procedure you used to build it in a bit more detail?
Please add the configuration option -DCMAKE_INSTALL_PREFIX=/usr/local/root and then install it with make install instead of using ROOT from the build directory. After you install it into /usr/local/root, all you need to do is to add /usr/local/root/bin to your path and /usr/local/root/lib to your LD_LIBRARY_PATH and everything will work without needing to source thisroot.sh. If you build ROOT with Python support enabled, then you may also have to add /usr/local/root/lib to PYTHONPATH. You can do that by adding this to your bashrc:
git checkout tmva-dnn-dev-test to work on tmva-dnn-dev-test branch with latest commits.
Followed the build instructions as per given in Github readme file:
mkdir build
cd build
cmake ..
sudo make // not used make -j8
. bin/thisroot.sh
It would be great if you can provide steps and I’m working with cmake for first time. Just got little bit confused here. Here is the output:
Harshits-MacBook-Air:~ harshitprasad$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/root
CMake Error: The source directory "/Users/harshitprasad" does not appear to contain CMakeLists.txt.
I have added the paths in .bashrc file as you’ve suggested.
UPDATE: @amadio I have fixed the above error, now I’m getting this error when I run make install
Harshits-MacBook-Air:~ harshitprasad$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/root
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- 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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/harshitprasad
Harshits-MacBook-Air:~ harshitprasad$ make install
make: *** No rule to make target `install'. Stop.