[DEV][GENERAL] What is the purpose of `srcdir` option of `root-config`


ROOT Version: 6.14.02
Platform: Archlinux x86_64
Compiler: GCC 8.2.0 / CLANG 6.0.1


The root-config script seems to belong to the group of scripts *-config that provides information about installed project along with pkg-config. But that script has very strange option srcdir, whose value is full path to a directory with unpacked sources. After installation (either as “standalone” or “gnuinstall”) this path will be useless in most cases and I’m wondering what is the purpose of this option?


WBR, Vladimir Lomov

During development, it can help find back the source directory of the build you are currently using.

After a release, it can be used for ‘forensic’ analysis is something goes wrong with the packaging and/or distribution.

Cheers,
Philippe.

1 Like

Got it.

Does it all mean that it shouldn’t be provided as part of distribution package? Only for packages distributed by root.cern.ch site? But then how to get CFLAGS and LDFLAGS values (ROOT doesn’t provide pkg-config settings, only cmake ones)?

P.S. I’m trying to get the so called “reproducible” builds, this has different applications. But still this parameter is a bit odd. If ROOT is distributed by a Linux distribution as a “native” package then there is no need to know the SRCDIR because anyone could rebuild the package. On the other hand if ROOT is downloaded from ROOT official website then you may always add necessary build information into the archive.

P.P.S. I’m favor for simple and elegant solutions, but IMHO, this is very strange parameter.


WBR, Vladimir Lomov

Does it all mean that it shouldn’t be provided as part of distribution package?

What shouldn’t? root-config is essential for user’s ease of use.

As far as the --srcdir, It still should be distributed, having the forensic information available has also been useful for use in practical cases [Sometimes users get confused and are sure they are using a downloaded version that fails in weird ways and then we could discover (be sure that) it was actually a local broken build]

Hello Philippe,

Either distribute the root-config or patch root-config to remove that option (though Archlinux doesn’t patch sources, only fixes issues between releases) if the file is distributed as part of distribution package (depending on type of installation).

Yes, especially if one uses ROOT libraries to build an own shared library.

Yes, I agree here but experience tells me that srcdir isn’t enough (in fact, instead of root-config one could use command -v root-config to identify where ROOT is located and then to inspect bin directory, as option).

May I suggest one enhancement: instead of srcdir in root-config (then remove it) add configuration option (like -DROOT_BUILD_ID=ON, on by default) to store more detailed information: build ID (based on timestamp, for example), timestamp, OS information (distribution, release, compiler, glibc, python), build and source directories and especially configuration options which are set at build time by cmake. The last, I think, is much valuable. Depending on type of installation (“standalone” vs “gnuinstall”) place this file either into root directory (for “standalone” this is -DCMAKE_INSTALL_PREFIX) or into etc/root (either /etc/root or /usr/local/etc/root). Then root-config should seek for this file to get these data and output it for an user.

P.S. I had bad experience when one of a student had build the ROOT from the source and something didn’t work in his ROOT installation. Unfortunately, I couldn’t quickly find with what options ROOT was build. If I had information at hand at that time I could quickly reproduce the installation and help for that student remotely.


WBR, Vladimir Lomov

To clarify my propose. Current output of root-config is informative but in some places it is hard to use it. For example:

