I tried to build the root from scratch in a docker container. I build everything from the source and root prompt seems ok after installing it. However, root is broken after I deleted build directory. It shows me errors like
input_line_1:1:2: fatal error: module file '/home/username/packages/cern-root/build-v6-30-04/lib/libc.pcm' not found: module file not found
#include <new>
^
input_line_1:1:2: note: imported by module 'std' in '/opt/root-v6.30.04/lib/std.pcm'
Warning in cling::IncrementalParser::CheckABICompatibility():
Failed to extract C++ standard library version.
Replaced symbol atexit cannot be found in JIT!
Replaced symbol at_quick_exit cannot be found in JIT!
Module libc not found.
Failed to load module std
<<< cling interactive line includer >>>: fatal error: module file '/home/username/packages/cern-root/build-v6-30-04/lib/libc.pcm' not found: module file not found
<<< cling interactive line includer >>>: note: imported by module '_Builtin_intrinsics' in '/opt/root-v6.30.04/lib/_Builtin_intrinsics.pcm'
Failed to load module _Builtin_intrinsics
Failed to load module ROOT_Foundation_C
Failed to load module ROOT_Rtypes
Failed to load module ROOT_Foundation_Stage1_NoRTTI
Failed to load module Core
...
I have truncated more error messages.
To reproduce the problem, one can follow the dockerfile as attached.
I wonder if I made anything wrong in the cmake configuration. Suggestions are welcome! I would like to decouple the build directory from the installation.
I will take a deeper look into your issue, but first of all I would like to ask if you considered using the already built docker images for 6.30.04: Docker ?
I do not want to use docker because I need simple gui.
The reason why I would like to build docker on debian is because I am working on debian and I want to package the binary from docker to my debian desktop.
I tried to build root directly on debian. However, I am not sure why I always encounter the issue
Module libc not found.
I built v6.28.06 last year and there was no such warning. I tried to upgrade to secured release and now I face this problem. The warning message event shows up for v6.28.06 now which is weird. I guess it is related to changes in my debian environment. I do not have an idea how to reproduce this separate issue. Similar issues were also asked in the fora but never answered. See Module libc not found
When I build on fresh debian docker, there is no issue about libc not found. However, I have issue to isolate install from build.
Thank you for giving me some more details. So what I did now, was to use your script to simply build root on my macbook (could be possible there are still some differences). At first I could reproduce the issue and there was nothing in my install directory but then I realised the main issue with your script here is that you are trying to install root in /opt/ directory that normally requires the sudo rights. Additionally, another thing, which you may need is another cmake option: -Dbuiltin_glew=ON (and this should have been indicated by the error message while trying to run this script). So eventually, I have:
I am afraid I am not clear why /opt needs root permission in a docker/podman environment. I have executables of root under /opt in docker/podman environment in my test on debian desktop.
In the docker environment, I can execute root unless I delete or rename the build directory. I am confused why root cannot recognize the install directory as path for library loading.
but does executing the script itself work for you? Have you tried running it before building the docker image itself? It didn’t work for me in a sense that nothing was installed in the install directory because I could not access it. What happens if you change the install directory to somewhere else, for example, the same directory where you have your source and build directories?
Regarding Glew - it is CMake related, when I run the script I see:
CMake Error at cmake/modules/SearchInstalledSoftware.cmake:615 (message):
Please enable builtin Glew due bug in latest CMake (use cmake option
-Dbuiltin_glew=ON).
Call Stack (most recent call first):
CMakeLists.txt:300 (include)
but it might be the case that you don’t see this issue, then you don’t need this option.
I have a full installation under /opt/root-v6.30.04. And I can have working functions under /opt/root-v6.30/. I tried a hello world example and it works perfectly. It is surprising that we have different permission to access the target directory using docker environment.
The system wide installation should be done no matter where the build directory is. I suppose root will search rpath for loading libraries. I tried to look through run path of root.
I would expect it to be the installation directory. However, it seems not. The option -Drpath=ON is default on for root. I wonder what is the effects of this option.
I am also curious the effects of option gnuinstall which is default off, as indicated in the instruction for build.
I’m sorry for the delayed response - maybe you’ve found a solution to your problem in the meantime, but let me post here what worked for me just in case. What I followed directly is the Dockerfile for ubuntu that we use to build images and what I now used for your case is:
This allows me to build a working version of root without changing your bash script. In order to build root inside the image I run your bash script and sourced the /bin/thisroot.sh.