Install Root v5.34.34

I am loading python2 (all three versions are built with gcc-8.3.1, ROOT5 is built with gcc-7.5.0, would these two gcc versions conflict?)

[wshi@login5.summit ProdROOT]$ module load python/2.7.15
[wshi@login5.summit ProdROOT]$ which python
/sw/summit/spack-envs/base/opt/linux-rhel8-ppc64le/gcc-8.3.1/python-2.7.15-6u3drknv3x3ocyhzgcqzrxjdaccpuxcp/bin/python

and configure with the following

./configure --disable-unuran --disable-vc --enable-soversion --enable-minuit2 --enable-roofit --enable-python --disable-x11 --disable-mysql

Which compiler option should I add then: --enable-cxx17, or --enable-cxx20?

Btw, is the following considered a final fix? Is this going to be committed to the root v5 patches branch?

You’d better never mix compilers.
Compile your ROOT with gcc 8.3.1 (I don’t expect problems) if your “python” uses it.

You may need the additional “--enable-cxx11” or “--enable-cxx14” flag with compilers that default to C++17 (in my case gcc 11.x).

I’ve already asked @pcanal to implement a fix in the form (actually, you could test it):

#   if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#      define R__BYTESWAP
#   endif

The machine doesn’t provide gcc 8.3.1 for users to load though.

[wshi@login5.summit ~]$ module available gcc

------------------------------------------------------------------ /sw/summit/spack-envs/base/modules/site/Core ------------------------------------------------------------------
   gcc/7.5.0 (L)    gcc/9.1.0 (D)    gcc/9.3.0    gcc/10.2.0    gcc/11.1.0    gcc/11.2.0    gcc/12.1.0

-------------------------------------------------------------------------- /sw/summit/modulefiles/core ---------------------------------------------------------------------------
   hdf5_perf/1.10.6.gcc

  Where:
   L:  Module is loaded
   D:  Default Module

What’s the best way to proceed?

That is strange.
How come they provide software built with compilers that they do not provide?

Can it be that gcc 8.3 is the default compiler on this system (and you do not need to load any additional module)?

If not, from your list, gcc 9.1.0 is marked as the “D: Default Module” so maybe you could try to build ROOT with it.

You are right, 8.3.1 is the default, I don’t need to load.

o.k. make sure you have “gcc”, “cc”, “g++”, “c++”, and “gfortran” available (check all of them with “--version”).

Here they are:

