# Issue when compiling ROOT

**URL:** <https://root-forum.cern.ch/t/issue-when-compiling-root/40232>\
**Category:** Newbie\
**Tags:** build, cmake, installation\
**Created:** [July 3, 2020, 7:14pm UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232 "2020-07-03T19:14:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![trevajrussell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/df705f/32.png) [@trevajrussell](https://root-forum.cern.ch/u/trevajrussell)\
**Post date:** [July 3, 2020, 7:14pm UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/1 "2020-07-03T19:14:39Z")

</div>

Hi,

I just got a new computer and am having trouble setting up ROOT but have no idea how to fix it. This is the error I am getting:

(optenv) Trevors-MacBook-Pro-2:root-6.22.00\_builddir Trevor$ cmake --build .  
[0%] Built target move\_header\_roofit\_histfactory  
[0%] Performing configure step for ‘VDT’  
CMake Error at /Users/Trevor 1/Desktop/Research/root-6.22.00\_builddir/VDT-prefix/src/VDT-stamp/VDT-configure-Release.cmake:49 (message):  
Command failed: 1

‘/usr/local/Cellar/cmake/3.17.3/bin/cmake’ ‘-DSSE=OFF’ ‘-DCMAKE\_BUILD\_TYPE=Release’ ‘-DCMAKE\_C\_COMPILER=/Library/Developer/CommandLineTools/usr/bin/cc’ ‘-DCMAKE\_CXX\_COMPILER=/Library/Developer/CommandLineTools/usr/bin/c++’ ‘-DCMAKE\_C\_FLAGS= -m64 -pipe -W -Wall -fsigned-char -fno-common -Qunused-arguments -pthread’ ‘-DCMAKE\_CXX\_FLAGS= -std=c++11 -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 -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++’ ‘-DCMAKE\_INSTALL\_PREFIX=/Users/Trevor 1/Desktop/Research/root-6.22.00\_builddir’ ‘-GUnix Makefiles’ ‘/Users/Trevor 1/Desktop/Research/root-6.22.00\_builddir/VDT-prefix/src/VDT’

See also

```
/Users/Trevor 1/Desktop/Research/root-6.22.00_builddir/VDT-prefix/src/VDT-stamp/VDT-configure-*.log

```

make[2]: \*\*\* [VDT-prefix/src/VDT-stamp/VDT-configure] Error 1  
make[1]: \*\*\* [CMakeFiles/VDT.dir/all] Error 2  
make: \*\*\* [all] Error 2

---

<div class="post-metadata">

**Author:** ![jblomer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@jblomer](https://root-forum.cern.ch/u/jblomer)\
**Post date:** [July 4, 2020, 9:34pm UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/2 "2020-07-04T21:34:15Z")

</div>

Hello,

Have you tried with the macOS binary packages: [https://root.cern/install/#macos-package-managers](https://root.cern/install/#macos-package-managers)

Cheers,  
Jakob

---

<div class="post-metadata">

**Author:** ![trevajrussell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/df705f/32.png) [@trevajrussell](https://root-forum.cern.ch/u/trevajrussell)\
**Post date:** [July 4, 2020, 9:42pm UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/3 "2020-07-04T21:42:16Z")

</div>

If I’m not mistaken the binary packages are compiled with python 2, but I need to be using python 3? Let me know if that is incorrect

---

<div class="post-metadata">

**Author:** ![jblomer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@jblomer](https://root-forum.cern.ch/u/jblomer)\
**Post date:** [July 4, 2020, 9:48pm UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/4 "2020-07-04T21:48:31Z")

</div>

The latest binaries should be compiled with both python 2 and 3 support. But I’ll let @etejedor confirm.

---

<div class="post-metadata">

**Author:** ![trevajrussell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/df705f/32.png) [@trevajrussell](https://root-forum.cern.ch/u/trevajrussell)\
**Post date:** [July 6, 2020, 4:01am UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/5 "2020-07-06T04:01:21Z")

</div>

I tried installing using homebrew but got this error upon trying to import ROOT in python:

Traceback (most recent call last):  
File “/usr/local/Cellar/root/6.22.00\_1/lib/root/cppyy/ **init**.py”, line 60, in   
importlib.import\_module(libcppyy\_mod\_name)  
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/ **init**.py”, line 127, in import\_module  
return \_bootstrap.\_gcd\_import(name[level:], package, level)  
File “”, line 1006, in \_gcd\_import  
File “”, line 983, in \_find\_and\_load  
File “”, line 965, in \_find\_and\_load\_unlocked  
ModuleNotFoundError: No module named ‘libcppyy3\_7’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “”, line 1, in   
File “/usr/local/Cellar/root/6.22.00\_1/lib/root/ROOT/ **init**.py”, line 28, in   
import cppyy  
File “/usr/local/Cellar/root/6.22.00\_1/lib/root/cppyy/ **init**.py”, line 64, in   
libcppyy\_mod\_name, major, minor))  
ImportError: Failed to import libcppyy3\_7. Please check that ROOT has been built for Python 3.7

---

<div class="post-metadata">

**Author:** ![jblomer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@jblomer](https://root-forum.cern.ch/u/jblomer)\
**Post date:** [July 6, 2020, 6:28am UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/6 "2020-07-06T06:28:14Z")

</div>

You can try with the pre-built binaries from the [download page](https://root.cern/releases/release-62200/#binary-distributions). If this does not work, perhaps @etejedor can help?

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [July 6, 2020, 8:18am UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/7 "2020-07-06T08:18:09Z")

</div>

Hi,  
The binary releases for MacOS are only distributed with Python2 compatibility, so you can’t use them if you want Python3, indeed.

The homebrew error is saying that ROOT was not built for Python3.7, which is the version you are trying to use. It might have been built for Python3.8, so you could try with that version.

Another alternative is to build from sources. For the VDT error, I would need @oshadura to comment.

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [July 6, 2020, 8:33am UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/8 "2020-07-06T08:33:06Z")

</div>

for VDT, I will need the content of `/Users/Trevor 1/Desktop/Research/root-6.22.00_builddir/VDT-prefix/src/VDT-stamp/VDT-configure-*.log`

Thank you!  
Oksana.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [July 6, 2020, 9:19am UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/9 "2020-07-06T09:19:45Z")

</div>

> [@ROOT Installs with Python 3.8.2](https://root-forum.cern.ch/t/root-installs-with-python-3-8-2/40044/3):
>
> Try export PYTHONPATH=$(root-config --libdir), and please make sure to use the Python interpreter from Homebrew (i.e. likely from /usr/local/bin and linked somewhere into /usr/local/Cellar).

---

<div class="post-metadata">

**Author:** ![trevajrussell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/df705f/32.png) [@trevajrussell](https://root-forum.cern.ch/u/trevajrussell)\
**Post date:** [July 6, 2020, 4:34pm UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/10 "2020-07-06T16:34:37Z")

</div>

Here is the content you asked for

AppleClang  
DIAG option is now off, building library only  
CMake Error at lib/CMakeLists.txt:19 (ADD\_LIBRARY):  
Cannot find source file:

```
/Users/Trevor 1/Desktop/Research/root-6.22.00_builddir/VDT-prefix/src/VDT/src/vdtMath_signatures.cc

```

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm  
.hpp .hxx .in .txx

CMake Error at lib/CMakeLists.txt:19 (ADD\_LIBRARY):  
No SOURCES given to target: vdt

CMake Generate step failed. Build files cannot be regenerated correctly.

Also, thanks so much to everyone trying to help!

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [July 8, 2020, 5:19pm UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/11 "2020-07-08T17:19:35Z")

</div>

hi @trevajrussell can you try to turn off `vdt` using `-Dvdt=OFF`?

---

<div class="post-metadata">

**Author:** ![trevajrussell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/df705f/32.png) [@trevajrussell](https://root-forum.cern.ch/u/trevajrussell)\
**Post date:** [July 8, 2020, 5:54pm UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/12 "2020-07-08T17:54:46Z")

</div>

@oshadura I still get the same error, but this time it occurs at 13% rather than 0. Also the log has the same content as before

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [July 9, 2020, 7:33am UTC](https://root-forum.cern.ch/t/issue-when-compiling-root/40232/13 "2020-07-09T07:33:16Z")

</div>

I think you need to have clean build, can you try to turn to remove everything, again turn off `vdt` using `-Dvdt=OFF -Dbuiltin_vdt=OFF` ?
