diff --git a/Makefile.am b/Makefile.am index 43ae8e7..ff58e85 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,47 +1,47 @@ ACLOCAL_AMFLAGS=-I m4 #do not ditribute test directories # add cuba to SUBDIRS to ship cuba -DIST_SUBDIRS = histo user cernlib ancont pegasus cubature dequad sandia smolpack besche bessel minprescription specialfunctions dyres dynnlo mcfm integrands resum counterterm v2j born phasespace vjet src +DIST_SUBDIRS = histo user cernlib ancont pegasus cubature dequad bequad sandia smolpack besche bessel minprescription specialfunctions dyres dynnlo mcfm integrands resum counterterm v2j born phasespace vjet src SUBDIRS = ${DIST_SUBDIRS} # add test directories if enabled if HAVE_TEST SUBDIRS += test endif if HAVE_DYRES SUBDIRS += origdyres endif dist_bin_SCRIPTS = install-cuba install-lhapdf install-chaplin install-cubature EXTRA_DIST = README.md bin_SCRIPTS = dyturbo-config CLEANFILES = $(bin_SCRIPTS) sharedir = ${datadir}/${PACKAGE} dist_share_DATA = ${srcdir}/input/*.in \ ${srcdir}/pdfsets.list \ ${srcdir}/scripts/compile_grid.sh \ ${srcdir}/scripts/run_grid.sh \ ${srcdir}/scripts/run_on_batch_tmpl.sh \ ${srcdir}/scripts/run_prun.sh \ ${srcdir}/scripts/submit_jobs.sh #distribute the cuba library #lib_LIBRARIES = libcuba.a #libcuba_a_SOURCES = #libcuba_a_LIBADD = Cuba-4.2/libcuba.a installcheck-local: ${bindir}/dyturbo ${sharedir}/test.in echo 's_qt->Integral()' | root -l -b results.root rm -rf ./tmp_results_main.dat rm -rf ./results.txt distclean-local: rm -rf Cuba-$(CUBA_VERSION) rm -rf lhapdf6 rm -rf chaplin-$(CHAPLIN_VERSION) rm -rf cubature/*.c cubature/*.h cubature/NEWS cubature/COPYING cubature/README cubature/ChangeLog rm -rf origdyres/*.f origdyres/*.h origdyres/DYRes-v1.0 diff --git a/bequad/Makefile.am b/bequad/Makefile.am new file mode 100644 index 0000000..b014798 --- /dev/null +++ b/bequad/Makefile.am @@ -0,0 +1,5 @@ +AUTOMAKE_OPTIONS = foreign +noinst_LTLIBRARIES = libbequad.la +libbequad_la_SOURCES = bequad.C + +pkginclude_HEADERS = bequad.h diff --git a/bequad/README b/bequad/README new file mode 100644 index 0000000..5a49a1b --- /dev/null +++ b/bequad/README @@ -0,0 +1,2 @@ +Gaussian quadrature formula for Bessel and Hankel transofroms, based on: +R. Wong, Quadrature Formulas for Oscillatory Integral Transforms, Numer. Math. 39, 351-360 (1982) diff --git a/bequad/bequad.C b/bequad/bequad.C new file mode 100644 index 0000000..7f52e17 --- /dev/null +++ b/bequad/bequad.C @@ -0,0 +1,54 @@ +#include "bequad.h" + +double bq::xxx[BQNMAX][BQNMAX]; +double bq::www[BQNMAX][BQNMAX]; + +const double bq::xxx1[1]={0.6366197724}; +const double bq::www1[1]={1.5707963268}; + +const double bq::xxx2[2]={0.3672186882,2.8441656971}; +const double bq::www2[2]={1.3999512373,0.1708450895}; + +const double bq::xxx3[3]={0.2609612883,1.8802425952,5.6269259843}; +const double bq::www3[3]={1.2294421665,0.3313894656,0.009964694674}; + +const double bq::xxx4[4]={0.2034678616,1.4202585051,4.0139876796,8.6778718603}; +const double bq::www4[4]={1.0948309833,0.4377391923,0.0377769612,0.0004491900176}; + +const double bq::xxx5[5]={0.1672481118,1.1456294188,3.1628739845,6.4939278147,11.8874874319}; +const double bq::www5[5]={0.9888810597,0.5037500094,0.07510923965,0.003038578952,0.00001743909733}; + +const double bq::xxx20[20]={4.7587473282693471E-002,0.30311377630728420,0.79745547440107778,1.5378008284073599,2.5301729993586695,3.7815665505455973,5.3007195587298437,7.0986383106085853,9.1891524365330248,11.589629460372594,14.321967381490056,17.414032373537140,20.901820349256937,24.832848839868522,29.271771022400110,34.310332776315349,40.086755862328154,46.828817611302462,54.971554405797789,65.629956635164106}; +const double bq::www20[20]={0.44346143285419798,0.50895798448839924,0.34981193134624450,0.17617599964067779,6.7413963985697822E-002,1.9728689599004624E-002,4.4013196959515619E-003,7.4228100222934943E-004,9.3474437347907435E-005,8.6466517790648288E-006,5.7528165358967190E-007,2.6794420554465309E-008,8.4357066506180960E-010,1.7140254794025682E-011,2.1107038240983881E-013,1.4411407745542788E-015,4.7738261490297791E-018,6.1649001068709518E-021,2.0523304394046464E-024,6.2262943320824677E-029}; + +const double bq::xxx40[40]={2.4975247733162315E-002,0.15529079735962892,0.40464677982318603,0.77551580225820227,1.2692940421547241,1.8871314001584389,2.6301921109135904,3.4997630014320329,4.4973080961199425,5.6245025665031818,6.8832589918958531,8.2757516882200974,9.8044420252154278,11.472106501978500,13.281868914433922,15.237237856447443,17.342150897834433,19.601027026102877,22.018829316547752,24.601140334756128,27.354253517534222,30.285284812082182,33.402310289340278,36.714537492983325,40.232521219186665,43.968438743809273,47.936445983430644,52.153146041875623,56.638217327650949,61.415274111659343,66.513075833862658,71.967278139495704,77.823060879359545,84.139248581653078,90.995133354463164,98.502593728147346,106.82973920339978,116.25361144390195,127.30466673164746,141.34934838319916}; +const double bq::www40[40]={0.27571798915212997,0.37780283916157142,0.34219808858194423,0.25363548854953105,0.16110668031800007,8.9056813712745292E-002,4.3096243264730189E-002,1.8296518405717360E-002,6.8173736925994915E-003,2.2280005029181637E-003,6.3783808092976034E-004,1.5967483423051236E-004,3.4877429737977887E-005,6.6300025343598816E-006,1.0935812180868110E-006,1.5598504872873706E-007,1.9166442827949698E-008,2.0199703640038718E-009,1.8170767522277429E-010,1.3875124182803839E-011,8.9379705490325748E-013,4.8231194898496547E-014,2.1629179587369564E-015,7.9877654995293847E-017,2.4041236175657544E-018,5.8265716851351577E-020,1.1213130704463346E-021,1.6857212763000776E-023,1.9416256159155818E-025,1.6740362563892675E-027,1.0502516293218400E-029,4.6294617709157574E-032,1.3715644826200396E-034,2.5781920359258778E-037,2.8454502064616417E-040,1.6532269400291316E-043,4.2943903154159021E-047,3.8151183863963603E-051,6.9684468404932884E-056,7.1970468958095005E-062}; + +void bq::init() +{ + for (int i = 0; i < BQNMAX; i++) + for (int j = 0; j < BQNMAX; j++) + { + xxx[i][j] = 0; + www[i][j] = 0; + } + + for (int i = 0; i < BQNMAX; i++) + { + if (i < 1) xxx[1-1][i] = xxx1[i]; + if (i < 2) xxx[2-1][i] = xxx2[i]; + if (i < 3) xxx[3-1][i] = xxx3[i]; + if (i < 4) xxx[4-1][i] = xxx4[i]; + if (i < 5) xxx[5-1][i] = xxx5[i]; + if (i < 20) xxx[20-1][i] = xxx20[i]; + if (i < 40) xxx[40-1][i] = xxx40[i]; + + if (i < 1) www[1-1][i] = www1[i]; + if (i < 2) www[2-1][i] = www2[i]; + if (i < 3) www[3-1][i] = www3[i]; + if (i < 4) www[4-1][i] = www4[i]; + if (i < 5) www[5-1][i] = www5[i]; + if (i < 20) www[20-1][i] = www20[i]; + if (i < 40) www[40-1][i] = www40[i]; + } +} diff --git a/bequad/bequad.h b/bequad/bequad.h new file mode 100644 index 0000000..14e727b --- /dev/null +++ b/bequad/bequad.h @@ -0,0 +1,22 @@ +#ifndef bequad_h +#define bequad_h + +#define BQNMAX 40 + +namespace bq +{ + extern double xxx[BQNMAX][BQNMAX]; + extern double www[BQNMAX][BQNMAX]; + + extern const double xxx1[1],www1[1]; + extern const double xxx2[2],www2[2]; + extern const double xxx3[3],www3[3]; + extern const double xxx4[4],www4[4]; + extern const double xxx5[5],www5[5]; + extern const double xxx20[20],www20[20]; + extern const double xxx40[40],www40[40]; + + extern void init(); +} + +#endif diff --git a/bequad/dOPbess.f b/bequad/dOPbess.f new file mode 100644 index 0000000..6a1be65 --- /dev/null +++ b/bequad/dOPbess.f @@ -0,0 +1,211 @@ +c +c + program dOPbess +c +c + external dquad + double precision dnu,x0,a1(100),b1(100),a2(100), + *b2(100),a3(100),b3(100),a4(100),b4(100),e(100), + *d1mach,depsma,dendl(4),dendr(4),deps,dxp(1),dyp(1), + *dxfer(100),dwfer(100),dalpha(40),dbeta(40),dbe(40), + *dx(100),dw(100),dxm(400),dwm(400),dp0(400),dp1(400),dp2(400) + logical finld,finrd + common/d/dnu,x0,a1,b1,a2,b2,a3,b3,a4,b4,e +c +c This routine generates in double precision the first 40 +c recurrence coefficients of the orthogonal polynomials for +c the K-Bessel weight function. Printed are the double-precision +c values of the alpha- and beta-coefficients. The routine +c requires the ORTHPOL routines d1mach, drecur, dgauss, dmcdis. +c dqgp, dsti, and dlancz (see W. Gautschi, "Algorithm 726: +c ORTHPOL -- a package of routines for generating orthogonal +c polynomials and Gauss-type quadrature rules", ACM Trans. Math. +c Software, v. 20 (1994), pp. 21-62). +c + print *,'hello' + stop + nmax=40 + dnu=1.d0/3.d0 + if(dnu.lt..05d0 .or. dnu.gt..95d0) then + write(*,1) + 1 format(1x,'nu out of range') + stop + end if + x0=1.d0 + call drecur(100,6,0.d0,-dnu,a1,b1,ier1) + call drecur(100,6,0.d0,dnu,a2,b2,ier2) + call drecur(100,1,0.d0,0.d0,a3,b3,ier3) + call drecur(100,7,0.d0,0.d0,a4,b4,ier4) + if(ier1.ne.0 .or. ier2.ne.0 .or. ier3.ne.0 .or. + * ier4.ne.0) then + write(*,2) ier1,ier2,ier3,ier4 + 2 format(1x,'ier1 in drecur=',i5,' ier2=',i5, + * 'ier3=',i5,' ier4=',i5) + stop + end if + finld=.true. + finrd=.false. + depsma=d1mach(3) +c +c depsma is the machine double precision. +c + iq=1 + idelta=1 + irout=1 + mcd=4 + mp=0 + ncpmd=100 +c +c Set up the partition for the discretization of the inner product. +c + dendl(1)=0.d0 + dendl(2)=1.d0 + dendl(3)=2.d0 + dendl(4)=3.d0 + dendr(1)=1.d0 + dendr(2)=2.d0 + dendr(3)=3.d0 + deps=1.d3*depsma +c +c Compute the desired recursion coefficients by the multiple-component +c discretization procedure. +c + call dmcdis(nmax,ncpmd,mcd,mp,dxp,dyp,dquad,deps,iq,idelta,irout, + * finld,finrd,dendl,dendr,dxfer,dwfer,dalpha,dbeta,ncapd,kountd, + * ierrd,ied,dbe,dx,dw,dxm,dwm,dp0,dp1,dp2) +c +c Print the results. +c + write(*,3) + 3 format(/5x,'k',6x,'dalpha(k)',13x,'dbeta(k)'/) + do 20 k=1,nmax + km1=k-1 + write(*,4) km1,dalpha(k),dbeta(k) + 4 format(1x,i5,2d21.13) + 20 continue + stop + end + + subroutine dquad(n,dx,dw,i,ierr) + double precision dx(n),dw(n),dnu,x0,a1(100),b1(100),a2(100), + *b2(100),a3(100),b3(100),a4(100),b4(100),e(100),z(23),w(23), + *pi,c,eps,d1mach,x1,c1,dgamma,x,x2,sum1,t1,dm,sum,t,dbessK + common/d/dnu,x0,a1,b1,a2,b2,a3,b3,a4,b4,e + common/da/z,w + pi=4.d0*datan(1.d0) + c=2.d0*dcos(.5d0*dnu*pi)/pi + eps=d1mach(3) + x1=10.d0 + if(i.eq.1) then + c1=pi*((.25d0*x0)**(1.d0-dnu))/(dsin(dnu*pi)*dgamma(1.d0- + * dnu,ie)) + call dgauss(n,a1,b1,eps,dx,dw,ierg,e) + do 20 k=1,n + dx(k)=.5d0*x0*(1.d0+dx(k)) + x=dx(k) + m=0 + x2=x**2 + sum1=1.d0 + t1=1.d0 + 10 m=m+1 + dm=dble(m) + sum=sum1 + t=t1 + t1=x2*t/(4.d0*dm*(dm-dnu)) + sum1=sum+t1 + if(sum1.ne.sum) goto 10 + dw(k)=c*c1*sum1*dw(k) + 20 continue + else if(i.eq.2) then + c1=pi*((.25d0*x0)**(1.d0+dnu))/(dsin(dnu*pi)*dgamma(1.d0+ + * dnu,ie)) + call dgauss(n,a2,b2,eps,dx,dw,ierg,e) + do 40 k=1,n + dx(k)=.5d0*x0*(1.d0+dx(k)) + x=dx(k) + m=0 + x2=x**2 + sum1=1.d0 + t1=1.d0 + 30 m=m+1 + dm=dble(m) + sum=sum1 + t=t1 + t1=x2*t/(4.d0*dm*(dm+dnu)) + sum1=sum+t1 + if(sum1.ne.sum) goto 30 + dw(k)=-c*c1*sum1*dw(k) + 40 continue + else if(i.eq.3) then + call dgauss(n,a3,b3,eps,dx,dw,ierg,e) + do 50 k=1,n + dx(k)=.5d0*((x1-x0)*dx(k)+x1+x0) + dw(k)=.5d0*c*(x1-x0)*dexp(-dx(k))*dbessK(dx(k),dnu)*dw(k) + 50 continue + else + c1=dexp(-x1) + call dgauss(n,a4,b4,eps,dx,dw,ierg,e) + do 60 k=1,n + dx(k)=x1+dx(k) + dw(k)=c*c1*dbessK(dx(k),dnu)*dw(k) + 60 continue + end if + return + end + + double precision function dbessK(x,dnu) +c +c This computes exp(x)K_nu(x) for positive x. +c + double precision x,dnu,z(23),w(23),eps,d1mach,al,a(23), + *b(23),e(23),pi,c1,dser,dgamma,c2,sum + common/da/z,w + if(x.lt.0.d0) then + write(*,1) + 1 format(1x,'invalid x-argument in dbessK') + stop + end if + eps=d1mach(3) + al=dnu-.5d0 + call drecur(23,7,al,0.d0,a,b,ierr) + call dgauss(23,a,b,eps,z,w,ierg,e) + pi=4.d0*datan(1.d0) + c1=pi/(2.d0*dsin(dnu*pi)) + if(x.le.2.d0) then + dbessK=c1*dexp(x)*(((.5d0*x)**(-dnu))*dser(x,-dnu)/ + * dgamma(1.d0-dnu,ie)-((.5d0*x)**dnu)*dser(x,dnu)/ + * dgamma(1.d0+dnu,ie)) + else + n=23 + c2=dsqrt(pi)/((2.d0**dnu)*dgamma(dnu+.5d0,ie)) + sum=0.d0 + do 10 k=1,n + sum=sum+w(k)*(2.d0+z(k)/x)**al + 10 continue + dbessK=c2*sum/dsqrt(x) + end if + return + end + + double precision function dser(x,dnu) + double precision x,dnu,x2,sum1,t1,dk,sum,t + k=0 + x2=x**2 + sum1=1.d0 + t1=1.d0 + 10 k=k+1 + dk=dble(k) + sum=sum1 + t=t1 + t1=x2*t/(4.d0*dk*(dnu+dk)) + sum1=sum+t1 + if(sum1.ne.sum) goto 10 + dser=sum1 + return + end + + double precision function dwf(x,i) + double precision x + return + end + diff --git a/configure.ac b/configure.ac index 9ac634b..192f36c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,291 +1,292 @@ -AC_INIT([dyturbo], [1.0], [stefano.camarda@cern.ch]) +AC_INIT([dyturbo], [0.99], [stefano.camarda@cern.ch]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([foreign -Wall -Werror]) #Suppress verbose output when compiling m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) #By default, install binaries in the current directory AC_PREFIX_DEFAULT(${PWD}) AC_PROG_CC m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) #Use libtoolize to build dyturbo libraries AC_PROG_LIBTOOL LT_INIT AC_CONFIG_MACRO_DIR([m4]) # openmp suport AC_ARG_ENABLE([openmp], AC_HELP_STRING(--enable-openmp, [Enable openMP compiler flag -fopenmp. (default=yes)])): ${enable_openmp=yes} AS_IF([test "x$enable_openmp" = "xyes"], [ #AX_OPENMP #[, AC_MSG_ERROR([openmp macro not found])]) #AC_SUBST(OPENMP_CXXFLAGS) #AC_SUBST(OPENMP_LDFLAGS) CXXFLAGS="${CXXFLAGS} -fopenmp" FFLAGS="${FFLAGS} -fopenmp"]) #optimisation flags O3 AC_ARG_ENABLE([O3], AC_HELP_STRING(--enable-O3, [Use compiler optimization flags -O3. (default=yes)])): ${enable_O3=yes} AS_IF([test "x$enable_O3" = "xyes"], [ CXXFLAGS="${CXXFLAGS} -O3" FFLAGS="${FFLAGS} -O3"]) #optimisation flags, O3 or Ofast AC_ARG_ENABLE([Ofast], AC_HELP_STRING(--enable-Ofast, [Use unsafe compiler optimization flags -Ofast. (default=no)])) AS_IF([test "x$enable_Ofast" = "xyes"], [ CXXFLAGS="${CXXFLAGS} -Ofast" FFLAGS="${FFLAGS} -Ofast" ]) #c++11 flag is needed for the random number generator function #CXXFLAGS="${CXXFLAGS} -std=c++11" #older compilers needs c++0x instead CXXFLAGS="${CXXFLAGS} -std=c++0x" #allows usage of complex numbers as x+yi CXXFLAGS="${CXXFLAGS} -fext-numeric-literals" #obsolete fortran do statements #FFLAGS="${FFLAGS} -std=legacy" #allows use of save statements (but causes issues with parallelisation) #FFLAGS="${FFLAGS} -fno-automatic" #use intel compilers #AC_ARG_ENABLE([ifort], # [AC_HELP_STRING(--enable-ifort, [Use ifort2015 and icc2015 compilers. (default=no)])]) #if test x$enable_ifort == xyes #then # AC_PROG_CXX([icc2015]) # AC_PROG_F77([ifort2015]) # AC_PROG_FC([ifort2015]) #else ##use gfortran compilers # AC_PROG_CXX # AC_PROG_F77([gfortran]) # AC_PROG_FC #fi AC_PROG_CXX AC_PROG_F77([gfortran]) AC_PROG_FC # check for lhapdf installation AC_MSG_CHECKING([for lhapdf installation]) # search lhapdf6 in the path lhapdf_config=`which lhapdf-config` if test x$lhapdf_config == x; then # if not found, search lhapdf6 in the lhapdf6 subdirectory lhapdf_config=`ls ${PWD}/lhapdf6/bin/lhapdf-config` if test x$lhapdf_config == x; then # if not found, install it AC_MSG_RESULT([Install LHAPDF6]) ${srcdir}/install-lhapdf #AC_MSG_ERROR([Unable to find lhapdf-config.]) lhapdf_config=`ls ${PWD}/lhapdf6/bin/lhapdf-config` if test x$lhapdf_config == x; then # if the installation fails, exit AC_MSG_ERROR([Failed to install lhapdf.]) fi fi fi # set up lhapdf flags LHAPDF_CPPFLAGS=`${lhapdf_config} --cppflags` LHAPDF_LDFLAGS=`${lhapdf_config} --ldflags` AC_SUBST(LHAPDF_CPPFLAGS) AC_SUBST(LHAPDF_LDFLAGS) AC_MSG_RESULT([Using $lhapdf_config]) # check for Cuba installation, and install it if missing AC_MSG_CHECKING([for Cuba library installation]) AC_SEARCH_LIBS([vegas],[cuba],[ AC_MSG_RESULT([Using -lcuba from system installation]) CUBA_LDFLAGS=-lcuba], [ CUBA_VERSION=4.2 AC_SUBST(CUBA_VERSION) # search for local istallation of Cuba-4.2 cubalib=`ls ${PWD}/Cuba-${CUBA_VERSION}/libcuba.a` if test x$cubalib == x; then # if not found, install it AC_MSG_RESULT([Install Cuba ${CUBA_VERSION}]) ${srcdir}/install-cuba fi cubalib=`ls ${PWD}/Cuba-${CUBA_VERSION}/libcuba.a` if test x$cubalib == x; then AC_MSG_ERROR([Failed to install Cuba ${CUBA_VERSION}.]) fi CUBA_LDFLAGS="-L${PWD}/Cuba-${CUBA_VERSION} -lcuba" CUBA_CPPFLAGS="-I${PWD}/Cuba-${CUBA_VERSION}" AC_MSG_RESULT([Using -lcuba from local installation ${PWD}/Cuba-${CUBA_VERSION}]) ]) ## Use the following to ship cuba as third party library #CUBA_VERSION=4.2 #AC_SUBST(CUBA_VERSION) #AC_CONFIG_SUBDIRS([cuba/Cuba-4.2]) #CUBA_LDFLAGS="-L\$(builddir)/../cuba/Cuba-${CUBA_VERSION} -lcuba" #CUBA_CPPFLAGS="-I\$(srcdir)/../cuba/Cuba-4.2" AC_SUBST(CUBA_CPPFLAGS) AC_SUBST(CUBA_LDFLAGS) ## check for Chaplin installation, and install it if missing #AC_MSG_CHECKING([for chaplin library installation]) #AC_SEARCH_LIBS([hpl2],[hpl3],[ # AC_MSG_RESULT([Using -lchaplin from system installation]) # CHAPLIN_LDFLAGS=-lchaplin], # [ # CHAPLIN_VERSION=1.2 # AC_SUBST(CHAPLIN_VERSION) # # search for local istallation of chaplin-1.2 # chaplinlib=`ls ${PWD}/chaplin-${CHAPLIN_VERSION}/lib/libchaplin.a` # if test x$chaplinlib == x; then # # if not found, install it # AC_MSG_RESULT([Install chaplin ${CHAPLIN_VERSION}]) # ${srcdir}/install-chaplin # fi # chaplinlib=`ls ${PWD}/chaplin-${CHAPLIN_VERSION}/lib/libchaplin.a` # if test x$chaplinlib == x; then # AC_MSG_ERROR([Failed to install chaplin ${CHAPLIN_VERSION}.]) # fi # # CHAPLIN_LDFLAGS="-L${PWD}/chaplin-${CHAPLIN_VERSION}/lib -lchaplin" # AC_MSG_RESULT([Using -lchaplin from local installation ${PWD}/chaplin-${CHAPLIN_VERSION}]) # ]) # #AC_SUBST(CHAPLIN_LDFLAGS) # check for cubature installation, and install it if missing AC_MSG_CHECKING([for cubature source code]) ${srcdir}/install-cubature cubasrc=`ls ${PWD}/cubature/pcubature.c` if test x$cubasrc == x; then AC_MSG_ERROR([Failed to install cubature.]) fi # check for DYRES installation AC_ARG_ENABLE([dyres], AC_HELP_STRING(--enable-dyres, [Install and link original DYRes code, Available only in git (default=no)])) AS_IF([test "x$enable_dyres" = "xyes"], [ AC_MSG_CHECKING([for DYRes installation]) # search in origdyres/DYRes-v1.0 dyresinst=`ls -d ${PWD}/origdyres/DYRes-v1.0` AS_IF([test "x$dyresinst" = x], [ # if not found, install it AC_MSG_RESULT([Install DYRes]) cd ${srcdir}/origdyres && ${srcdir}/install-dyres && cd .. ]) ]) AM_CONDITIONAL([HAVE_DYRES],test "x$enable_dyres" = "xyes") # enable test programs AC_ARG_ENABLE([test], AC_HELP_STRING(--enable-test, [Compile test programs, Available only in git (default=no)])) AS_IF([test "x$enable_test" = "xyes"], [ GMOCK_OFILE="${PWD}/gmock/googlemock/make/gmock_main.a" AC_MSG_CHECKING([for GMock installation]) gmockinst=`ls ${GMOCK_OFILE} 2> /dev/null` AS_IF([test "x$gmockinst" = x], [ # if not found, install it AC_MSG_RESULT([ Gmock not found.. installing]) [ ! test -d ${srcdir}/gmock/googlemock/make ] && git clone https://github.com/google/googletest.git ${srcdir}/gmock; cd ${srcdir}/gmock/googlemock/make && make ; cd -; ]) GMOCK_CPPFLAGS="-pthread -isystem ${PWD}/gmock/googletest/include -isystem ${PWD}/gmock/googlemock/include" GMOCK_LDFLAGS="-lpthread ${GMOCK_OFILE}" AC_MSG_RESULT([ compiling test. Using gmock in ${GMOCK_OFILE}]) ]) AM_CONDITIONAL([HAVE_TEST],test "x$enable_test" = "xyes") AC_SUBST(GMOCK_CPPFLAGS) AC_SUBST(GMOCK_LDFLAGS) # Set --enable-root option, for linking histograms AC_ARG_ENABLE([root], AC_HELP_STRING(--enable-root, [Use root for histograming. (default=no)])) AS_IF([test "x$enable_root" = "xyes"], [ AC_MSG_CHECKING([for root installation]) root_config=`which root-config` AS_IF([test x$root_config == x], [AC_MSG_ERROR([Unable to find root-config.])], [AC_MSG_RESULT([Using $root_config]) root_ok=1 ROOT_CFLAGS=`root-config --cflags` ROOT_LDFLAGS=`root-config --ldflags --libs` AC_SUBST(ROOT_CFLAGS) AC_SUBST(ROOT_LDFLAGS) AC_DEFINE(USEROOT, "1",[ Turn on the ROOT for histogramming.] ) ]) ]) AM_CONDITIONAL([HAVE_ROOT],test "x$enable_root" = "xyes") # Enable debug symbols AC_ARG_ENABLE([debug], [AC_HELP_STRING(--enable-debug, [Add debug flags. (default=no)])]) AS_IF([test "x$enable_debug" = "xyes"], [ AC_MSG_RESULT([Adding debug symbols.]) FFLAGS="$FFLAGS -ggdb -gdwarf" CXXFLAGS="$CXXFLAGS -ggdb -gdwarf" ]) # Check for trapFPE flag AC_ARG_ENABLE([trapFPE], [AC_HELP_STRING(--enable-trapFPE, [Stop of floating point errors (default=no)])]) AS_IF([test "x$enable_trapFPE" = "xyes"], [ AC_MSG_RESULT([Add floating point trap.]) FFLAGS="$FFLAGS -ffpe-trap='invalid,overflow,zero'" ]) # Check for check bounds flag AC_ARG_ENABLE([checkBounds], [AC_HELP_STRING(--enable-checkBounds, [add -fbounds-check flag for compilation (default=no)])]) AS_IF([test "x$enable_checkBounds" = "xyes"], [ AC_MSG_RESULT([Add check bounds flag]) FFLAGS="$FFLAGS -fbounds-check" ]) AC_CONFIG_FILES([Makefile user/Makefile histo/Makefile resum/Makefile counterterm/Makefile vjet/Makefile v2j/Makefile born/Makefile phasespace/Makefile integrands/Makefile dyres/Makefile dynnlo/Makefile mcfm/Makefile cernlib/Makefile dequad/Makefile + bequad/Makefile sandia/Makefile smolpack/Makefile besche/Makefile bessel/Makefile minprescription/Makefile specialfunctions/Makefile ancont/Makefile pegasus/Makefile cubature/Makefile src/Makefile dyturbo-config]) AM_COND_IF([HAVE_DYRES], [ AC_CONFIG_FILES([origdyres/Makefile]) ]) AM_COND_IF([HAVE_TEST], [ AC_CONFIG_FILES([test/Makefile]) ]) #add this to ship cuba # cuba/Makefile AC_OUTPUT