#! /usr/bin/perl -w # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GENIE configuration script # # For help, type ./configure --help # # Costas Andreopoulos # University of Liverpool & STFC Rutherford Appleton Laboratory # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # print out info & exit if any of the command-line arguments was --help # if(($match = grep(/--help/i, @ARGV)) > 0) { print "\n"; print "*** GENIE configure script *** \n\n"; print "Usage: ./configure [option]... [flag=value]... \n\n"; print " FLAG DESCRIPTION DEFAULT\n\n"; print " --prefix Installation location (for 'make install') /usr/local/\n"; print "\n enable/disable options with either --enable- or --disable- (eg --enable-lhapdf5 --disable-flux-drivers)\n\n"; print " pythia8 Use the PYTHIA8 MC generator default: disabled \n"; print " incl Interface with INCL++ for nuclear transport default: disabled \n"; print " geant4 Interface with Geant4 for nuclear transport default: disabled \n"; print " lhapdf5 Use the LHAPDF5 parton density function library default: enabled \n"; print " lhapdf6 Use the LHAPDF6 parton density function library default: disabled \n"; print " apfel Use APFEL to compute NLO structure functions default: disabled \n"; print " flux-drivers Built-in flux drivers default: enabled \n"; print " geom-drivers Built-in detector geometry drivers default: enabled \n"; print " t2k T2K-specific event generation app default: disabled \n"; print " fnal FNAL-specific event generation app default: disabled \n"; print " atmo Atmospheric neutrino event generation app default: disabled \n"; print " nucleon-decay Nucleon decay simulation default: disabled \n"; print " nnbar-oscillation Simulation of nbar annihilation [n-nbar oscillation] default: disabled \n"; print " boosted-dark-matter Boosted dark matter simulation default: disabled \n"; print " neutral-heavy-lepton Neutral Heavy Lepton simulation default: disabled \n"; print " dark-neutrino Dark Neutrino simulation default: disabled \n"; print " event-library External event library based generation default: disabled \n"; print " incl Interface with INCL++ for nuclear transport default: disabled \n"; print " geant4 Interface with Geant4 for nuclear transport default: disabled \n"; print " masterclass Enable GENIE neutrino masterclass app default: disabled (Experimental) \n"; print " test Build test programs default: disabled \n"; print " debug Adds -g in the compiler options to request debug info default: disabled \n"; print " dylibversion Adds version number in library names (recommended) default: enabled \n"; print " lowlevel-mesg Disable (rather than filter) prolific low level messages default: disabled \n"; print " profiler GENIE code profiling using Google PerfTools default: disabled \n"; print " doxygen-doc Generate doxygen documentation at build time default: disabled \n"; print " gfortran Link against external libraries built with gfortran default: disabled \n"; print " g2c Link against external libraries built with g77 default: disabled \n"; print "\n options for 3rd party software, prefix with --with- (eg --with-lhapdf5-lib=/some/path/)\n\n"; print " compiler Compiler to use (any of clang,gcc) default: gcc \n"; print " optimiz-level Compiler optimization any of O,O2,O3,OO,Os / default: O2 \n"; print " profiler-lib Path to profiler library needed if you --enable-profiler \n"; print " doxygen-path Doxygen binary path needed if you --enable-doxygen-doc (if unset: checks for a \$DOXYGENPATH env.var.) \n"; print " pythia6-lib PYTHIA6 libraries path always needed (if unset: checks for a \$PYTHIA6 env.var., then tries to auto-detect it) \n"; print " pythia8-inc PYTHIA8 includes path needed if you --enable-pythia8 (if unset: checks for a \$PYTHIA8_INC env.var., then tries to auto-detect it) \n"; print " pythia8-lib PYTHIA8 libraries path needed if you --enable-pythia8 (if unset: checks for a \$PYTHIA8_LIB env.var.. then tries to auto-detect it) \n"; print " incl-inc INCL++ includes path needed if you --enable-incl (if unset: tries to auto-detect it) \n"; print " incl-lib INCL++ library path needed if you --enable-incl (if unset: tries to auto-detect it) \n"; print " geant4-inc Geant4 includes path needed if you --enable-geant4 (if unset: checks for a \$GEANT4_INC env.var.. then tries to auto-detect it) \n"; print " geant4-lib Geant4 library path needed if you --enable-geant4 (if unset: checks for a \$GEANT4_LIB env.var.. then tries to auto-detect it) \n"; print " lhapdf5-inc LHAPDF5 includes path needed if you --enable-lhapdf5 (if unset: checks for a \$LHAPDF5_INC env.var., then tries to auto-detect it) \n"; print " lhapdf5-lib LHAPDF5 libraries path needed if you --enable-lhapdf5 (if unset: checks for a \$LHAPDF5_LIB env.var.. then tries to auto-detect it) \n"; print " lhapdf6-inc LHAPDF6 includes path needed if you --enable-lhapdf6 (if unset: checks for a \$LHAPDF6_INC env.var., then tries to auto-detect it) \n"; print " lhapdf6-lib LHAPDF6 libraries path needed if you --enable-lhapdf6 (if unset: checks for a \$LHAPDF6_LIB env.var.. then tries to auto-detect it) \n"; print " apfel-inc APFEL includes path needed if you --enable-apfel (if unset: checks for a \$APFEL_INC env.var., then tries to auto-detect it) \n"; print " apfel-lib APFEL libraries path needed if you --enable-apfel (if unset: checks for a \$APFEL_LIB env.var.. then tries to auto-detect it) \n"; print " libxml2-inc libxml2 includes path always needed (if unset: tries to auto-detect it) \n"; print " libxml2-lib libxml2 libraries path always needed (if unset: tries to auto-detect it) \n"; print " log4cpp-inc log4cpp includes path always needed (if unset: tries to auto-detect it) \n"; print " log4cpp-lib log4cpp libraries path always needed (if unset: tries to auto-detect it) \n"; print " boost-inc boost includes path needed if you --enable-incl (if unset: tries to auto-detect it) \n"; print " boost-lib boost library path needed if you --enable-incl (if unset: tries to auto-detect it) \n"; print " gfortran-lib libgfortran library path needed if you --enable-gfortran (if unset: tries to auto-detect it) \n"; print " g2c-lib libg2c library path needed if you --enable-g2c (if unset: tries to auto-detect it) \n\n"; print "If the printout was too long then pipe it through a pager, eg: \n"; print "./configure --help | more \n"; exit 0; } # Check that $GENIE is set # $GENIE = $ENV{'GENIE'}; die ("*** Error *** The GENIE environmental variable (pointing to the top level GENIE directory) is not defined") unless defined $GENIE; # Print GENIE banner # $BANNER_FILE = "$GENIE/data/logo/genie_banner_short.txt"; if(-e $BANNER_FILE) { open(BANNER, "<$BANNER_FILE"); @hdr=; print @hdr; close(BANNER); } # Check that $ROOTSYS is set # $ROOTSYS = $ENV{'ROOTSYS'}; die ("*** Error *** The ROOTSYS environmental variable is not defined. Is ROOT installed?") unless defined $ROOTSYS; # Check whether ROOT itself was build with GSL enabled # (GENIE uses GSL via ROOT's MathMore library.) # { $mathmore_lib = "$ROOTSYS/lib/libMathMore.so"; if( ! -f $mathmore_lib ) { die ("*** Error *** ROOT needs to be built with GSL/MathMore enabled."); } } # Enable auto-detection? # system("find $GENIE/configure"); print "\n"; $auto_detect = ($?==0) ? 1 : 0; if(! $auto_detect) { print "\n*** Warning *** Path auto-detection is turned off. You need the 'find' utility to use that feature\n\n"; } # Open Make.config to write configuration options # $MKCONF_FILE = "$GENIE/src/make/Make.config"; open(MKCONF, ">$MKCONF_FILE") or die("Can not write out the Make.config file!"); print MKCONF "# \n"; print MKCONF "# Make.config \n"; print MKCONF "# This file was automatically generated by the 'configure' script \n"; print MKCONF "# and is included into the project Makefiles \n"; print MKCONF "# \n"; # Create a string by joining all the command line arguments # my $options = join(" ", @ARGV); # Get & save installation location (--prefix) or set default # my $prefix="/usr/local/"; if(($match = grep(/--prefix/i, @ARGV)) > 0) { $options=~m/--prefix=(\S*)/i; $prefix = $1; if( $GENIE eq $prefix ) { print "*** Error *** --prefix can not point to the GENIE top level directory!\n\n"; exit 1; } } print MKCONF "GENIE_INSTALLATION_PATH=$prefix\n"; # Default --enable/--disable config options (for a minimal genie build) # my $gopt_enable_pythia8 = "NO"; my $gopt_enable_lhapdf5 = "YES"; my $gopt_enable_lhapdf6 = "NO"; my $gopt_enable_apfel = "NO"; my $gopt_enable_flux_drivers = "YES"; my $gopt_enable_geom_drivers = "YES"; my $gopt_enable_t2k = "NO"; my $gopt_enable_fnal = "NO"; my $gopt_enable_atmo = "NO"; my $gopt_enable_nucleon_decay = "NO"; my $gopt_enable_nnbar_oscillation = "NO"; my $gopt_enable_boosted_dark_mat = "NO"; my $gopt_enable_neutral_heavy_lepton = "NO"; my $gopt_enable_dark_neutrino = "NO"; my $gopt_enable_evtlib = "NO"; my $gopt_enable_incl = "NO"; my $gopt_enable_geant4_interface = "NO"; my $gopt_enable_masterclass = "NO"; my $gopt_enable_test = "NO"; my $gopt_enable_debug = "NO"; my $gopt_enable_dylibversion = "YES"; my $gopt_enable_lowlevel_mesg = "NO"; my $gopt_enable_profiler = "NO"; my $gopt_enable_doxygen_doc = "NO"; my $gopt_enable_gfortran = "NO"; my $gopt_enable_g2c = "NO"; # Check configure's command line arguments for non-default values # if(($match = grep(/--enable-pythia8/i, @ARGV)) > 0) { $gopt_enable_pythia8 = "YES"; } if(($match = grep(/--enable-lhapdf5/i, @ARGV)) > 0) { $gopt_enable_lhapdf5 = "YES"; } if(($match = grep(/--disable-lhapdf5/i, @ARGV)) > 0) { $gopt_enable_lhapdf5 = "NO"; } if(($match = grep(/--enable-lhapdf6/i, @ARGV)) > 0) { $gopt_enable_lhapdf6 = "YES"; } if(($match = grep(/--disable-lhapdf6/i, @ARGV)) > 0) { $gopt_enable_lhapdf6 = "NO"; } if(($match = grep(/--enable-apfel/i, @ARGV)) > 0) { $gopt_enable_apfel = "YES"; } if(($match = grep(/--disable-apfel/i, @ARGV)) > 0) { $gopt_enable_apfel = "NO"; } if(($match = grep(/--disable-flux-drivers/i, @ARGV)) > 0) { $gopt_enable_flux_drivers = "NO"; } if(($match = grep(/--disable-geom-drivers/i, @ARGV)) > 0) { $gopt_enable_geom_drivers = "NO"; } if(($match = grep(/--enable-t2k/i, @ARGV)) > 0) { $gopt_enable_t2k = "YES"; } if(($match = grep(/--enable-fnal/i, @ARGV)) > 0) { $gopt_enable_fnal = "YES"; } if(($match = grep(/--enable-atmo/i, @ARGV)) > 0) { $gopt_enable_atmo = "YES"; } if(($match = grep(/--enable-nucleon-decay/i, @ARGV)) > 0) { $gopt_enable_nucleon_decay = "YES"; } if(($match = grep(/--enable-nnbar-oscillation/i, @ARGV)) > 0) { $gopt_enable_nnbar_oscillation = "YES"; } if(($match = grep(/--enable-boosted-dark-matter/i, @ARGV)) > 0) { $gopt_enable_boosted_dark_mat = "YES"; } if(($match = grep(/--enable-neutral-heavy-lepton/i, @ARGV)) > 0) { $gopt_enable_neutral_heavy_lepton = "YES"; } if(($match = grep(/--enable-dark-neutrino/i, @ARGV)) > 0) { $gopt_enable_dark_neutrino = "YES"; } if(($match = grep(/--enable-event-library/i, @ARGV)) > 0) { $gopt_enable_evtlib = "YES"; } if(($match = grep(/--enable-incl/i, @ARGV)) > 0) { $gopt_enable_incl = "YES"; } if(($match = grep(/--enable-geant4/i, @ARGV)) > 0) { $gopt_enable_geant4_interface = "YES"; } if(($match = grep(/--enable-masterclass/i, @ARGV)) > 0) { $gopt_enable_masterclass = "YES"; } if(($match = grep(/--enable-test/i, @ARGV)) > 0) { $gopt_enable_test = "YES"; } if(($match = grep(/--enable-debug/i, @ARGV)) > 0) { $gopt_enable_debug = "YES"; } if(($match = grep(/--disable-dylibversion/i, @ARGV)) > 0) { $gopt_enable_dylibversion = "NO"; } if(($match = grep(/--enable-lowlevel-mesg/i, @ARGV)) > 0) { $gopt_enable_lowlevel_mesg = "YES"; } if(($match = grep(/--enable-profiler/i, @ARGV)) > 0) { $gopt_enable_profiler = "YES"; } if(($match = grep(/--enable-doxygen-doc/i, @ARGV)) > 0) { $gopt_enable_doxygen_doc = "YES"; } if(($match = grep(/--enable-gfortran/i, @ARGV)) > 0) { $gopt_enable_gfortran = "YES"; } if(($match = grep(/--enable-g2c/i, @ARGV)) > 0) { $gopt_enable_g2c = "YES"; } # LHAPDF6 and LHAPDF5 are mutually exlusive if ($gopt_enable_lhapdf6 eq "YES" && $gopt_enable_lhapdf5 eq "YES") { print "*** Warning *** LHAPDF6 and LHAPDF5 are mutually exclusive - Disabling LHAPDF5\n\n"; $gopt_enable_lhapdf5 = "NO"; } # libgfortran and libg2c are mutually exlusive if ($gopt_enable_gfortran eq "YES" && $gopt_enable_g2c eq "YES") { print "*** Warning *** libgfortran and libg2c are mutually exclusive - Disabling libg2c\n\n"; $gopt_enable_g2c = "NO"; } # If built-in flux and/or geometry drivers are disabled, then disable t2k, fnal, atmo if($gopt_enable_flux_drivers eq "NO" || $gopt_enable_geom_drivers eq "NO") { if($gopt_enable_t2k eq "YES" || $gopt_enable_fnal eq "YES" || $gopt_enable_atmo eq "YES") { print "*** Warning *** Can't enable experiment-specific apps without flux and geometry drivers\n\n"; } $gopt_enable_t2k = "NO"; $gopt_enable_fnal = "NO"; $gopt_enable_atmo = "NO"; } # Set debug flag my $gopt_with_cxx_debug_flag=""; if($gopt_enable_debug eq "YES") { $gopt_with_cxx_debug_flag = "-g"; } # Check compiler # my $gopt_with_compiler="gcc"; # default if( $options=~m/--with-compiler=(\S*)/i ) { $gopt_with_compiler = $1; } # Check compiler optimization level # my $gopt_with_cxx_optimiz_flag="O2"; # default if( $options=~m/--with-optimiz-level=(\S*)/i ) { $gopt_with_cxx_optimiz_flag = $1; } # If --enable-profiler was set then the full path to the profiler library must be specified # my $gopt_with_profiler_lib = ""; if($gopt_enable_profiler eq "YES") { if(($match = grep(/--with-profiler-lib/i, @ARGV)) > 0) { $options=~m/--with-profiler-lib=(\S*)/i; $gopt_with_profiler_lib = $1; } } # If --enable-doxygen-doc was set then the full path to the doxygen binary path must be specified # unless it is in the $PATH # my $gopt_with_doxygen_path = ""; if($gopt_enable_doxygen_doc eq "YES") { if(($match = grep(/--with-doxygen-path/i, @ARGV)) > 0) { $options=~m/--with-doxygen-path=(\S*)/i; $gopt_with_doxygen_path = $1; } # if it was not set, try to pick it up from the environment if(! -d $gopt_with_doxygen_path && defined $ENV{'DOXYGENPATH'}) { $gopt_with_doxygen_path = $ENV{'DOXYGENPATH'}; } # complain if(! -d $gopt_with_doxygen_path) { print "*** Error *** You need to specify the path to doxygen using --with-doxygen-path=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-doxygen-doc\n\n"; exit 1; } } # ------------------------------------------------ # PYTHIA6 paths # ------------------------------------------------ # Get pythia6 library path # my $gopt_with_pythia6_lib = ""; if($options=~m/--with-pythia6=\S*/i) { print "*** Error *** Note that the option --with-pythia6 has been renamed to --with-pythia6-lib \n"; print "*** Error *** Please see './configure --help' for all config option updates \n\n"; exit 1; } if($options=~m/--with-pythia6-lib=(\S*)/i) { $gopt_with_pythia6_lib = $1; } else { print "\n*** Warning *** You didn't specify the PYTHIA6 path \n"; } # if it was not set, try to pick it up from the environment if(! -d $gopt_with_pythia6_lib && defined $ENV{'PYTHIA6'}) { $gopt_with_pythia6_lib = $ENV{'PYTHIA6'}; print "The \$PYTHIA6 env var is defined. I will pick that and set --with-pythia6-lib=$gopt_with_pythia6_lib\n"; } # if it still not set, try autodetecting it if(! -d $gopt_with_pythia6_lib && $auto_detect) { print "Auto-detecting the PYTHIA6 path...\n"; $matched = auto_detect("libPythia6*"); if( $matched=~m/(\S*)\/libPythia6\S*/i ) { $gopt_with_pythia6_lib = $1; } print "Setting --with-pythia6-lib=$gopt_with_pythia6_lib\n"; } if(! -d $gopt_with_pythia6_lib) { print "*** Error *** Could not locate the PYTHIA6 library path. Please specify it using --with-pythia6=/some/path/\n\n"; exit 1; } # ------------------------------------------------ # PYTHIA8 paths # ------------------------------------------------ # If --enable-pythia8 was set then the full path to the PYTHIA8 library must be specified # my $gopt_with_pythia8_lib = ""; if($gopt_enable_pythia8 eq "YES") { if(($match = grep(/--with-pythia8-lib/i, @ARGV)) > 0) { $options=~m/--with-pythia8-lib=(\S*)/i; $gopt_with_pythia8_lib = $1; } if(! -d $gopt_with_pythia8_lib) { print "\n*** Warning *** PYTHIA8 has been enabled but you didn't specify the PYTHIA8 library path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_pythia8_lib eq "" && defined $ENV{'PYTHIA8_LIB'}) { $gopt_with_pythia8_lib = $ENV{'PYTHIA8_LIB'}; print "The \$PYTHIA8_LIB env var is defined. I will pick that and use --with-pythia8-lib=$gopt_with_pythia8_lib\n"; } # if it still not set, try autodetecting it if(! -d $gopt_with_pythia8_lib && $auto_detect) { print "Auto-detecting PYTHIA8 library path...\n"; $matched = auto_detect("libpythia8.so"); if( $matched=~m/(\S*)\/libpythia8.so/i ) { print " -- MATCH = \n"; $gopt_with_pythia8_lib = $1; } else { if( $matched=~m/(\S*)\/libpythia8.dylib/i ) { print " -- MATCH = \n"; $gopt_with_pythia8_lib = $1; } } print "Setting --with-pythia8-lib=$gopt_with_pythia8_lib\n"; } # check my $fileso = "$gopt_with_pythia8_lib/libpythia8.so"; my $filedylib = "$gopt_with_pythia8_lib/libpythia8.dylib"; if(! -e $fileso && ! -e $filedylib) { print "*** Error *** You need to specify the path to PYTHIA8 library using --with-pythia8-lib=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-pythia8\n\n"; exit 1; } } # If --enable-pythia8 was set then the full path to the PYTHIA8 includes must be specified # my $gopt_with_pythia8_inc = ""; if($gopt_enable_pythia8 eq "YES") { if(($match = grep(/--with-pythia8-inc/i, @ARGV)) > 0) { $options=~m/--with-pythia8-inc=(\S*)/i; $gopt_with_pythia8_inc = $1; } if(! -d $gopt_with_pythia8_inc) { print "\n*** Warning *** PYTHIA8 has been enabled but you didn't specify the PYTHIA8 include path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_pythia8_inc eq "" && defined $ENV{'PYTHIA8_INC'}) { $gopt_with_pythia8_inc = $ENV{'PYTHIA8_INC'}; print "The \$PHTHIA8_INC env var is defined. I will pick that and use --with-pythia8-inc=$gopt_with_pythia8_inc\n"; } # if it still not set, try autodetecting it if(! -d $gopt_with_pythia8_inc && $auto_detect) { print "Auto-detecting the PYTHIA8 include path...\n"; $matched = auto_detect("Pythia.h","Pythia8/Pythia.h"); print "$gopt_with_pythia8_inc \n"; if( $matched=~m/(\S*)\/Pythia8\/Pythia.h/i ) { $gopt_with_pythia8_inc = $1; } print "Setting --with-pythia8-inc=$gopt_with_pythia8_inc\n"; } # check my $file = "$gopt_with_pythia8_inc/Pythia8/Pythia.h"; if(! -e $file) { print "*** Error *** You need to specify the PYTHIA8 includes path using --with-pythia8-inc=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-pythia8\n\n"; exit 1; } } # ------------------------------------------------ # LHAPDF5 paths # ------------------------------------------------ # If --enable-lhapdf5 was set then the full path to the LHAPDF5 library must be specified # my $gopt_with_lhapdf5_lib = ""; if($gopt_enable_lhapdf5 eq "YES") { if(($match = grep(/--with-lhapdf5-lib/i, @ARGV)) > 0) { $options=~m/--with-lhapdf5-lib=(\S*)/i; $gopt_with_lhapdf5_lib = $1; } if(! -d $gopt_with_lhapdf5_lib) { print "\n*** Warning *** LHAPDF5 has been enabled but you didn't specify the LHAPDF5 library path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_lhapdf5_lib eq "" && defined $ENV{'LHAPDF5_LIB'}) { $gopt_with_lhapdf5_lib = $ENV{'LHAPDF5_LIB'}; print "The \$LHAPDF5_LIB env var is defined. I will pick that and use --with-lhapdf5-lib=$gopt_with_lhapdf5_lib\n"; } # if it still not set, try autodetecting it if(! -d $gopt_with_lhapdf5_lib && $auto_detect) { print "Auto-detecting LHAPDF5 library path...\n"; $matched = auto_detect("libLHAPDF.a"); if( $matched=~m/(\S*)\/libLHAPDF.a/i ) { $gopt_with_lhapdf5_lib = $1; } print "Setting --with-lhapdf5-lib=$gopt_with_lhapdf5_lib\n"; } # check my $fileso = "$gopt_with_lhapdf5_lib/libLHAPDF.so"; my $filedylib = "$gopt_with_lhapdf5_lib/libLHAPDF.dylib"; if(! -e $fileso && ! -e $filedylib) { print "*** Error *** You need to specify the path to LHAPDF5 library using --with-lhapdf5-lib=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-lhapdf5\n\n"; exit 1; } } # If --enable-lhapdf5 was set then the full path to the LHAPDF5 includes must be specified # my $gopt_with_lhapdf5_inc = ""; if($gopt_enable_lhapdf5 eq "YES") { if(($match = grep(/--with-lhapdf5-inc/i, @ARGV)) > 0) { $options=~m/--with-lhapdf5-inc=(\S*)/i; $gopt_with_lhapdf5_inc = $1; } if(! -d $gopt_with_lhapdf5_inc) { print "\n*** Warning *** LHAPDF5 has been enabled but you didn't specify the LHAPDF5 include path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_lhapdf5_inc eq "" && defined $ENV{'LHAPDF5_INC'}) { $gopt_with_lhapdf5_inc = $ENV{'LHAPDF5_INC'}; print "The \$LHAPDF5_INC env var is defined. I will pick that and use --with-lhapdf5-inc=$gopt_with_lhapdf5_inc\n"; } # if it still not set, try autodetecting it if(! -d $gopt_with_lhapdf5_inc && $auto_detect) { print "Auto-detecting the LHAPDF5 include path...\n"; $matched = auto_detect("LHAPDF.h","LHAPDF/LHAPDF.h"); print "$gopt_with_lhapdf5_inc \n"; if( $matched=~m/(\S*)\/LHAPDF\/LHAPDF.h/i ) { $gopt_with_lhapdf5_inc = $1; } print "Setting --with-lhapdf5-inc=$gopt_with_lhapdf5_inc\n"; } # check my $file = "$gopt_with_lhapdf5_inc/LHAPDF/LHAPDF.h"; if(! -e $file) { print "*** Error *** You need to specify the LHAPDF5 includes path using --with-lhapdf5-inc=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-lhapdf5\n\n"; exit 1; } } # ------------------------------------------------ # LHAPDF6 paths # ------------------------------------------------ # If --enable-lhapdf6 was set then the full path to the LHAPDF6 library must be specified # my $gopt_with_lhapdf6_lib = ""; if($gopt_enable_lhapdf6 eq "YES") { if(($match = grep(/--with-lhapdf6-lib/i, @ARGV)) > 0) { $options=~m/--with-lhapdf6-lib=(\S*)/i; $gopt_with_lhapdf6_lib = $1; } if(! -d $gopt_with_lhapdf6_lib) { print "\n*** Warning *** LHAPDF6 has been enabled but you didn't specify the LHAPDF6 library path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_lhapdf6_lib eq "" && defined $ENV{'LHAPDF6_LIB'}) { $gopt_with_lhapdf6_lib = $ENV{'LHAPDF6_LIB'}; print "The \$LHAPDF6_LIB env var is defined. I will pick that and use --with-lhapdf6-lib=$gopt_with_lhapdf6_lib\n"; } # if it still not set, try autodetecting it if(! -d $gopt_with_lhapdf6_lib && $auto_detect) { print "Auto-detecting LHAPDF6 library path...\n"; $matched = auto_detect("libLHAPDF.a"); if( $matched=~m/(\S*)\/libLHAPDF.a/i ) { $gopt_with_lhapdf6_lib = $1; } print "Setting --with-lhapdf6-inc=$gopt_with_lhapdf6_lib\n"; } # check my $fileso = "$gopt_with_lhapdf6_lib/libLHAPDF.so"; my $filedylib = "$gopt_with_lhapdf6_lib/libLHAPDF.dylib"; if(! -e $fileso && ! -e $filedylib) { print "*** Error *** You need to specify the path to LHAPDF6 library using --with-lhapdf6-lib=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-lhapdf6\n\n"; exit 1; } } # If --enable-lhapdf6 was set then the full path to the LHAPDF6 includes must be specified # my $gopt_with_lhapdf6_inc = ""; if($gopt_enable_lhapdf6 eq "YES") { if(($match = grep(/--with-lhapdf6-inc/i, @ARGV)) > 0) { $options=~m/--with-lhapdf6-inc=(\S*)/i; $gopt_with_lhapdf6_inc = $1; } if(! -d $gopt_with_lhapdf6_inc) { print "\n*** Warning *** LHAPDF6 has been enabled but you didn't specify the LHAPDF6 include path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_lhapdf6_inc eq "" && defined $ENV{'LHAPDF6_INC'}) { $gopt_with_lhapdf6_inc = $ENV{'LHAPDF6_INC'}; print "The \$LHAPDF6_INC env var is defined. I will pick that and use --with-lhapdf6-inc=$gopt_with_lhapdf6_inc\n"; } # if it still not set, try autodetecting it if(! -d $gopt_with_lhapdf6_inc && $auto_detect) { print "Auto-detecting the LHAPDF6 include path...\n"; $matched = auto_detect("LHAPDF.h","LHAPDF/LHAPDF.h"); print "$gopt_with_lhapdf6_inc \n"; if( $matched=~m/(\S*)\/LHAPDF\/LHAPDF.h/i ) { $gopt_with_lhapdf6_inc = $1; } print "Setting --with-lhapdf6-inc=$gopt_with_lhapdf6_inc\n"; } # check my $file = "$gopt_with_lhapdf6_inc/LHAPDF/LHAPDF.h"; if(! -e $file) { print "*** Error *** You need to specify the LHAPDF6 includes path using --with-lhapdf6-inc=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-lhapdf6\n\n"; exit 1; } } # ------------------------------------------------ # APFEL paths # ------------------------------------------------ # If --enable-apfel was set then the full path to the APFEL library must be specified # my $gopt_with_apfel_lib = ""; if($gopt_enable_apfel eq "YES") { if(($match = grep(/--with-apfel-lib/i, @ARGV)) > 0) { $options=~m/--with-apfel-lib=(\S*)/i; $gopt_with_apfel_lib = $1; } if(! -d $gopt_with_apfel_lib) { print "\n*** Warning *** APFEL has been enabled but you didn't specify the APFEL library path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_apfel_lib eq "" && defined $ENV{'APFEL_LIB'}) { $gopt_with_apfel_lib = $ENV{'APFEL_LIB'}; print "The \$APFEL_LIB env var is defined. I will pick that and use --with-apfel-lib=$gopt_with_apfel_lib\n"; } # if it still not set, try autodetecting it if(! -d $gopt_with_apfel_lib && $auto_detect) { print "Auto-detecting APFEL library path...\n"; $matched = auto_detect("libAPFEL.la"); if( $matched=~m/(\S*)\/libAPFEL.la/i ) { $gopt_with_apfel_lib = $1; } print "Setting --with-apfel-lib=$gopt_with_apfel_lib\n"; } # check my $file = "$gopt_with_apfel_lib/libAPFEL.la"; if(! -e $file) { print "*** Error *** You need to specify the path to APFEL library using --with-apfel-lib=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-apfel\n\n"; exit 1; } } # If --enable-apfel was set then the full path to the APFEL includes must be specified # my $gopt_with_apfel_inc = ""; if($gopt_enable_apfel eq "YES") { if(($match = grep(/--with-apfel-inc/i, @ARGV)) > 0) { $options=~m/--with-apfel-inc=(\S*)/i; $gopt_with_apfel_inc = $1; } if(! -d $gopt_with_apfel_inc) { print "\n*** Warning *** APFEL has been enabled but you didn't specify the APFEL include path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_apfel_inc eq "" && defined $ENV{'APFEL_INC'}) { $gopt_with_apfel_inc = $ENV{'APFEL_INC'}; print "The \$APFEL_INC env var is defined. I will pick that and use --with-apfel-inc=$gopt_with_apfel_inc\n"; } # if it still not set, try autodetecting it if(! -d $gopt_with_apfel_inc && $auto_detect) { print "Auto-detecting the APFEL include path...\n"; $matched = auto_detect("APFEL.h","APFEL/APFEL.h"); if( $matched=~m/(\S*)\/APFEL\/APFEL.h/i ) { $gopt_with_apfel_inc = $1; } print "Setting --with-apfel-inc=$gopt_with_apfel_inc\n"; } # check my $file = "$gopt_with_apfel_inc/APFEL/APFEL.h"; if(! -e $file) { print "*** Error *** You need to specify the APFEL includes path using --with-apfel-inc=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-apfel\n\n"; exit 1; } } # ------------------------------------------------ # LIBXML2 paths # ------------------------------------------------ my $gopt_with_libxml2_inc = ""; my $gopt_with_libxml2_lib = ""; # # --with-libxml2-inc= # if($options=~m/--with-libxml2-inc=(\S*)/i) { $gopt_with_libxml2_inc = $1; } if(! -d $gopt_with_libxml2_inc && $auto_detect) { print "\n*** Warning *** You didn't specify the libxml2 include path \n"; print "Auto-detecting...\n"; $matched = auto_detect("xmlmemory.h"); if( $matched=~m/(\S*)\/libxml\/xmlmemory.h/i ) { $gopt_with_libxml2_inc = $1; } print "Setting --with-libxml2-inc=$gopt_with_libxml2_inc\n"; } if(! -d $gopt_with_libxml2_inc) { print "*** Error *** You need to specify the libxml2 include path using --with-libxml2-inc=/some/path/\n\n"; exit 1; } # # --with-libxml2-lib= # if($options=~m/--with-libxml2-lib=(\S*)/i) { $gopt_with_libxml2_lib = $1; } if(! -d $gopt_with_libxml2_lib && $auto_detect) { print "\n*** Warning *** You didn't specify the libxml2 library path \n"; print "Auto-detecting...\n"; $matched = auto_detect("libxml2.*"); if( $matched=~m/(\S*)\/libxml2\S*/i ) { $gopt_with_libxml2_lib = $1; } print "Setting --with-libxml2-lib=$gopt_with_libxml2_lib\n"; } if(! -d $gopt_with_libxml2_lib) { print "*** Error *** You need to specify the libxml2 library path using --with-libxml2-lib=/some/path/\n\n"; exit 1; } # ------------------------------------------------ # LOG4CPP paths # ------------------------------------------------ my $gopt_with_log4cpp_inc = ""; my $gopt_with_log4cpp_lib = ""; # # --with-log4cpp-inc= # if($options=~m/--with-log4cpp-inc=(\S*)/i) { $gopt_with_log4cpp_inc = $1; } if(! -d $gopt_with_log4cpp_inc && $auto_detect) { print "\n*** Warning *** You didn't specify the log4cpp include path \n"; print "Auto-detecting...\n"; $matched = auto_detect("OstreamAppender.hh"); if( $matched=~m/(\S*)\/log4cpp\/OstreamAppender.hh/i ) { $gopt_with_log4cpp_inc = $1; } print "Setting --with-log4cpp-inc=$gopt_with_log4cpp_inc\n"; } if(! -d $gopt_with_log4cpp_inc) { print "*** Error *** You need to specify the log4cpp include path using --with-log4cpp-inc=/some/path/\n\n"; exit 1; } # # --with-log4cpp-lib= # if($options=~m/--with-log4cpp-lib=(\S*)/i) { $gopt_with_log4cpp_lib = $1; } if(! -d $gopt_with_log4cpp_lib && $auto_detect) { print "\n*** Warning *** You didn't specify the log4cpp library path \n"; print "Auto-detecting...\n"; $matched = auto_detect("liblog4cpp.*"); if( $matched=~m/(\S*)\/liblog4cpp\S*/i ) { $gopt_with_log4cpp_lib = $1; } print "Setting --with-log4cpp-lib=$gopt_with_log4cpp_lib\n"; } if(! -d $gopt_with_log4cpp_lib) { print "*** Error *** You need to specify the log4cpp library path using --with-log4cpp-lib=/some/path/\n\n"; exit 1; } # ------------------------------------------------ # INCL path # ------------------------------------------------ # If --enable-incl was set then the full path to the INCL library must be specified my $gopt_with_incl_lib = ""; if($gopt_enable_incl eq "YES") { if(($match = grep(/--with-incl-lib/i, @ARGV)) > 0) { $options=~m/--with-incl-lib=(\S*)/i; $gopt_with_incl_lib = $1; } if(! -d $gopt_with_incl_lib) { print "\n*** Warning *** INCL has been enabled but you didn't specify the INCL library path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_incl_lib eq "" && defined $ENV{'INCL_LIB'}) { $gopt_with_incl_lib = $ENV{'INCL_LIB'}; print "The \$INCL_LIB env var is defined. I will pick that and use --with-incl-lib=$gopt_with_incl_lib\n"; } # check my $fileso = "$gopt_with_incl_lib/libINCL_Physics.so"; my $filea = "$gopt_with_incl_lib/libINCL_Physics.a"; if(! -e $fileso && ! -e $filea) { print "*** Error *** You need to specify the path to libINCL_Physics using --with-incl-lib=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-incl\n\n"; exit 1; } } # If --enable-incl was set then the full path to the INCL includes must be specified my $gopt_with_incl_inc = ""; if($gopt_enable_incl eq "YES") { if(($match = grep(/--with-incl-inc/i, @ARGV)) > 0) { $options=~m/--with-incl-inc=(\S*)/i; $gopt_with_incl_inc = $1; } if(! -d $gopt_with_incl_inc) { print "\n*** Warning *** INCL has been enabled but you didn't specify the INCL includes path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_incl_inc eq "" && defined $ENV{'INCL_INC'}) { $gopt_with_incl_inc = $ENV{'INCL_INC'}; print "The \$INCL_INC env var is defined. I will pick that and use --with-incl-inc=$gopt_with_incl_inc\n"; } # check my $file = "$gopt_with_incl_inc/G4INCLCascade.hh"; if(! -e $file) { print "*** Error *** You need to specify the path to G4INCLCascade.hh using --with-incl-inc=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-incl\n\n"; exit 1; } } # ------------------------------------------------ # boost path # ------------------------------------------------ # If --enable-incl was set then the full path to the boost library must also be specified my $gopt_with_boost_lib = ""; if($gopt_enable_incl eq "YES") { if(($match = grep(/--with-boost-lib/i, @ARGV)) > 0) { $options=~m/--with-boost-lib=(\S*)/i; $gopt_with_boost_lib = $1; } if(! -d $gopt_with_boost_lib) { print "\n*** Warning *** INCL has been enabled but you didn't specify the boost library path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_boost_lib eq "" && defined $ENV{'BOOST_LIB'}) { $gopt_with_boost_lib = $ENV{'BOOST_LIB'}; print "The \$BOOST_LIB env var is defined. I will pick that and use --with-boost-lib=$gopt_with_boost_lib\n"; } # check my $fileso = "$gopt_with_boost_lib/libboost_program_options.so"; my $filea = "$gopt_with_boost_lib/libboost_program_options.a"; if(! -e $fileso && ! -e $filea) { print "*** Error *** You need to specify the path to libboost_program_options.so using --with-boost-lib=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-incl\n\n"; exit 1; } } # If --enable-incl was set then the full path to the boost includes must also be specified my $gopt_with_boost_inc = ""; if($gopt_enable_incl eq "YES") { if(($match = grep(/--with-boost-inc/i, @ARGV)) > 0) { $options=~m/--with-boost-inc=(\S*)/i; $gopt_with_boost_inc = $1; } if(! -d $gopt_with_boost_inc) { print "\n*** Warning *** INCL has been enabled but you didn't specify the boost includes path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_boost_inc eq "" && defined $ENV{'BOOST_INC'}) { $gopt_with_boost_inc = $ENV{'BOOST_INC'}; print "The \$BOOST_INC env var is defined. I will pick that and use --with-boost-inc=$gopt_with_boost_inc\n"; } # check my $file = "$gopt_with_boost_inc/boost/program_options.hpp"; if(! -e $file) { print "*** Error *** You need to specify the path to boost/program_options.hpp using --with-boost-inc=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-incl\n\n"; exit 1; } } # ------------------------------------------------ # geant4 path # ------------------------------------------------ # If --enable-geant4 was set then the full path to the Geant4 libraries must be specified # my $gopt_with_geant4_lib = ""; if($gopt_enable_geant4_interface eq "YES") { if(($match = grep(/--with-geant4-lib/i, @ARGV)) > 0) { $options=~m/--with-geant4-lib=(\S*)/i; $gopt_with_geant4_lib = $1; } if(! -d $gopt_with_geant4_lib) { print "\n*** Warning *** Geant4 has been enabled but you didn't specify the Geant4 library path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_geant4_lib eq "" && defined $ENV{'GEANT4_LIB'}) { $gopt_with_geant4_lib = $ENV{'GEANT4_LIB'}; print "The \$GEANT4_LIB env var is defined. I will pick that and use --with-geant4-lib=$gopt_with_geant4_lib\n"; } # if it still not set, try autodetecting it if(! -d $gopt_with_geant4_lib && $auto_detect) { print "Auto-detecting GEANT4 library path...\n"; $matched = auto_detect("libG4processes.so"); if( $matched=~m/(\S*)\/libG4processes.so/i ) { $gopt_with_geant4_lib = $1; } print "Setting --with-geant4-lib=$gopt_with_geant4_lib\n"; } # check my $fileso = "$gopt_with_geant4_lib/libG4processes.so"; my $filedylib = "$gopt_with_geant4_lib/libG4processes.dylib"; if(! -e $fileso && ! -e $filedylib) { print "*** Error *** You need to specify the path to GEANT4 library using --with-geant4-lib=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-geant4\n\n"; exit 1; } } # If --enable-geant4 was set then the full path to the GEANT4 includes must be specified # my $gopt_with_geant4_inc = ""; if($gopt_enable_geant4_interface eq "YES") { if(($match = grep(/--with-geant4-inc/i, @ARGV)) > 0) { $options=~m/--with-geant4-inc=(\S*)/i; $gopt_with_geant4_inc = $1; } if(! -d $gopt_with_geant4_inc) { print "\n*** Warning *** GEANT4 has been enabled but you didn't specify the GEANT4 include path \n"; } # if it was not set, try to pick it up from the environment if($gopt_with_geant4_inc eq "" && defined $ENV{'GEANT4_INC'}) { $gopt_with_geant4_inc = $ENV{'GEANT4_INC'}; print "The \$GEANT4_INC env var is defined. I will pick that and use --with-geant4-inc=$gopt_with_geant4_inc\n"; } # if it still not set, try autodetecting it if(! -d $gopt_with_geant4_inc && $auto_detect) { print "Auto-detecting the GEANT4 include path...\n"; $matched = auto_detect("G4Run.hh","Geant4/G4Run.hh"); print "$gopt_with_geant4_inc \n"; if( $matched=~m/(\S*)\/Geant4\/G4Run.hh/i ) { $gopt_with_geant4_inc = $1; } print "Setting --with-geant4-inc=$gopt_with_geant4_inc\n"; } # check my $file = "$gopt_with_geant4_inc/Geant4/G4Run.hh"; if(! -e $file) { print "*** Error *** You need to specify the GEANT4 includes path using --with-geant4-inc=/some/path/\n"; print "*** Error *** Otherwise, you should --disable-geant4\n\n"; exit 1; } } # ------------------------------------------------ # libgfortran path # ------------------------------------------------ my $gopt_with_gfortran_lib = ""; if($gopt_enable_gfortran eq "YES") { if($options=~m/--with-gfortran-lib=(\S*)/i) { $gopt_with_gfortran_lib = $1; } if(! -d $gopt_with_gfortran_lib && $auto_detect) { print "\n*** Warning *** You didn't specify the gfortran library path \n"; print "Auto-detecting...\n"; $matched = auto_detect("libgfortran.*"); if( $matched=~m/(\S*)\/libgfortran\S*/i ) { $gopt_with_gfortran_lib = $1; } print "Setting --with-gfortran-lib=$gopt_with_gfortran_lib\n"; } if(! -d $gopt_with_gfortran_lib) { print "*** Error *** You need to specify the gfortran library path using --with-gfortran-lib=/some/path/\n\n"; exit 1; } } # ------------------------------------------------ # libg2c path # ------------------------------------------------ my $gopt_with_g2c_lib = ""; if($gopt_enable_g2c eq "YES") { if($options=~m/--with-g2c-lib=(\S*)/i) { $gopt_with_g2c_lib = $1; } if(! -d $gopt_with_g2c_lib && $auto_detect) { print "\n*** Warning *** You didn't specify the g2c library path \n"; print "Auto-detecting...\n"; $matched = auto_detect("libg2c.*"); if( $matched=~m/(\S*)\/libg2c\S*/i ) { $gopt_with_g2c_lib = $1; } print "Setting --with-g2c-lib=$gopt_with_g2c_lib\n"; } if(! -d $gopt_with_g2c_lib) { print "*** Error *** You need to specify the g2c library path using --with-g2c-lib=/some/path/\n\n"; exit 1; } } # Save config options # print MKCONF "GOPT_ENABLE_PYTHIA8=$gopt_enable_pythia8\n"; print MKCONF "GOPT_ENABLE_INCL=$gopt_enable_incl\n"; print MKCONF "GOPT_ENABLE_GEANT4_INTERFACE=$gopt_enable_geant4_interface\n"; print MKCONF "GOPT_ENABLE_LHAPDF5=$gopt_enable_lhapdf5\n"; print MKCONF "GOPT_ENABLE_LHAPDF6=$gopt_enable_lhapdf6\n"; print MKCONF "GOPT_ENABLE_APFEL=$gopt_enable_apfel\n"; print MKCONF "GOPT_ENABLE_FLUX_DRIVERS=$gopt_enable_flux_drivers\n"; print MKCONF "GOPT_ENABLE_GEOM_DRIVERS=$gopt_enable_geom_drivers\n"; print MKCONF "GOPT_ENABLE_T2K=$gopt_enable_t2k\n"; print MKCONF "GOPT_ENABLE_FNAL=$gopt_enable_fnal\n"; print MKCONF "GOPT_ENABLE_ATMO=$gopt_enable_atmo\n"; print MKCONF "GOPT_ENABLE_NUCLEON_DECAY=$gopt_enable_nucleon_decay\n"; print MKCONF "GOPT_ENABLE_NNBAR_OSCILLATION=$gopt_enable_nnbar_oscillation\n"; print MKCONF "GOPT_ENABLE_BOOSTED_DARK_MATTER=$gopt_enable_boosted_dark_mat\n"; print MKCONF "GOPT_ENABLE_NEUTRAL_HEAVY_LEPTON=$gopt_enable_neutral_heavy_lepton\n"; print MKCONF "GOPT_ENABLE_DARK_NEUTRINO=$gopt_enable_dark_neutrino\n"; print MKCONF "GOPT_ENABLE_EVTLIB=$gopt_enable_evtlib\n"; print MKCONF "GOPT_ENABLE_INCL=$gopt_enable_incl\n"; print MKCONF "GOPT_ENABLE_GEANT4_INTERFACE=$gopt_enable_geant4_interface\n"; print MKCONF "GOPT_ENABLE_MASTERCLASS=$gopt_enable_masterclass\n"; print MKCONF "GOPT_ENABLE_TEST=$gopt_enable_test\n"; print MKCONF "GOPT_ENABLE_DYLIBVERSION=$gopt_enable_dylibversion\n"; print MKCONF "GOPT_ENABLE_LOW_LEVEL_MESG=$gopt_enable_lowlevel_mesg\n"; print MKCONF "GOPT_ENABLE_PROFILER=$gopt_enable_profiler\n"; print MKCONF "GOPT_ENABLE_DOXYGEN_DOC=$gopt_enable_doxygen_doc\n"; print MKCONF "GOPT_ENABLE_GFORTRAN=$gopt_enable_gfortran\n"; print MKCONF "GOPT_ENABLE_G2C=$gopt_enable_g2c\n"; print MKCONF "GOPT_WITH_COMPILER=$gopt_with_compiler\n"; print MKCONF "GOPT_WITH_CXX_DEBUG_FLAG=$gopt_with_cxx_debug_flag\n"; print MKCONF "GOPT_WITH_CXX_OPTIMIZ_FLAG=-$gopt_with_cxx_optimiz_flag\n"; print MKCONF "GOPT_WITH_PROFILER_LIB=$gopt_with_profiler_lib\n"; print MKCONF "GOPT_WITH_DOXYGEN_PATH=$gopt_with_doxygen_path\n"; print MKCONF "GOPT_WITH_PYTHIA6_LIB=$gopt_with_pythia6_lib\n"; print MKCONF "GOPT_WITH_PYTHIA8_LIB=$gopt_with_pythia8_lib\n"; print MKCONF "GOPT_WITH_PYTHIA8_INC=$gopt_with_pythia8_inc\n"; print MKCONF "GOPT_WITH_LHAPDF5_LIB=$gopt_with_lhapdf5_lib\n"; print MKCONF "GOPT_WITH_LHAPDF5_INC=$gopt_with_lhapdf5_inc\n"; print MKCONF "GOPT_WITH_LHAPDF6_LIB=$gopt_with_lhapdf6_lib\n"; print MKCONF "GOPT_WITH_LHAPDF6_INC=$gopt_with_lhapdf6_inc\n"; print MKCONF "GOPT_WITH_APFEL_LIB=$gopt_with_apfel_lib\n"; print MKCONF "GOPT_WITH_APFEL_INC=$gopt_with_apfel_inc\n"; print MKCONF "GOPT_WITH_LIBXML2_INC=$gopt_with_libxml2_inc\n"; print MKCONF "GOPT_WITH_LIBXML2_LIB=$gopt_with_libxml2_lib\n"; print MKCONF "GOPT_WITH_LOG4CPP_INC=$gopt_with_log4cpp_inc\n"; print MKCONF "GOPT_WITH_LOG4CPP_LIB=$gopt_with_log4cpp_lib\n"; print MKCONF "GOPT_WITH_INCL_INC=$gopt_with_incl_inc\n"; print MKCONF "GOPT_WITH_INCL_LIB=$gopt_with_incl_lib\n"; print MKCONF "GOPT_WITH_BOOST_INC=$gopt_with_boost_inc\n"; print MKCONF "GOPT_WITH_BOOST_LIB=$gopt_with_boost_lib\n"; print MKCONF "GOPT_WITH_GEANT4_INC=$gopt_with_geant4_inc\n"; print MKCONF "GOPT_WITH_GEANT4_LIB=$gopt_with_geant4_lib\n"; print MKCONF "GOPT_WITH_GFORTRAN_LIB=$gopt_with_gfortran_lib\n"; print MKCONF "GOPT_WITH_G2C_LIB=$gopt_with_g2c_lib\n"; close(MKCONF); print "\nYour input configuration options were: @ARGV"; if($#ARGV < 0) { print "(none)" }; print "\n\n"; if(-e $MKCONF_FILE) { print "The $MKCONF_FILE file has been succesfully generated! \n"; print "The following config options were set: \n"; open(MKCONFR, "<$MKCONF_FILE") or die("Can not read back the $GENIE/src/make/Make.config!"); @make_conf=; close(MKCONFR); # print "@make_conf\n" unless ; foreach $setting (@make_conf) { chomp($setting); if ($setting=~m/\=/) {print " $setting\n";} } # Copy only the enable/disable options, excluding paths, in a separate file for genie-config. # This is needed for FNAL relocatable releases. system("cat $MKCONF_FILE | grep GOPT_ENABLE_ > $MKCONF_FILE\_no_paths"); print "\n"; print "*** To continue building GENIE type: make "; # Warning for SRT users if(defined $ENV{'SRT_ENV_SET'}) { print "(Don't forget to 'srt_setup --unsetup' first)"; } print "\n\n"; exit 0; } sub auto_detect { # First place to look when autodetecting is in the directories in LD_LIBRARY_PATH my @libdirs = ( ); push (@libdirs,split(":",$ENV{LD_LIBRARY_PATH})) if defined $ENV{LD_LIBRARY_PATH}; push (@libdirs,split(":",$ENV{DYLD_LIBRARY_PATH})) if defined $ENV{DYLD_LIBRARY_PATH}; #and the mac equivalent my @search_dir = (); foreach my $libdir (unique_entries(@libdirs)) { chomp($libdir); if (not $libdir) {next;} push (@search_dir, $libdir); # Append the LD library path directory @pathdirs = split("/",$libdir); $lastdir = pop(@pathdirs); $basedir = join("/",@pathdirs); if ($lastdir =~ m/lib/) {# If the LD_LIBRARY_PATH has "lib" in it, append "../include" push (@search_dir, $basedir."/include"); } } # and standard search paths push (@search_dir,"/usr"); push (@search_dir,"/lib"); push (@search_dir,"/opt"); push (@search_dir,"/hep"); push (@search_dir,"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/"); push (@search_dir,"$ENV{'HOME'}") if defined $ENV{'HOME'}; # add $HOME push (@search_dir,"/hep"); # add where I add ext apps in my mac book air push (@search_dir,"$ENV{'RSD_TOP_DIR'}") if defined $ENV{'RSD_TOP_DIR'}; # add where RSD puts ext supporting libs @search_dir = unique_entries(@search_dir); # Search each dir only once $search_file = shift; $optional_fullpath_substr = shift; # extra help in locating the correct file $optional_fullpath_substr = "" unless defined $optional_fullpath_substr; foreach(@search_dir) { $curr_dir = $_; if(! -d $curr_dir) {next;} @matches = `find $curr_dir/ -type f -maxdepth 7 -name \"$search_file\" 2> /dev/null | grep \"$optional_fullpath_substr\"`; $nmatches = @matches; if( $nmatches > 0) { return $matches[0]; } } return ""; } # Get unique entries in an array sub unique_entries { my %seen; return grep { !$seen{$_}++ } @_; }