# Offline Build Update

**URL:** <https://root-forum.cern.ch/t/offline-build-update/32725>\
**Category:** ROOT\
**Created:** [February 13, 2019, 3:04pm UTC](https://root-forum.cern.ch/t/offline-build-update/32725 "2019-02-13T15:04:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksmith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksmith/32/12567_2.png) [@ksmith](https://root-forum.cern.ch/u/ksmith)\
**Post date:** [February 13, 2019, 3:04pm UTC](https://root-forum.cern.ch/t/offline-build-update/32725/1 "2019-02-13T15:04:33Z")

</div>

Hi,

We have been attempting to build ROOT for some offline machines, but have run into issue downloading “hidden” dependencies such as TBB. This issue has been mentioned in a number of places around the forum and an open [bug](https://sft.its.cern.ch/jira/browse/ROOT-9163), but I have not seen a complete answer on how to build while offline.

First is there a list of the built-ins that I need to downlaod to build ROOT?

Secondly, why does the CMake ignore the builtin flags? For example, I’ve installed TBB to avoid the download and set `-Dbuiltin_tbb=OFF`, but it switches back to `ON` and again attempts to download.

Thanks

* * *

_ROOT Version:_ 6.16.00  
_Platform:_ Not Provided  
_Compiler:_ Not Provided

* * *

---

<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:** [February 19, 2019, 12:52pm UTC](https://root-forum.cern.ch/t/offline-build-update/32725/2 "2019-02-19T12:52:00Z")

</div>

Hi, not many people complain about this, so it’s not a high priority item to solve, unfortunately. Please vote on the JIRA item so I can convince others that it’s important to resolve this. If you have `builtin_tbb` getting enabled back it’s because ROOT cannot find your installation of TBB, or because you have an installed version that is too old. Several builtins require a network connection to work, so if you want to build offiline reliably, I’d use `-Dminimal=ON` or `-Dgminimal=ON` and then enable only the things you want on top. This should disable most optional features. With `grep -B1 ^builtin CMakeCache.txt` (in the build directory) you can check which builtins have been enabled (and which of them require an active network connection, see below for an example). Most of the setup for the builtins is in `cmake/modules/SearchInstalledSoftware.cmake`, so you can look there to see why each builtin was enabled. You can then either install missing dependencies on your system, or disable the option that requires the builtin. For TBB, just use `-Dimt=OFF`. Cheers,

```auto
$ grep -B1 ^builtin CMakeCache.txt
//Build bundled copy of libAfterImage
builtin_afterimage:BOOL=ON
--
//Build CFITSIO internally (requires network)
builtin_cfitsio:BOOL=OFF
--
//Build bundled copy of Clang
builtin_clang:BOOL=ON
--
//Build Davix internally (requires network)
builtin_davix:BOOL=OFF
--
//Build FFTW3 internally (requires network)
builtin_fftw3:BOOL=OFF
--
//Build bundled copy of freetype
builtin_freetype:BOOL=OFF
--
//Build bundled copy of FTGL
builtin_ftgl:BOOL=ON
--
//Build bundled copy of gl2ps
builtin_gl2ps:BOOL=OFF
--
//Build bundled copy of GLEW
builtin_glew:BOOL=ON
--
//Build GSL internally (requires network)
builtin_gsl:BOOL=OFF
--
//Build bundled copy of LLVM
builtin_llvm:BOOL=ON
--
//Build bundled copy of lz4
builtin_lz4:BOOL=OFF
--
//Build bundled copy of lzma
builtin_lzma:BOOL=OFF
--
//Build OpenSSL internally (requires network)
builtin_openssl:BOOL=OFF
--
//Build bundled copy of PCRE
builtin_pcre:BOOL=OFF
--
//Build TBB internally (requires network)
builtin_tbb:BOOL=OFF
--
//Build bundled copy of unuran
builtin_unuran:BOOL=OFF
--
//Build Vc internally (requires network)
builtin_vc:BOOL=ON

builtin_vc-CACHED:STRING=ON
--
//Build VDT internally (requires network)
builtin_vdt:BOOL=OFF
--
//Build VecCore internally (requires network)
builtin_veccore:BOOL=ON

builtin_veccore-CACHED:STRING=ON
--
//Build XRootD internally (requires network)
builtin_xrootd:BOOL=OFF
--
//Build bundled copy of xxHash
builtin_xxhash:BOOL=OFF
--
//Build bundled copy of zlib
builtin_zlib:BOOL=OFF

```

Alternatively, you can run this in the source directory:

```auto
$ grep -r 'requires network'
cmake/modules/RootBuildOptions.cmake:ROOT_BUILD_OPTION(builtin_cfitsio OFF "Build CFITSIO internally (requires network)")
cmake/modules/RootBuildOptions.cmake:ROOT_BUILD_OPTION(builtin_davix OFF "Build Davix internally (requires network)")
cmake/modules/RootBuildOptions.cmake:ROOT_BUILD_OPTION(builtin_fftw3 OFF "Build FFTW3 internally (requires network)")
cmake/modules/RootBuildOptions.cmake:ROOT_BUILD_OPTION(builtin_gsl OFF "Build GSL internally (requires network)")
cmake/modules/RootBuildOptions.cmake:ROOT_BUILD_OPTION(builtin_openssl OFF "Build OpenSSL internally (requires network)")
cmake/modules/RootBuildOptions.cmake:ROOT_BUILD_OPTION(builtin_tbb OFF "Build TBB internally (requires network)")
cmake/modules/RootBuildOptions.cmake:ROOT_BUILD_OPTION(builtin_vc OFF "Build Vc internally (requires network)")
cmake/modules/RootBuildOptions.cmake:ROOT_BUILD_OPTION(builtin_vdt OFF "Build VDT internally (requires network)")
cmake/modules/RootBuildOptions.cmake:ROOT_BUILD_OPTION(builtin_veccore OFF "Build VecCore internally (requires network)")
cmake/modules/RootBuildOptions.cmake:ROOT_BUILD_OPTION(builtin_xrootd OFF "Build XRootD internally (requires network)")

```

---

<div class="post-metadata">

**Author:** ![ksmith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksmith/32/12567_2.png) [@ksmith](https://root-forum.cern.ch/u/ksmith)\
**Post date:** [February 22, 2019, 6:02pm UTC](https://root-forum.cern.ch/t/offline-build-update/32725/3 "2019-02-22T18:02:05Z")

</div>

Thanks for the tips, if I get some more time to work on this I’ll investigate which flags need to be set.

It turns out the the binary build for ROOT 18.04 was nearly what we needed, so we have used that. It is however missing the python 3 bindings, which is odd because python3 is installed by default.

I went to vote on the issue and see that I am already following it, so I can’t throw anymore weight at it.

---

<div class="post-metadata">

**Author:** ![ksmith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksmith/32/12567_2.png) [@ksmith](https://root-forum.cern.ch/u/ksmith)\
**Post date:** [February 24, 2019, 3:05pm UTC](https://root-forum.cern.ch/t/offline-build-update/32725/4 "2019-02-24T15:05:43Z")

</div>

Do you have any suggestion as how to implement a check to see if one of these packages is available? I’ve had issues download TBB in the past and it would be nice to see CMake ExternalPacakge allow one to set a pacakage as optional or pass a variable that the download failed with killing the entire build. I assume this would help solve the offline build issues.

---

<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:** [February 25, 2019, 7:33am UTC](https://root-forum.cern.ch/t/offline-build-update/32725/5 "2019-02-25T07:33:08Z")

</div>

> [@ksmith](#):
>
> Do you have any suggestion as how to implement a check to see if one of these packages is available?

Not sure what you mean here. You mean in the system? The check is done with `find_package()`.

If you download a package into the place where CMake expects to find it, or download into ROOT’s subdir and change `URL` in the call to `ExternalProject_Add()` to `${CMAKE_SOURCE_DIR}` it will work offline. TBB is already optional, but our option names are not so intuitive, I guess. You can disable it with `-Dimt=OFF`.

As for Python support, our binaries come with bindings for whatever `/usr/bin/python` is. So in Ubuntu that’s Python 2.x, even though Python 3.x may be installed. In the future we plan to support both at the same time.

Since all options requiring a network connection are now documented, I believe that you can easily avoid problems when building offline. My suggestion is to use `-Dminimal=ON` and enable by hand things you want, such as `-Droofit=ON -Dtmva=ON`, etc. If you look at the options docstrings (i.e. by running `cmake -LH` in the build directory after first configuration), you will know which enabled options require the network and can disable them. For example, with `cmake -LH | grep -A1 network` you can see only the options that require an active network connection. You just have to make sure that for each enabled `builtin_pkg` you also disable the equivalent `pkg` so ROOT doesn’t enable it back.

---

<div class="post-metadata">

**Author:** ![ksmith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksmith/32/12567_2.png) [@ksmith](https://root-forum.cern.ch/u/ksmith)\
**Post date:** [February 25, 2019, 3:08pm UTC](https://root-forum.cern.ch/t/offline-build-update/32725/6 "2019-02-25T15:08:02Z")

</div>

Sorry I may have convoluted two issues. One is trying to build ROOT for a system where it is entirely disconnected, which I believe you have provided enough information to track down.

Another issue is when a single package is unavailable from the internet. This has occurred int he past for me with TBB:

> [@Cannot build ROOT 6.10.04 (TBB-download fails)](https://root-forum.cern.ch/t/cannot-build-root-6-10-04-tbb-download-fails/26075/3):
>
> The problem is not that the package does not exist, but that [https://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources](https://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources) is currently down. Please use system TBB or try again later. The repository should be back up soon. Cheers,

My question was if it is possible to have CMake not stop on these sort of failed downloads and instead just provide a warning and a flag that an optional package wasn’t available and then continue with the build.

---

<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:** [March 12, 2019, 7:51am UTC](https://root-forum.cern.ch/t/offline-build-update/32725/8 "2019-03-12T07:51:15Z")

</div>

Closed on March 12, 2019, 7:51am UTC

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