Problem 281 - G4 configuration command
Summary: G4 configuration command
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: config (show other problems)
Version: 3.2
Hardware: PC Linux
: P2 enhancement
Assignee: Serguei.Sadilov
URL:
Depends on:
Blocks:
 
Reported: 2001-08-07 10:34 CEST by seligman
Modified: 2003-05-22 07:20 CEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description seligman 2001-08-07 10:34:19 CEST
I'd like to make a request for an additional feature in the G4
environment.

Although the G4 GNUmakefile architecture
($G4INSTALL/config/architecture.gmk and binmake.gmk) are fairly
robust, there are times when it's conventient to compile, link, or
execute programs outside the toolkit's architecture.  It would be
convenient to have a command that would return the text of the
compiler flags and/or linker flags appropriate for a G4 compilation.

An example of this would be the "cernlib" command, which returns the
linker options for a supplied set of libraries.  For example, here's
the result of a sample command on my system:

# cernlib mathlib packlib kernlib
/usr/local/cern/2001/lib/libmathlib.a \
/usr/local/cern/2001/lib/libpacklib.a \
/usr/local/cern/2001/lib/libkernlib.a \
-lnsl -lcrypt -ldl

An even better example is the root-config command in the ROOT
distribution, which has different options for compiling or for
linking:

# root-config --cflags
-D_REENTRANT -I/usr/local/root-03.01.06/include

# root-config --libs
-L/usr/local/root-03.01.06/lib \
-lCore -lCint -lHist -lGraf -lGraf3d -lGpad \
-lTree -lRint -lPostscript -lMatrix -lPhysics \
-lm -ldl -lpthread -rdynamic

A "G4config" command might return the appropriate
installation-dependent options.  The results would depend on, e.g.,
whether the system was installed with shared libraries, or built with
a particular visualization option (since we at Nevis use different
options than those at CERN).

Such a command does not appear to be difficult to write.  If you don't
have the resources to spare right now, I offer to create it myself for
your review.
Comment 1 Hans-Peter.Wellisch 2001-08-07 11:01:59 CEST
Hi Gabriele,

   this is for you I guess. In general - Shall we try to apply something like
scram for configuration management? It would resolve these kinds of issues much
more deeply than a script.

Many greetings,

Hans-Peter.
Comment 2 Gabriele Cosmo 2001-08-13 07:17:59 CEST
I think this can be provided through a simple extension to the "Configure"
script. To be investigated.
Comment 3 Gabriele Cosmo 2002-02-08 01:23:59 CET
Serguei, can you please have a look at this one ?
As I said, it may be solved by simply extending "Configure" script
to report about an existing installation.
Comment 4 Serguei.Sadilov 2003-05-22 07:20:59 CEST
Currently it's done through "Configure" script with options:

  -ldlibs : retrieve the list of libraries to link
  -ldflags : retrieve the list of directories where libraries are placed
  -cxxflags : retrieve the list of cxxflags
  -cppflags : retrieve the list of cppflags
  -incflags : retrieve the list of incflags