$ root-config --arch
linuxx8664gcc
$ root-config --platform
linux
$ root-config --config
AVAHI_INCLUDE_DIR=/usr/include AVAHI_client_LIBRARY=/usr/lib/libavahi-client.so AVAHI_common_LIBRARY=/usr/lib/libavahi-common.so AVAHI_core_LIBRARY=/usr/lib/libavahi-core.so BLAS_blas_LIBRARY=/usr/lib/libblas.so BONJOUR_LIBRARY=/usr/lib/libdns_sd.so CFITSIO_INCLUDE_DIR=/usr/include CFITSIO_LIBRARY=/usr/lib/libcfitsio.so DAVIX_INCLUDEDIR=/usr/include DAVIX_STATIC_INCLUDE_DIRS=/usr/include/davix DAVIX_STATIC_LIBRARIES=davix FFI_INCLUDE_DIR=/usr/lib/libffi-3.2.1/include FFTW_INCLUDE_DIR=/usr/include FFTW_LIBRARY=/usr/lib/libfftw3.so FREETYPE_INCLUDE_DIR_freetype2=/usr/include/freetype2 FREETYPE_INCLUDE_DIR_ft2build=/usr/include/freetype2 FREETYPE_LIBRARY_RELEASE=/usr/lib/libfreetype.so FTGL_INCLUDE_DIR=/usr/include FTGL_LIBRARY=/lib/libftgl.so GIF_INCLUDE_DIR=/usr/include GIF_LIBRARY=/usr/lib/libgif.so GL2PS_INCLUDE_DIR=/usr/include GL2PS_LIBRARY=/lib/libgl2ps.so GLEW_INCLUDE_DIR=/usr/include GLEW_LIBRARY_RELEASE=/usr/lib/libGLEW.so JPEG_INCLUDE_DIR=/usr/include JPEG_LIBRARY=/usr/lib/libjpeg.so LIBXML2_INCLUDE_DIR=/usr/include/libxml2 LIBXML2_LIBRARY=/usr/lib/libxml2.so LZ4_INCLUDE_DIR=/usr/include LZ4_LIBRARY=/usr/lib/liblz4.so LZMA_INCLUDE_DIR=/usr/include LZMA_LIBRARY=/usr/lib/liblzma.so MYSQL_INCLUDE_DIR=/usr/include/mysql NUMPY_INCLUDE_DIR=/usr/lib/python3.7/site-packages/numpy/core/include OPENGL_EGL_INCLUDE_DIR=/usr/include OPENGL_GLX_INCLUDE_DIR=/usr/include OPENGL_INCLUDE_DIR=/usr/include OPENGL_egl_LIBRARY=/usr/lib/libEGL.so OPENGL_glu_LIBRARY=/usr/lib/libGLU.so OPENGL_glx_LIBRARY=/usr/lib/libGLX.so OPENGL_opengl_LIBRARY=/usr/lib/libOpenGL.so OPENSSL_CRYPTO_LIBRARY=/usr/lib/libcrypto.so OPENSSL_INCLUDE_DIR=/usr/include OPENSSL_SSL_LIBRARY=/usr/lib/libssl.so PCRE_INCLUDE_DIR=/usr/include PCRE_PCREPOSIX_LIBRARY=/usr/lib/libpcreposix.so PCRE_PCRE_LIBRARY=/usr/lib/libpcre.so PC_LIBXML_INCLUDEDIR=/usr/include PC_LIBXML_INCLUDE_DIRS=/usr/include/libxml2 PC_LIBXML_LIBRARIES=xml2 PC_LIBXML_STATIC_INCLUDE_DIRS=/usr/include/libxml2 PC_SQLITE_INCLUDEDIR=/usr/include PC_SQLITE_LIBRARIES=sqlite3 PNG_LIBRARY=/usr/lib/libpng.so PNG_LIBRARY_RELEASE=/usr/lib/libpng.so PNG_PNG_INCLUDE_DIR=/usr/include POSTGRESQL_INCLUDE_DIR=/usr/include POSTGRESQL_LIBRARY=/lib/libpq.so PYTHIA6_LIBRARY=/usr/lib/libPythia6.so PYTHIA8_INCLUDE_DIR=/usr/include PYTHIA8_LIBRARY=/usr/lib/libpythia8.so PYTHON_INCLUDE_DIR=/usr/include/python3.7m PYTHON_LIBRARY=/usr/lib/libpython3.7m.so PYTHON_LIBRARY_RELEASE=/usr/lib/libpython3.7m.so SQLITE_INCLUDE_DIR=/usr/include SQLITE_LIBRARIES=/usr/lib/libsqlite3.so TBB_INCLUDE_DIR=/usr/include TBB_LIBRARY_DEBUG=/usr/lib/libtbb_debug.so TBB_LIBRARY_RELEASE=/usr/lib/libtbb.so TIFF_INCLUDE_DIR=/usr/include TIFF_LIBRARY=/usr/lib/libtiff.so TIFF_LIBRARY_RELEASE=/usr/lib/libtiff.so UNURAN_INCLUDE_DIR=/usr/include UNURAN_LIBRARY=/lib/libunuran.so VDT_INCLUDE_DIR=/usr/include VDT_INCLUDE_DIRS=/usr/include VDT_LIBRARIES=/lib/libvdt.so VDT_LIBRARY=/lib/libvdt.so X11_ICE_INCLUDE_PATH=/usr/include X11_SM_INCLUDE_PATH=/usr/include X11_X11_INCLUDE_PATH=/usr/include X11_XShm_INCLUDE_PATH=/usr/include X11_XSync_INCLUDE_PATH=/usr/include X11_XTest_INCLUDE_PATH=/usr/include X11_Xaccess_INCLUDE_PATH=/usr/include X11_Xaccessrules_INCLUDE_PATH=/usr/include X11_Xaccessstr_INCLUDE_PATH=/usr/include X11_Xau_INCLUDE_PATH=/usr/include X11_Xcomposite_INCLUDE_PATH=/usr/include X11_Xcursor_INCLUDE_PATH=/usr/include X11_Xdamage_INCLUDE_PATH=/usr/include X11_Xdmcp_INCLUDE_PATH=/usr/include X11_Xfixes_INCLUDE_PATH=/usr/include X11_Xft_INCLUDE_PATH=/usr/include X11_Xi_INCLUDE_PATH=/usr/include X11_Xinerama_INCLUDE_PATH=/usr/include X11_Xinput_INCLUDE_PATH=/usr/include X11_Xkb_INCLUDE_PATH=/usr/include X11_Xkbfile_INCLUDE_PATH=/usr/include X11_Xkblib_INCLUDE_PATH=/usr/include X11_Xlib_INCLUDE_PATH=/usr/include X11_Xmu_INCLUDE_PATH=/usr/include X11_Xpm_INCLUDE_PATH=/usr/include X11_Xrandr_INCLUDE_PATH=/usr/include X11_Xrender_INCLUDE_PATH=/usr/include X11_Xscreensaver_INCLUDE_PATH=/usr/include X11_Xshape_INCLUDE_PATH=/usr/include X11_Xt_INCLUDE_PATH=/usr/include X11_Xutil_INCLUDE_PATH=/usr/include X11_Xv_INCLUDE_PATH=/usr/include X11_dpms_INCLUDE_PATH=/usr/include X11_xf86misc_INCLUDE_PATH=/usr/include X11_xf86vmode_INCLUDE_PATH=/usr/include XROOTD_INCLUDE_DIR=/usr/include/xrootd XROOTD_XrdCl_LIBRARY=/usr/lib/libXrdCl.so XROOTD_XrdClient_LIBRARY=/usr/lib/libXrdClient.so XROOTD_XrdUtils_LIBRARY=/usr/lib/libXrdUtils.so ZLIB_INCLUDE_DIR=/usr/include ZLIB_LIBRARY_RELEASE=/usr/lib/libz.so xxHash_INCLUDE_DIR=/usr/include xxHash_LIBRARY=/usr/lib/libxxhash.so
$ root-config --features
asimage astiff bonjour builtin_llvm builtin_clang cling cxx17 davix exceptions explicitlink fftw3 fitsio fortran gdml genvector gnuinstall gsl_shared http imt mathmore minuit2 mysql opengl pch pgsql pythia6 pythia8 python qt5web roofit root7 shared soversion sqlite ssl table thread tmva tmva-cpu unuran vdt x11 xft xml xrootd
$ root-config --python-version                                                                                                                           

The --arch and --platform is too generic, --config is (almost) not reusable (one might use something like $(root-config --config) cmake -DCMAKE_INSTALL_PREFIX=... ...), while from --features it is a bit difficult to understand what features are enabled and what ones are disables (cp. with output from vim:

$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug 10 2018 01:23:32)
Included patches: 1-264
Compiled by Arch Linux
Huge version without GUI.  Features included (+) or not (-):
+acl               +extra_search      +mouse_netterm     +tag_old_static
+arabic            +farsi             +mouse_sgr         -tag_any_white
+autocmd           +file_in_path      -mouse_sysmouse    -tcl
+autochdir         +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          -toolbar
+cindent           +insert_expand     +path_extra        +user_commands
-clientserver      +job               +perl/dyn          +vartabs
-clipboard         +jumplist          +persistent_undo   +vertsplit
+cmdline_compl     +keymap            +postscript        +virtualedit
+cmdline_hist      +lambda            +printer           +visual
+cmdline_info      +langmap           +profile           +visualextra
+comments          +libcall           +python/dyn        +viminfo
+conceal           +linebreak         +python3/dyn       +vreplace
+cryptv            +lispindent        +quickfix          +wildignore
+cscope            +listcmds          +reltime           +wildmenu
+cursorbind        +localmap          +rightleft         +windows
+cursorshape       +lua/dyn           +ruby/dyn          +writebackup
+dialog_con        +menu              +scrollbind        -X11
+diff              +mksession         +signs             -xfontset
+digraphs          +modify_fname      +smartindent       -xim
-dnd               +mouse             +startuptime       -xpm
-ebcdic            -mouseshape        +statusline        -xsmp
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_clipboard
+eval              +mouse_gpm         +syntax            -xterm_save
+ex_extra          -mouse_jsbterm     +tag_binary        
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -D_FORTIFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.28/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim        -lm -ltinfo -lelf -lnsl    -lacl -lattr -lgpm -ldl   -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.28/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/perl5/5.28/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc  

it has much more information in one output but, IMHO, it is much easy to understand which features this version of vim has and which it doesn’t have).

P.S. I know there is such thing as compatibility, so I don’t expect that something new will come to root-config in near future (hey, may be in ROOT7?).

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