[wshi@login1.summit ~]$ gcc --version
gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[wshi@login1.summit ~]$ cc --version
IBM XL C/C++ for Linux, V16.1.1 (5725-C73, 5765-J13)
Version: 16.01.0001.0010
[wshi@login1.summit ~]$ g++ --version
g++ (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[wshi@login1.summit ~]$ c++ --version
c++ (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[wshi@login1.summit ~]$ gfortran --version
GNU Fortran (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So, “cc --version” is a bit worrying.
Quite sometimes, software unconditionally calls “cc” (“c++”), expecting that it is the same as “gcc” (“g++”).
So, “cc” (“c++”) should be a symbolic link to “gcc” (“g++”).
Maybe you could try to talk to your system administrators.

Well, try (it returns “cc” for me): root-config --cc

Using my previous ROOT built without enabling python/roofit/minuit, it gives:

[wshi@login5.summit v5-34-00-patches]$ root-config --cc

gcc

Then this means ROOT expects cc to be the same as gcc? and I should ask admin to sym link the two?

It means that ROOT considers “gcc” to be the C compiler.
However, other software which uses ROOT libraries often defaults to “cc” (I’ve had it many times).
I would ask administrators to make a symbolic link from “gcc” to “cc” (there already exists the link from “g++” to “c++”).

When writing my own makefiles, I always use:
CC=$(shell root-config --cc)
CXX=$(shell root-config --cxx)

When running “./configure”, the first several lines will tell you which C, C++, and F77 compilers it will try to use.

BTW. @pcanal committed the fix. Try to get the newest source code and build it from scratch (just to make sure it works fine).

The output of configure (with gcc8.3.1 and python/2.7.15)

./configure --disable-unuran --disable-vc --enable-soversion --enable-minuit2 --enable-roofit --enable-python --disable-x11 --disable-mysql

is attached.
configure.out.txt (6.3 KB)

Under which gcc should I test, 8.3.1?

The newest source code should work with any compiler.

BTW. Your new “configure” output looks fine.

Build is successful with gcc 7.5.0 using this

./configure --disable-unuran --disable-vc --enable-soversion --build=debug
make

Build with gcc 8.3.1 says successful, but the “bin/root ” executable is not built. make output attached

./configure --disable-unuran --disable-vc --enable-soversion --enable-minuit2 --enable-roofit --enable-python --disable-x11 --disable-mysql
make

make.out.txt (2.9 MB)

I can see it:

(...)
bin/rmkdepend -R -fmain/src/rmain.d -Y -w 1000 -- -pipe -Wall -m64 -fPIC -fsigned-char -DR__ppc64 -I/usr/X11/include -Iinclude    -pthread -D__cplusplus -- /autofs/nccs-svm1_home1/wshi/ProdROOT/v5-34-00-patches/main/src/rmain.cxx
g++ -O2 -pipe -Wall -m64 -fPIC -fsigned-char -DR__ppc64 -I/usr/X11/include -Iinclude    -pthread -o main/src/rmain.o -c /autofs/nccs-svm1_home1/wshi/ProdROOT/v5-34-00-patches/main/src/rmain.cxx
g++ -m64 -O2  -o bin/root.exe main/src/rmain.o  \
	   -Llib -lCore -lCint -lRint -lm -ldl  -pthread  
g++ -m64 -O2  -o bin/rootn.exe main/src/rmain.o  \
	   -Llib -lNew -lCore -lCint -lRint -lm -ldl  -pthread  
(...)

Well, I think I understand what you mean. The small “bin/root” front-end program is not present. This is normal when you request “--disable-x11” (you then get the real ROOT executables, “root.exe” and “rootn.exe”, only).

BTW. If you have the default GCC 8.3.1 suite installed, can it be that you also have some default Python? Without loading any module, try “python2 --version” and “python3 --version”.

It does have default python:

[wshi@login2.summit ~]$ python2 --version
Python 2.7.17
[wshi@login2.summit ~]$ python3 --version
Python 3.6.8

Also ROOT5 builds fine with gcc 8.3.1 and python/2.7.15, I think it is working now. Thanks all very much for helping me!

It seems to me that a better idea would be to use one of these default Python versions.
Create a symbolic link to “python” and make sure that the corresponding “devel” package is installed, too.

Could you elaborate on why this way is better? (and why we need to install the python2-devel package?)
(or what might be problematic if we just load the python module)

If one (i.e., ROOT) wants to link against “python3” (“python2”) shared libraries, one needs the corresponding “python3-devel” (“python2-devel”) package.

I think one needs the “python” symbolic link only when building ROOT (with “./configure” but not with CMake). Afterward, one can simply explicitly call “python3” (“python2”) and “import ROOT”.

In general, I prefer the system-provided Python versions. I assume they get “bug fixes” at regular intervals, and there are usually plenty of additional packages available (the “numpy” being the most important for ROOT users).
Strangely, you have the 2.7.17 version, though you should have the 2.7.18 (lazy system administrators?).

I don’t trust “extra modules”. They are compiled by somebody at one time. From my experience, they are purely tested, and they never get “bug fixes”.
If you really want a specific version of some software, you need to build it and maintain it yourself (like you do with ROOT).

Hi this is a follow-up: are there any standard checks within ROOT to make sure ROOT (and each module like roofit etc) is built correctly and returns the same result as another ROOT build on other machines? I assume we can use the example macros in the /tutorial directory?

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