ROOT-CONFIG(1)
π NAME π
so like, this is root-config β that's section 1 of the general commands manual, bestie β and it's the ROOT utility that handles your Makefiles for you π
β¨ SYNOPSIS β¨
root-config [options]
π¦ DESCRIPTION π¦
root-config is the little tool that figures out, and tells you, which compiler and linker flags you need to actually compile and link programs that use ROOT. it's giving personal assistant for your build system, no cap.
drop this in your Makefile to use the built-in rules of GNU make:
CPPFLAGS += $(shell root-config --cflags)
LDLIBS += $(shell root-config --libs)
LDFLAGS += $(shell root-config --ldflags)
%Cint.cxx:Include.h LinkDef.h
rootcint -f $@ -c $^
and if you're doing GUIs, just swap --libs for --glibs π«Ά
You may also find the automake(1), autoconf(1), and libtool(1) macro file /usr/share/aclocal/root.m4 useful. If that macro file isn't installed where aclocal will find it, copy the contents to your local acinclude.m4 file. In the directories you use ROOT libraries, have in your Makefile.am file:
lib_LTLIBRARIES = libFoo.la
pkginclude_HEADERS = Foo.h
noinst_HEADERS = FooCint.h
libFoo_la_SOURCES = Foo.cxx FooCint.cxx
libFoo_la_LDFLAGS = -version-info 1:0 -R @ROOTLIBDIR@
libFoo_la_LDADD = -lCore -lCint @ROOTAUXLIBS@
BUILT_SOURCES = FooCint.cxx FooCint.h
AM_CPPFLAGS = -I@ROOTINCDIR@
AM_LDFLAGS = -L@ROOTLIBDIR@
CLEANFILES = *Cint.cxx *Cint.h *~ core
%Cint.cxx %Cint.h:Include.h LinkDef.h
@ROOTCINT@ -f $*Cint.cxx -c $(INCLUDES) $(AM_CPPFLAGS) $^
where you should substitute Foo with whatever, and list the appropriate source files in the _SOURCES variable. In you configure.in file, put:
AC_PROG_CC
AC_PROG_CXX
ROOT_PATH
AM_PROG_LIBTOOL
along with any other macros you may need π
Note that the ROOT_PATH macro takes three optional arguments: the minimal ROOT version to use, action if ROOT is found, and action if ROOT isn't found. Some examples are
ROOT_PATH(3.03/05, , AC_MSG_ERROR(Your ROOT version is too old))
ROOT_PATH(, AC_DEFUN(HAVE_ROOT))
For example, if you want to compile some part of your source tree conditionally on wether ROOT is present or not, you can put in your configure.in file
ROOT_PATH(,
[
AC_DEFUN(HAVE_ROOT)
have_root=yes
])
AM_CONDITIONAL(GOT_ROOT, test "x$have_root" = "xyes")
And then in some Makefile.am
EXTRA_SOURCES = root_dependent_source.cc
if GOT_ROOT
LIBFOOXTRA = root_dependent_source.cc
else
LIBFOOXTRA =
endif
lib_LTLIBRARIES = libFoo.la
libFoo_la_SOURCES = Foo.cc $(LIBFOOXTRA)
The full list of substitution variables are:
ROOTCONFβ full path toroot-configROOTEXECβ full path torootROOTCINTβ full path torootcintROOTLIBDIRβ Where the ROOT libraries areROOTINCDIRβ Where the ROOT headers areROOTCFLAGSβ Extra compiler flagsROOTLIBSβ ROOT basic librariesROOTGLIBSβ ROOT basic + GUI librariesROOTAUXLIBSβ Auxiliary libraries and linker flags for ROOTROOTAUXCFLAGSβ Auxiliary compiler flagsROOTRPATHβ Same asROOTLIBDIR
π OPTIONS π
--helpβ Give a short list of options available, and exit--versionβ Report the version number of installed ROOT, and exit.--prefix=<prefix>β If no arguments are given, reports where ROOT is installed. With an argument of=<prefix>, set the base of the subsequent options to<prefix>. If\--exec-prefixis passed with an argument, it overrides the argument given to\--prefixfor the library path.--exec-prefix=<prefix>β If no argument is given, report where the libraries are installed. If an argument is given, use that as the installation base directory for the libraries. This option does not affect the include path.--libdirβ Print the directory where the ROOT libraries are installed.--incdirβ Print the directory where the ROOT headers are installed.--libsβ Output a line suitable for linking a program against the ROOT libraries. No graphics libraries are included.--glibsβ As above, but also output for the graphics (GUI) libraries.--evelibsβ As above, but also output for the graphics libraries and Eve libraries.--cflagsβ Output a line suitable for compiling a source file against the ROOT header (class declararion) files.--newβ Put thelibNew.solibrary in the library lists. This option must be given before options--libsand--glibs.--nonewβ Compatiblity option, does nothing.--auxlibsβ Print auxiliary libraries and/or system linker flags.--noauxlibsβ Do not print auxiliary libraries and/or system linker flags in the output of--libsand--glibs.--auxcflagsβ Print auxiliary compiler flags.--noauxcflagsβ Do not print auxiliary compiler flags in the output of--cflags.--noldflagsβ Do not print library path link option in output of--libs,--evelibsand--glibs.--ldflagsβ Print additional linker flags (eg.-m64)--archβ Print the architecture (compiler/OS)--platformβ Print the platform (OS)--bindirβ Print the binary directory of the root installation (location of the root executable)--etcdirβ Print the configuration directory (place ofsystem.rootrc, mime type, valgrind suppression files and.desktopfiles)--configβ Print arguments used for./configureas used when building root. These cannot be used for./configureif root was built with CMake.--git-revisionβ Print the ROOT git revision number from which root was built.--has-<feature>β Test if<feature>has been enabled in the build process.--featuresβ Print list of all supported features--ncpuβ Print number of available (hyperthreaded) cores--python-versionβ Print the Python version used by ROOT--ccβ Print alternative C compiler specified when ROOT was built--cxxβ Print alternative C++ compiler specified when ROOT was built--f77β Print alternative Fortran compiler specified when ROOT was built--ldβ Print alternative Linker specified when ROOT was built
π SEE ALSO π
root(1), root-cint(1)
See also the ROOT webpages: http://root.cern
π ORIGINAL AUTHORS π
The ROOT team (see web page above):
- Rene Brun and Fons Rademakers
πΈ COPYRIGHT πΈ
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
π«Ά AUTHOR π«Ά
This manual page was written by Christian Holm Christensen <cholm@nbi.dk>, for the Debian GNU/Linux system (but may be used by others).
okay that's literally it, bestie π this whole page ships from ROOT, Version 3 β that's the source and the version, periodt. go forth and link your libraries, you got this β¨π
π¦ where this page comes from
- arch rolling: root 6.40.04-1 Β· LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause-LBNL AND NCSA
- arch rolling: root-cuda 6.40.04-1 Β· LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause-LBNL AND NCSA
- epel 10: root-core 6.40.04-4.el10_3 Β· LGPL-2.1-or-later AND LGPL-2.0-or-later AND ISC AND MIT AND NCSA
- epel 9: root-core 6.40.04-4.el9 Β· LGPL-2.1-or-later AND LGPL-2.0-or-later AND ISC AND MIT AND NCSA
- fedora 43: root-core 6.36.04-2.fc43 Β· LGPL-2.1-or-later AND LGPL-2.0-or-later AND ISC AND MIT AND NCSA
- fedora 43: root-core 6.36.04-2.fc43 Β· LGPL-2.1-or-later AND LGPL-2.0-or-later AND ISC AND MIT AND NCSA
- fedora 43: root-core 6.40.04-1.fc43 Β· LGPL-2.1-or-later AND LGPL-2.0-or-later AND ISC AND MIT AND NCSA
- fedora 43: root-core 6.40.04-1.fc43 Β· LGPL-2.1-or-later AND LGPL-2.0-or-later AND ISC AND MIT AND NCSA
- fedora 44: root-core 6.38.04-1.fc44 Β· LGPL-2.1-or-later AND LGPL-2.0-or-later AND ISC AND MIT AND NCSA
- fedora 44: root-core 6.38.04-1.fc44 Β· LGPL-2.1-or-later AND LGPL-2.0-or-later AND ISC AND MIT AND NCSA
- fedora 44: root-core 6.40.04-1.fc44
- fedora 44: root-core 6.40.04-1.fc44
- fedora 44: root-core 6.40.04-4.fc44 Β· LGPL-2.1-or-later AND LGPL-2.0-or-later AND ISC AND MIT AND NCSA
- fedora 44: root-core 6.40.04-4.fc44 Β· LGPL-2.1-or-later AND LGPL-2.0-or-later AND ISC AND MIT AND NCSA
- nixos 26.05: root 6.40.00
- nixpkgs unstable: root 6.40.04
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms