# Questions about ROOT6 packaging

**URL:** <https://root-forum.cern.ch/t/questions-about-root6-packaging/27219>\
**Category:** ROOT\
**Created:** [December 8, 2017, 8:49am UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219 "2017-12-08T08:49:18Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![vp1981](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/f0a364/32.png) [@vp1981](https://root-forum.cern.ch/u/vp1981)\
**Post date:** [December 8, 2017, 8:49am UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/1 "2017-12-08T08:49:18Z")

</div>

for Archlinux.

Hello,  
I’m packaging (unofficially) ROOT6 for Archlinux, this is [build script](https://bitbucket.org/vp1981/pkgbuild/src/1e9be7576b5d3eab4f50ae239034f353fd2a502a/root-extra/PKGBUILD?at=master&fileviewer=file-view-default) and ROOT6 [configuration](https://bitbucket.org/vp1981/pkgbuild/src/1e9be7576b5d3eab4f50ae239034f353fd2a502a/root-extra/settings-14.cmake?at=master) (they are a bit different than AUR root-extra package). The package builds fine but I found issues that what to resolve.

1. Though I enable python binding (python3) after installation (

```auto
make install DESTDIR=PKGDIR

```

) there are no

```auto
ROOT.py

```

and

```auto
cmdLineUtils.py

```

files in

```auto
/usr/lib/root

```

that can be found in precompiled binaries. Is there problem with the configuration? Why python binding is not built?

Side note:

```auto
cmdLineUtils.py

```

in precompiled binaries the first line is

```auto
/usr/bin/env @python@

```

. Is this

```auto
@python@

```

correct? Is this file used by ROOT?

1. Is it possible to regenerate

```auto
*.pcm

```

files (they are located in

```auto
/usr/lib/root

```

)? The problem is that they have full path to these files but pointing to build directory. This is true for precompiled binaries too. Is it OK? Or they are not used?

1. Returning to my old [question](https://root-forum.cern.ch/t/few-questions-about-root-installation/23801/5). Now I reconsider some points mentioned there. Consider following proposal:

- move following directories from /etc/root to /usr/lib/root:

```auto
cling
dictphc
plugins

```

- move following directories from /etc/root to /srv/root

```auto
html
http
notebook

```

- move file

```auto
/etc/root/allDict.cxx.pch

```

to

```auto
/usr/lib/root

```

In previous thread I was told that

```auto
html

```

is from old doc system but still I think it is worth to move to that directory.

As for

```auto
notebook

```

I still think that as this is “web application” then it is worth to place it into

```auto
/srv/root

```

---

<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:** [December 8, 2017, 8:56pm UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/2 "2017-12-08T20:56:31Z")

</div>

> [@vp1981](#):
>
> /usr/bin/env @python@

Just a comment on this one line. This looks as though this is a file that is intended to be configured by CMake and have `@python@ replaced with the python version indicated during the configuration.

---

<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 9, 2017, 8:55am UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/3 "2017-12-09T08:55:32Z")

</div>

Hi @vp1981, I intend to work on packaging ROOT for some Linux distributions in the next year, and on making it easier for others to package it in other distros too. The idea is to provide scripts for configuring and compiling ROOT and to make ROOT follow FHS more closely, as you propose above. As for the question you have, let me answer it in parts.

About Python

> [@vp1981](#):
>
> Though I enable python binding (python3) after installation (
> 
> make install DESTDIR=PKGDIR
> 
> ) there are no
> 
> ROOT.py
> 
> and
> 
> cmdLineUtils.py
> 
> files in
> 
> /usr/lib/root
> 
> that can be found in precompiled binaries. Is there problem with the configuration? Why python binding is not built?

I saw in your configuration that you have `python=OFF` and `python3=ON`, please invert that to `python=ON` and `python3=OFF`, regardless of what version of python you are trying to use. If you need to compile ROOT against a specific Python interpreter, please set `-DPYTHON_EXECUTABLE=/full/path/to/python` with CMake. That should solve the problem that you have. There is a minor bug with the `python3` option in CMake, so it only works if you are compiling against Python 3.5.

---

<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 9, 2017, 9:02am UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/4 "2017-12-09T09:02:10Z")

</div>

> [@vp1981](#):
>
> Is it possible to regenerate
> 
> \*.pcm
> 
> files (they are located in
> 
> /usr/lib/root
> 
> )?

At the moment, there are still some hard paths in the build system, so it’s difficult to make ROOT work if you set configuration directories individually, like you are doing in your build script. I recommend that for the time being, you install ROOT into `/opt/root` and add `/opt/root/bin` to `$PATH` and `/opt/root/lib` to `$PYTHONPATH`. Please make sure to configure ROOT with `-Drpath=ON` and `-Dsoversion=ON`, and use the same compiler that is used for the rest of the system to avoid ABI incompatibilities.

In the future, we will try to make the installed files go automatically into the right places according to their purpose instead of many of them going to `/etc/` as happens now. Please let us know if you have any other questions. It will be nice if we can make ROOT available to at least the major distributions in the next coming months.

---

<div class="post-metadata">

**Author:** ![vp1981](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/f0a364/32.png) [@vp1981](https://root-forum.cern.ch/u/vp1981)\
**Post date:** [December 9, 2017, 11:32am UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/5 "2017-12-09T11:32:08Z")

</div>

Thank you amadio.

As for python, it is a bit confusing to have ‘python’ and ‘python3’ options and that only the first one has effect. I’ll change configuration settings and recompile the ROOT package.

---

<div class="post-metadata">

**Author:** ![vp1981](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/f0a364/32.png) [@vp1981](https://root-forum.cern.ch/u/vp1981)\
**Post date:** [December 9, 2017, 12:03pm UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/6 "2017-12-09T12:03:14Z")

</div>

Hello Amadio.

> [@amadio](#):
>
> At the moment, there are still some hard paths in the build system, so it’s difficult to make ROOT work if you set configuration directories individually, like you are doing in your build script.

Got it, but I don’t get this one:

> [@amadio](#):
>
> I recommend that for the time being, you install ROOT into /opt/root and add /opt/root/bin to $PATH and /opt/root/lib to $PYTHONPATH.

What do you mean saying “install ROOT”? Do you mean to do

```auto
make install

```

in build directory? But that is against the whole idea to build on some system the package and install it on other ones.

I compile ROOT for Archlinux (the Archlinux package) and install it on Archlinux hosts where I need it. I also compile ROOT for Ubuntu (not Ubuntu package, that’s too difficult to me) and do

```auto
make install

```

(prefix is set to /usr/local/opt/root), that’s the only system where I run that command (I don’t use Ubuntu, I make tar.xz archive of /usr/local/opt/root for my students).

I wondered about \*.pcm files because they contain information about full path to build directory (just look into pcm in precompiled binaries provided by root.cern.ch), so I suspected that they are either useless (it is unlikely that users will download precompiled binaries, unpack them, check the build path stored in \*.pcm files and unpack the tar.gz archive in corresponding place) or that full path is not used at all (why then it is written to pcm file?) or there is easy way to regenerate them with correct current path.

* * *

Vladimir Lomov

---

<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 11, 2017, 10:04am UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/7 "2017-12-11T10:04:18Z")

</div>

> [@vp1981](#):
>
> What do you mean saying “install ROOT”? Do you mean to do
> 
> make install
> 
> in build directory? But that is against the whole idea to build on some system the package and install it on other ones.

No, that is not what I meant. I meant that you should configure ROOT with prefix equal to `/opt/root` (or `/usr/local/opt/root` as you have), then `make install`, which will install ROOT into that directory with consistent file paths. Don’t configure ROOT to install into the build directory, that is a bad idea. However, you should not build it in one system to install on another (e.g. build on Arch, install on Ubuntu), because that will most likely not work. The reason is that each system uses its own compiler, and the libraries generated in one system may not be ABI compatible with libraries from another system.

BTW, once you have ROOT built in your build directory, you may run `cpack` to produce the tarball directly, without needing to install it in your system first.

The PCMs are precompiled files that ROOT loads during runtime; they are not useless. They will have the right path in them once you install ROOT.

---

<div class="post-metadata">

**Author:** ![vp1981](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/f0a364/32.png) [@vp1981](https://root-forum.cern.ch/u/vp1981)\
**Post date:** [December 11, 2017, 2:10pm UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/8 "2017-12-11T14:10:20Z")

</div>

Hello Amadio,

sorry, I misunderstood your answer and replied in wrong way. Let’s try again.

> [@amadio](#):
>
> … you should configure ROOT with prefix equal to `/opt/root` (or `/usr/local/opt/root` as you have)

like this

```auto
cmake -DCMAKE_INSTALL_PREFIX=/opt/root

```

or `-DCMAKE_INSTALL_PREFIX=/usr/local/opt/root`.

> [@amadio](#):
>
> … then `make install`, which will install ROOT into that directory with consistent file paths

I’m not sure either this assumes that `-Dgnuinstall=OFF` or not but. Still as I understand this means that ROOT will be installed in that directory but all these files there are **NOT** controlled by package manager (pacman in case of Archlinux). That is **OPPOSITE** I try to do.

I’m deliberately building ROOT package (as Archlinux package) on system with enough space, memory and with high CPU (I must “thanks” clang) in order to install the package on other hosts with Archlinux on them.

I mentioned Ubuntu in previous message because I’m using Archlinux but most my students are using Ubuntu, so I have to compile ROOT for Ubuntu (17.10) in VM and install ROOT into `/usr/local/opt/root`, after that I’m just do

```auto
cd /usr/local/opt
tar cf ~/tmp/root.tar root
xz -v ~/tmp/root.tar

```

and give them the `tar.xz` archive.

> [@amadio](#):
>
> once you have ROOT built in your build directory, you may run `cpack` to produce the tarball directly, without needing to install it in your system first.

I didn’t know, will use (for Ubuntu of course), thank you.

> [@amadio](#):
>
> The PCMs are precompiled files that ROOT loads during runtime; they are not useless. They will have the right path in them once you install ROOT.

And I don’t this at all. I downloaded precompiled binaries from root site: for Fedora 24, for CentOS7, Ubuntu 16 and MacOS x64-10.13-clang90, unpacked them, `cd ~/tmp/root/$OS/lib` and did, for example for fedora

```auto
$ strings libASImageGui_rdict.pcm
root
TFile
/mnt/build/workspace/root-release-6.10/BUILDTYPE/Release/COMPILER/native/LABEL/fedora24/build/root_v6.10.08-cmake/lib/libASImageGui_rdict.pcm
/mnt/build/workspace/root-release-6.10/BUILDTYPE/Release/COMPILER/native/LABEL/fedora24/build/root_v6.10.08-cmake/lib/libASImageGui_rdict.pcm
TObject
EMPTY
Basic ROOT object
TFile
/mnt/build/workspace/root-release-6.10/BUILDTYPE/Release/COMPILER/native/LABEL/fedora24/build/root_v6.10.08-cmake/lib/libASImageGui_rdict.pcm
TObject
EMPTY
Basic ROOT object
TFile
/mnt/build/workspace/root-release-6.10/BUILDTYPE/Release/COMPILER/native/LABEL/fedora24/build/root_v6.10.08-cmake/lib/libASImageGui_rdict.pcm

```

Is this OK? I don’t know, because I’m free to unpack `root_v6.10.08.Linux-fedora24-x86_64-gcc6.1.tar.gz` to any directory I have write access (into `~/opt` or `/opt/root` or `/usr/local/opt/root` if I’m an admin), so these paths will certainly be wrong if they are used.

---

<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 11, 2017, 2:30pm UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/9 "2017-12-11T14:30:51Z")

</div>

> [@vp1981](#):
>
> like this
> 
> cmake -DCMAKE\_INSTALL\_PREFIX=/opt/root
> 
> or -DCMAKE\_INSTALL\_PREFIX=/usr/local/opt/root

This one is not so important, as long as you unpack ROOT into the same directory when installing the package in Arch. If you want to prepare the tarball without installing, you can do `env DESTDIR=/tmp/root cmake --build . --target install`, and cmake will install into `/tmp/root/` but leave the relevant paths pointing to `/opt/root/` as you configured. Then you can tar the installed files into your Arch package.

As for the PCM paths, it’s probably a bug. It is probably harmless, but the paths should point to the right place. I will follow this up and file a JIRA issue if needed. Cheers,

---

<div class="post-metadata">

**Author:** ![vp1981](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/f0a364/32.png) [@vp1981](https://root-forum.cern.ch/u/vp1981)\
**Post date:** [December 12, 2017, 12:41am UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/10 "2017-12-12T00:41:28Z")

</div>

Hello Amadio.

> [@amadio](#):
>
> as long as you unpack ROOT into the same directory when installing the package in Arch.

That what package manager usually do.

> [@amadio](#):
>
> If you want to prepare the tarball without installing, you can do env DESTDIR=/tmp/root cmake --build . --target install, and cmake will install into /tmp/root/ but leave the relevant paths pointing to /opt/root/ as you configured

I’ll try this one (I do `make DESTDIR=PATH_TO_DESTDIR install`).

> [@amadio](#):
>
> As for the PCM paths, it’s probably a bug. It is probably harmless, but the paths should point to the right place. I will follow this up and file a JIRA issue if needed.

Thank you Amadio, esp. for your patience.

---

<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 12, 2017, 6:54am UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/11 "2017-12-12T06:54:06Z")

</div>

> [@vp1981](#):
>
> I’ll try this one (I do make DESTDIR=PATH\_TO\_DESTDIR install).

It’s the same thing, the advantage of using cmake is that it will also work if you use ninja as a generator.

Well, let us know if you have any more questions, and if an official package for ROOT lands on Arch, let us know too!

Thank you,

---

<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:** [December 26, 2017, 6:54am UTC](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/12 "2017-12-26T06:54:06Z")

</div>

Closed on December 26, 2017, 6:54am UTC

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