# Problem building root on ubuntu 20.04.3 (WSL2)

**URL:** <https://root-forum.cern.ch/t/problem-building-root-on-ubuntu-20-04-3-wsl2/52806>\
**Category:** ROOT\
**Tags:** build\
**Created:** [December 16, 2022, 11:36pm UTC](https://root-forum.cern.ch/t/problem-building-root-on-ubuntu-20-04-3-wsl2/52806 "2022-12-16T23:36:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iraklic1981](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/iraklic1981/32/27455_2.png) [@iraklic1981](https://root-forum.cern.ch/u/iraklic1981)\
**Post date:** [December 16, 2022, 11:36pm UTC](https://root-forum.cern.ch/t/problem-building-root-on-ubuntu-20-04-3-wsl2/52806/1 "2022-12-16T23:36:39Z")

</div>

Trying to build root and getting the following errors:

[79%] Built target RSQLite  
/usr/bin/ld: cannot find -lXROOTD\_XrdNet\_LIBRARY-NOTFOUND  
/usr/bin/ld: cannot find -lXROOTD\_XrdOuc\_LIBRARY-NOTFOUND  
/usr/bin/ld: cannot find -lXROOTD\_XrdSys\_LIBRARY-NOTFOUND  
/usr/bin/ld: cannot find -lXROOTD\_XrdClient\_LIBRARY-NOTFOUND  
/usr/bin/ld: cannot find -lXROOTD\_Xrd\_LIBRARY-NOTFOUND  
/usr/bin/ld: cannot find -lXROOTD\_XrdNetUtil\_LIBRARY-NOTFOUND  
collect2: error: ld returned 1 exit status  
make[2]: \*\*\* [net/netxng/CMakeFiles/NetxNG.dir/build.make:139: lib/libNetxNG.so] Error 1  
make[1]: \*\*\* [CMakeFiles/Makefile2:31010: net/netxng/CMakeFiles/NetxNG.dir/all] Error 2  
make[1]: \*\*\* Waiting for unfinished jobs…  
Scanning dependencies of target G\_\_Imt  
[79%] Building CXX object core/imt/CMakeFiles/G\_\_Imt.dir/G\_\_Imt.cxx.o  
[79%] Built target G\_\_Imt  
make: \*\*\* [Makefile:152: all] Error 2

* * *

_ROOT Version:_ v6-26-10  
_Platform:_ Ubuntu 20.04.3 (WSL2)  
_Compiler:_ gcc 9.3.0

* * *

---

<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:** [December 17, 2022, 10:04am UTC](https://root-forum.cern.ch/t/problem-building-root-on-ubuntu-20-04-3-wsl2/52806/2 "2022-12-17T10:04:41Z")

</div>

You can try the pre-built package I posted here: [Unofficial ROOT 6.26.10 package for Ubuntu 22.04](https://root-forum.cern.ch/t/unofficial-root-6-26-10-package-for-ubuntu-22-04/52773).

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 17, 2022, 10:27am UTC](https://root-forum.cern.ch/t/problem-building-root-on-ubuntu-20-04-3-wsl2/52806/3 "2022-12-17T10:27:44Z")

</div>

Try to configure your ROOT using:  
`cmake -Dall=ON -Dxrootd=ON -Dbuiltin_xrootd=ON ...`  
or:  
`cmake -Dall=ON -Dxrootd=OFF ...`

BTW. The ROOT Team provides [ready-to-use binary distributions for some systems (see “ **Download a pre-compiled binary distribution** ” therein)](https://root.cern/install/#download-a-pre-compiled-binary-distribution), including various Ubuntu versions, which you just need to download and unpack.

For Ubuntu 20.04 / x86\_64 / gcc 9.4: [https://root.cern/download/?C=M;O=A;P=\*[uU][bB][uU][nN][tT][uU]\*20\*](https://root.cern/download/?C=M;O=A;P=*%5BuU%5D%5BbB%5D%5BuU%5D%5BnN%5D%5BtT%5D%5BuU%5D*20*)

---

<div class="post-metadata">

**Author:** ![iraklic1981](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/iraklic1981/32/27455_2.png) [@iraklic1981](https://root-forum.cern.ch/u/iraklic1981)\
**Post date:** [December 20, 2022, 12:03am UTC](https://root-forum.cern.ch/t/problem-building-root-on-ubuntu-20-04-3-wsl2/52806/4 "2022-12-20T00:03:21Z")

</div>

Thank you very much, the cmake flags for xroot helped.  
Thanks for the prebuild suggestions as well.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [January 3, 2023, 12:03am UTC](https://root-forum.cern.ch/t/problem-building-root-on-ubuntu-20-04-3-wsl2/52806/5 "2023-01-03T00:03:47Z")

</div>

Closed on January 3, 2023, 12:03am UTC

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