Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F19250823
configure
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
configure
View Options
#! /bin/bash
#Package-specific:>
GENERATOR
=
EvtGen
#VERSION=11
# === Default values of input parameters ====
PATH_TO_EXTERNAL
=
CLHEP_VERSION
=
PYTHIADIR
=
${
PYTHIADIR
}
PHOTOSDIR
=
${
PHOTOSDIR
}
TAUOLADIR
=
${
TAUOLADIR
}
HEPMCDIR
=
${
HEPMCDIR
}
COMPMODE
=
OPT
# Default: compiler optimization mode
#<
#--------------------------------------------------------------
check_arguments
()
{
for
arg in
$*
;
do
if
[
"x
$arg
"
=
"x--enable-debug"
]
;
then
COMPMODE
=
DBG
elif
[
"x
$arg
"
=
"x--help"
]
;
then
echo
-e
\
"\nUsage: ./configure [options] , where options are:\n\n"
\
"--help : prints this help\n"
\
"--pythiadir=[full directory path] : specifies location of Pythia 8 base directory\n"
\
"--hepmcdir=[full directory path] : specifies location of HepMC base directory\n"
\
"--photosdir=[full directory path] : specifies location of PHOTOS base directory\n"
\
"--tauoladir=[full directory path] : specifies location of TAUOLA base directory\n"
\
"--enable-debug : turns on debugging flags\n"
exit
else
if
[
"x
${
arg
}
"
=
"x
${
arg
/=/
}
"
]
;
then
echo
"
${
arg
}
: wrong option. Ignored."
>
&
2
else
option
=
${
arg
/=*/
}
value
=
${
arg
/*=/
}
if
[
"x
${
option
}
"
=
"x--pythiadir"
]
;
then
PYTHIADIR
=
${
value
}
elif
[
"x
${
option
}
"
=
"x--hepmcdir"
]
;
then
HEPMCDIR
=
${
value
}
elif
[
"x
${
option
}
"
=
"x--photosdir"
]
;
then
PHOTOSDIR
=
${
value
}
elif
[
"x
${
option
}
"
=
"x--tauoladir"
]
;
then
TAUOLADIR
=
${
value
}
else
echo
"
${
arg
}
: wrong option. Ignored."
>
&
2
fi
fi
fi
done
return
}
#---------------------------------------
# Check that we can see (some of) the header files for the external generators.
# If not, print a warning message and ask the user to re-run configure
# specifying the base directory correct location(s).
check_dirs
()
{
pythiaFile
=
${
PYTHIADIR
}
/include/Pythia.h
hepmcFile
=
${
HEPMCDIR
}
/include/HepMC/GenParticle.h
photosFile
=
${
PHOTOSDIR
}
/include/Photos.h
tauolaFile
=
${
TAUOLADIR
}
/include/Tauola.h
stop
=
0
if
[
-f
$pythiaFile
]
;
then
echo
"PYTHIADIR set to
$PYTHIADIR
"
else
echo
"Please specify the location of the PYTHIA base directory"
\
"using the configure option --pythiadir=[full directory path]"
\
"or set the PYTHIADIR environment variable"
stop
=
1
fi
if
[
-f
$hepmcFile
]
;
then
echo
"HEPMCDIR set to
$HEPMCDIR
"
else
echo
"Please specify the location of the HepMC base directory"
\
"using the configure option --hepmcdir=[full directory path]"
\
"or set the HEPMCDIR environment variable"
stop
=
1
fi
if
[
-f
$photosFile
]
;
then
echo
"PHOTOSDIR set to
$PHOTOSDIR
"
else
echo
"Please specify the location of the PHOTOS base directory"
\
"using the configure option --photosdir=[full directory path]"
\
"or set the PHOTOSDIR environment variable"
stop
=
1
fi
if
[
-f
$tauolaFile
]
;
then
echo
"TAUOLADIR set to
$TAUOLADIR
"
else
echo
"Please specify the location of the TAUOLA base directory"
\
"using the configure option --tauoladir=[full directory path]"
\
"or set the TAUOLADIR environment variable"
stop
=
1
fi
if
[
$stop
=
1
]
;
then
exit
fi
}
#--------------------------------------------------------------
check_extlibs
()
{
# Set default shared libary lists for external packages
HEPMCLIBLIST
=
"-lHepMC"
PHOTOSLIBLIST
=
"-lPhotosCxxInterface"
TAUOLALIBLIST
=
"-lTauolaCxxInterface -lTauolaFortran"
PYTHIALIBLIST
=
"-lpythia8 -llhapdfdummy -lhepmcinterface"
# Check if the extra Photos fortran library is present.
# If so, add it to the list of external libraries.
# This is usually the case for CERN Genser libraries.
photosFortLib
=
${
PHOTOSDIR
}
/lib/libPhotosFortran.so
;
if
[
-f
$photosFortLib
]
;
then
PHOTOSLIBLIST
+=
" -lPhotosFortran"
fi
}
#-------------------------------------------------------------
check_arguments
$*
check_dirs
check_extlibs
echo
"Compilation mode is
${
COMPMODE
}
"
#Package-specific:>
#
# User-changeable part, experts -----------------------------
#
CXX
=
g++
CXXFLAGS_OPT
=
"-O2 -Wall"
CXXFLAGS_DBG
=
"-g -Wall"
CFLAGS_OPT
=
-O2
CFLAGS_DBG
=
-g
FC
=
gfortran
FFLAGS_OPT
=
"-O2 -Wuninitialized"
FFLAGS_DBG
=
-g
FFLAGSSHARED
=
-fPIC
CFLAGSSHARED
=
-fPIC
CXXFLAGSSHARED
=
-fPIC
LDFLAGSSHARED
=
"
${
CXXFLAGS_OPT
}
-pthread -fPIC"
#
# Find platform.
#
ARCH
=
`
uname
`
theGcc
=
`
g++ --version
|
grep
'[0-9]\.[0-9]\.[0-9]'
-o
|
head -1
|
awk -F .
'{print $1}'
`
if
[
${
theGcc
}
=
4
]
;
then
ARCH
=
${
ARCH
}
-gcc4
fi
echo
"Platform is
$ARCH
"
#default platform settings:
FFLAGS
=
"
${
FFLAGS_OPT
}
"
CFLAGS
=
"
${
CFLAGS_OPT
}
"
CXXFLAGS
=
"
${
CXXFLAGS_OPT
}
"
FLIBS
=
"-lfrtbegin -lg2c"
if
[
${
COMPMODE
}
=
OPT
]
;
then
FFLAGS
=
"
${
FFLAGS_OPT
}
"
CFLAGS
=
"
${
CFLAGS_OPT
}
"
CXXFLAGS
=
"
${
CXXFLAGS_OPT
}
"
fi
if
[
${
COMPMODE
}
=
DBG
]
;
then
FFLAGS
=
"
${
FFLAGS_DBG
}
"
CFLAGS
=
"
${
CFLAGS_DBG
}
"
CXXFLAGS
=
"
${
CXXFLAGS_DBG
}
"
fi
if
[
$ARCH
=
Linux
]
;
then
FFLAGS
=
"
${
FFLAGS_OPT
}
-Wno-globals"
CFLAGS
=
"
${
CFLAGS_OPT
}
"
CXXFLAGS
=
"
${
CXXFLAGS_OPT
}
"
FLIBS
=
"-lfrtbegin -lg2c"
if
[
${
COMPMODE
}
=
OPT
]
;
then
FFLAGS
=
"
${
FFLAGS_OPT
}
"
CFLAGS
=
"
${
CFLAGS_OPT
}
"
CXXFLAGS
=
"
${
CXXFLAGS_OPT
}
"
fi
if
[
${
COMPMODE
}
=
DBG
]
;
then
FFLAGS
=
"
${
FFLAGS_DBG
}
-Wno-globals"
CFLAGS
=
"
${
CFLAGS_DBG
}
"
CXXFLAGS
=
"
${
CXXFLAGS_DBG
}
"
fi
fi
# Linux platform with gcc4: new Fortran90 compiler.
if
[
$ARCH
=
Linux-gcc4
]
;
then
FFLAGS
=
"
${
FFLAGS_OPT
}
"
CFLAGS
=
"
${
CFLAGS_OPT
}
"
CXXFLAGS
=
"
${
CXXFLAGS_OPT
}
"
FLIBS
=
"-lgfortran -lgfortranbegin"
if
[
${
COMPMODE
}
=
OPT
]
;
then
FFLAGS
=
"
${
FFLAGS_OPT
}
"
CFLAGS
=
"
${
CFLAGS_OPT
}
"
CXXFLAGS
=
"
${
CXXFLAGS_OPT
}
"
fi
if
[
${
COMPMODE
}
=
DBG
]
;
then
FFLAGS
=
"
${
FFLAGS_DBG
}
"
CFLAGS
=
"
${
CFLAGS_DBG
}
"
CXXFLAGS
=
"
${
CXXFLAGS_DBG
}
"
fi
fi
#Platform & opt/dbg - independent flags and variables:
echo
-n
"Creating config.mk ... "
rm -f config.mk
cat > config.mk
<< EOT
GENERATOR = ${GENERATOR}
#VERSION = ${VERSION}
SHELL = /bin/bash
ARCH = ${ARCH}
LCGPLATFORM = ${LCGPLATFORM}
FC = ${FC}
FFLAGS = ${FFLAGS}
CFLAGS = ${CFLAGS}
CXX = ${CXX}
CXXFLAGS = ${CXXFLAGS}
EVTGENDIR = $(pwd)
TMPDIR = \$(EVTGENDIR)/tmp
INCLUDEDIR = \$(EVTGENDIR)
PYTHIADIR = ${PYTHIADIR}
PYTHIAINCDIR = ${PYTHIADIR}/include
PYTHIALIBDIR = ${PYTHIADIR}/lib/archive
PYTHIASHLIBDIR = ${PYTHIADIR}/lib
PYTHIALIBLIST = ${PYTHIALIBLIST}
HEPMCDIR = ${HEPMCDIR}
HEPMCINCDIR = ${HEPMCDIR}/include
HEPMCLIBDIR = ${HEPMCDIR}/lib
HEPMCSHLIBDIR = ${HEPMCDIR}/lib
HEPMCLIBLIST = ${HEPMCLIBLIST}
PHOTOSDIR = ${PHOTOSDIR}
PHOTOSINCDIR = ${PHOTOSDIR}/include
PHOTOSLIBDIR = ${PHOTOSDIR}/lib
PHOTOSSHLIBDIR = ${PHOTOSDIR}/lib
PHOTOSLIBLIST = ${PHOTOSLIBLIST}
TAUOLADIR = ${TAUOLADIR}
TAUOLAINCDIR = ${TAUOLADIR}/include
TAUOLALIBDIR = ${TAUOLADIR}/lib
TAUOLASHLIBDIR = ${TAUOLADIR}/lib
TAUOLALIBLIST = ${TAUOLALIBLIST}
SRCDIR = \$(EVTGENDIR)/src
LIBDIR_SHARED = \$(EVTGENDIR)/lib
LIBDIR_ARCHIVE = \$(EVTGENDIR)/lib/archive
LIB_SHARED = \$(LIBDIR_SHARED)/lib\$(GENERATOR).so
LIB_ARCHIVE = \$(LIBDIR_ARCHIVE)/lib\$(GENERATOR).a
# flags:
#
FFLAGSSHARED = ${FFLAGSSHARED}
CFLAGSSHARED = ${CFLAGSSHARED}
CXXFLAGSSHARED = ${CXXFLAGSSHARED}
LDFLAGSSHARED = ${LDFLAGSSHARED}
FLIBS = ${FLIBS}
#Package-specific:>
#<
EOT
echo
" done"
set
-v
mkdir -p tmp/ tmp/EvtGenBase tmp/EvtGenModels lib/ lib/archive/
set
+v
echo
-e
"\n\nType 'make' to build everything or 'make help' to list build targets.\n\n"
exit
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Tue, Sep 30, 5:44 AM (11 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6529410
Default Alt Text
configure (7 KB)
Attached To
Mode
rEVTGEN evtgen
Attached
Detach File
Event Timeline
Log In to Comment