-
Notifications
You must be signed in to change notification settings - Fork 93
/
configure
executable file
·1117 lines (1036 loc) · 49.5 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#! /usr/bin/perl -w
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# GENIE configuration script
#
# For help, type ./configure --help
#
# Costas Andreopoulos <c.andreopoulos \at cern.ch>
# University of Liverpool
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 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 " pythia6 Use the PYTHIA6 MC generator, assumed to be incl. w/ ROOT default: enabled \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 " heavy-neutral-lepton Beam-produced Heavy Neutral Lepton simulation default: disabled \n";
print " hnl-validation HNL simulation validation 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 " professor2 Build bundled professor2 libraries 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=<BANNER>;
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.)
#
{
chomp($has_mathmore = `root-config --has-mathmore`);
if ( $has_mathmore ne 'yes' ) {
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_pythia6 = "YES";
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_heavy_neutral_lepton = "NO";
my $gopt_enable_hnl_validation = "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";
my $gopt_enable_professor2 = "NO";
# Check configure's command line arguments for non-default values
#
if(($match = grep(/--enable-pythia6/i, @ARGV)) > 0) { $gopt_enable_pythia6 = "YES"; }
if(($match = grep(/--disable-pythia6/i, @ARGV)) > 0) { $gopt_enable_pythia6 = "NO"; }
if(($match = grep(/--enable-pythia8/i, @ARGV)) > 0) { $gopt_enable_pythia8 = "YES"; }
if(($match = grep(/--disable-pythia8/i, @ARGV)) > 0) { $gopt_enable_pythia8 = "NO"; }
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-heavy-neutral-lepton/i, @ARGV)) > 0) { $gopt_enable_heavy_neutral_lepton = "YES"; }
if(($match = grep(/--enable-hnl-validation/i, @ARGV)) > 0) { $gopt_enable_hnl_validation = "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"; }
if(($match = grep(/--enable-professor2/i, @ARGV)) > 0) { $gopt_enable_professor2 = "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
#
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;
}
my $gopt_with_pythia6_lib = "";
if($gopt_enable_pythia6 eq "YES") {
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;
}
}
# ------------------------------------------------
# Professor2 submode checkout
# ------------------------------------------------
if ($gopt_enable_professor2 eq "YES") {
#run git submodule update src/ExternalLibs/professor
print "Checking out Professor2 submodule...\n";
system("git submodule update --init src/ExternalLibs/professor");
print "Done.\n";
}
# Save config options
#
print MKCONF "GOPT_ENABLE_PYTHIA6=$gopt_enable_pythia6\n";
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_HEAVY_NEUTRAL_LEPTON=$gopt_enable_heavy_neutral_lepton\n";
print MKCONF "GOPT_ENABLE_HNL_VALIDATION=$gopt_enable_hnl_validation\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";