Error in compiling ROOT from source to generate tests

Hello everyone, I have done some work in this repo https://github.com/tmvadnn/root and wanted to test it.

In order to generate tests: cmake ../root -Dtesting=true -DBLAS_FOUND=true is giving me this error:

Harshits-Air:root harshitprasad$ cmake ../root -Dtesting=true -DBLAS_FOUND=true
-- 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
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".

I have attached CMakeError.log file.

More information: I have installed ROOT in /usr/local/root and in my .bashrc set the environment variables like this:

export ROOTSYS=/usr/local/root
export PATH=$PATH:$ROOTSYS/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
export PYTHONPATH=$PYTHONPATH:$ROOTSYS/lib

Hi,

is this an in-source build? If yes, this is not supported as the error message says.

Cheers,
D

@dpiparo Using cmake ../root also gives me the same error. It will be great if you can help me out. :slight_smile:

Hello @dpiparo, I have figured out the mistake I was doing.

Thank you for helping me out. :slight_smile:

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