Page MenuHomeHEPForge

No OneTemporary

Index: trunk/src/lhapdf/LHAPDFWrap.cpp
===================================================================
--- trunk/src/lhapdf/LHAPDFWrap.cpp (revision 5887)
+++ trunk/src/lhapdf/LHAPDFWrap.cpp (revision 5888)
@@ -1,10 +1,74 @@
#include "LHAPDF/LHAPDF.h"
+#include "LHAPDF/Info.h"
+#include "LHAPDF/Exceptions.h"
using namespace LHAPDF;
using namespace std;
extern "C" {
+ void lhapdf_init_pdf (const string setname, const int imem) {
+ LHAPDF::PDF* pdf = LHAPDF::mkPDF(setname, imem);
+ }
+ // Does not do at the moment what it should do, as it
+ // does not select the member number
+ void lhapdf_init_mem (const int set, const int imem) {
+ LHAPDF::PDF* pdf = LHAPDF::mkPDF(set);
+ }
+ void lhapdf_pdf_delete (const LHAPDF::PDF* pdf) {
+ delete pdf;
+ }
+
+ double lhapdf_pdf_getxmin (const string setname, const int imem) {
+ LHAPDF::PDF* pdf = LHAPDF::mkPDF(setname, imem);
+ return pdf->info().get_entry_as<double>("XMin");
+ delete pdf;
+ }
+
+ double lhapdf_pdf_getxmax (const string setname, const int imem) {
+ LHAPDF::PDF* pdf = LHAPDF::mkPDF(setname, imem);
+ return pdf->info().get_entry_as<double>("XMax");
+ delete pdf;
+ }
+
+ double lhapdf_pdf_getq2min (const string setname, const int imem) {
+ LHAPDF::PDF* pdf = LHAPDF::mkPDF(setname, imem);
+ return LHAPDF::sqr(pdf->info().get_entry_as<double>("QMin"));
+ delete pdf;
+ }
+
+ double lhapdf_pdf_getq2max (const string setname, const int imem) {
+ LHAPDF::PDF* pdf = LHAPDF::mkPDF(setname, imem);
+ return LHAPDF::sqr(pdf->info().get_entry_as<double>("QMax"));
+ delete pdf;
+ }
+
+ bool lhapdf_has_photon (const LHAPDF::PDF* pdf) {
+ return pdf->hasFlavor(22);
+ }
+
+ /// Get xf(x) values for common partons from PDF pdf
+ // Evaluate for the 13 LHAPDF5 standard partons
+ void lhapdf_evolvepdfm (const int& set, const double& x, const double& q, double* fxq) {
+ LHAPDF::PDF* pdf = LHAPDF::mkPDF(set);
+ for (size_t i = 0; i < 13; ++i) {
+ fxq[i] = pdf->xfxQ(i-6, x, q);
+ }
+ delete pdf;
+ }
+
+ /// Get xfx values from current PDF, including an extra photon flavor
+ void lhapdf_evolvepdfphotonm (const int& set, const double& x, const double& q, double* fxq, double& photonfxq) {
+ lhapdf_evolvepdfm (set, x, q, fxq);
+ LHAPDF::PDF* pdf = LHAPDF::mkPDF(set);
+ photonfxq = pdf->xfxQ(22, x, q);
+ }
+
+ void lhapdf_evolvepdfpm (const int& set, const double& x, const double& q, const double& s, const int& scheme, double& fxq) {
+ throw LHAPDF::NotImplementedError("Photon structure function are not yet supported");
+ }
+
+
}
Index: trunk/src/lhapdf/lhapdf.f90
===================================================================
--- trunk/src/lhapdf/lhapdf.f90 (revision 5887)
+++ trunk/src/lhapdf/lhapdf.f90 (revision 5888)
@@ -1,2 +1,82 @@
module lhapdf
+
+ use, intrinsic :: iso_c_binding
+ use kinds
+
+ ! Interface for generic operators
+
+ interface
+ subroutine lhapdf_evolvepdfm (set, x, q, ff) bind (C)
+ import
+ integer(c_int), intent(in), value :: set
+ real(c_double), intent(in), value :: x, q
+ real(c_double), dimension(-6:6), intent(out) :: ff
+ end subroutine lhapdf_evolvepdfm
+ end interface
+
+ interface
+ subroutine lhapdf_evolvepdfphotonm (set, x, q, ff, fphot) bind (C)
+ import
+ integer(c_int), intent(in), value :: set
+ real(c_double), intent(in), value :: x, q
+ real(c_double), dimension(-6:6), intent(out) :: ff
+ real(c_double), intent(out) :: fphot
+ end subroutine lhapdf_evolvepdfphotonm
+ end interface
+
+ interface
+ subroutine lhapdf_evolvepdfpm (set, x, q, s, scheme, ff) bind (C)
+ import
+ integer(c_int), intent(in), value :: set, scheme
+ real(c_double), intent(in), value :: x, q, s
+ real(c_double), dimension(-6:6), intent(out) :: ff
+ end subroutine lhapdf_evolvepdfpm
+ end interface
+
+ interface
+ subroutine lhapdf_init_pdf (set, imem)
+ import
+ integer(c_int), intent(in), value :: imem
+ character(c_char), dimension(*), intent(in) :: set
+ end subroutine lhapdf_init_pdf
+ end interface
+
+ interface
+ end interface
+
+contains
+
+ subroutine evolvePDFM (set, x, q, ff)
+ integer, intent(in) :: set
+ double precision, intent(in) :: x, q
+ double precision, dimension(-6:6), intent(out) :: ff
+ call lhapdf_evolvepdfm (set, x, q, ff)
+ end subroutine evolvePDFM
+
+ subroutine evolvePDFphotonM (set, x, q, ff, fphot)
+ integer, intent(in) :: set
+ double precision, intent(in) :: x, q
+ double precision, dimension(-6:6), intent(out) :: ff
+ double precision, intent(out) :: fphot
+ call lhapdf_evolvepdfphotonm (set, x, q, ff, fphot)
+ end subroutine evolvePDFphotonM
+
+ subroutine evolvePDFpM (set, x, q, s, scheme, ff)
+ integer, intent(in) :: set, scheme
+ double precision, intent(in) :: x, q, s
+ double precision, dimension(-6:6), intent(out) :: ff
+ call lhapdf_evolvepdfpm (set, x, q, s, scheme, ff)
+ end subroutine evolvePDFpM
+
+ subroutine InitPDFsetM (set, file)
+ integer, intent(in) :: set
+ character(*), intent(in) :: file
+ call lhapdf_init_pdf (file, set)
+ end subroutine InitPDFsetM
+
+ subroutine InitPDFM (set, mem)
+ integer, intent(in) :: set, mem
+ call lhapdf_init_mem (set, mem)
+ end subroutine InitPDFM
+
end module lhapdf
Index: trunk/src/muli/Makefile.am
===================================================================
--- trunk/src/muli/Makefile.am (revision 5887)
+++ trunk/src/muli/Makefile.am (revision 5888)
@@ -1,61 +1,61 @@
## Makefile.am -- Makefile for WHIZARD - Multiple Interactions
##
## Process this file with automake to produce Makefile.in
## The files in this directory end up in an auxiliary libtool library.
if MPI_AVAILABLE
noinst_LTLIBRARIES = libmuli.la
else
noinst_LTLIBRARIES = libmuli_dummy.la
endif
# commented out by SS
#AM_FFLAGS = @FC_PROF@
AM_FFLAGS = ""
if FC_IS_NAG
AM_FFLAGS += -dcfuns -w
endif
libmuli_la_SOURCES = muli.f90 muli_basic.f90 muli_cuba.f90 muli_momentum.f90 muli_interactions.f90 muli_trapezium.f90 muli_fibonacci_tree.f90 muli_aq.f90 muli_dsigma.f90 muli_remnant.f90 muli_mcint.f90
libmuli_dummy_la_SOURCES = muli_dummy.f90
## Fortran module dependencies
# The following line just says
# include Makefile.depend
# but in a portable fashion (depending on automake's AM_MAKE_INCLUDE
@am__include@ @am__quote@Makefile.depend@am__quote@
Makefile.depend: $(libmuli_la_SOURCES)
@rm -f $@
for src in $^; do \
module="`basename $$src | sed 's/\.f[90][0358]//'`"; \
grep '^ *use ' $$src \
| grep -v '!NODEP!' \
| sed -e 's/^ *use */'$$module'.lo: /' \
-e 's/, *only:.*//' \
-e 's/, *&//' \
-e 's/, *.*=>.*//' \
-e 's/$$/.lo/' ; \
done > $@
DISTCLEANFILES = Makefile.depend
# commented out by SS
#AM_FCFLAGS = @FC_PROF@ -I../misc -I../vamp/src/
-AM_FCFLAGS = -I../misc -I../vamp/src/ -I../pdf_builtin
+AM_FCFLAGS = -I../misc -I../../vamp/src/ -I../pdf_builtin
# commented out by SS
### OpenMP
#AM_LDFLAGS =
#if WHIZARD_WITH_OPENMP
#AM_FCFLAGS += $(OPENMP_FCFLAGS)
#AM_LDFLAGS += $(OPENMP_FCFLAGS)
#endif
## Non-standard cleanup tasks
clean-local:
-rm -f *.$(FC_MODULE_EXT)
## Remove backup files
maintainer-clean-local:
-rm -f *~
Index: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am (revision 5887)
+++ trunk/src/Makefile.am (revision 5888)
@@ -1,150 +1,154 @@
## Makefile.am -- Makefile for WHIZARD
##
## Process this file with automake to produce Makefile.in
#
# Copyright (C) 1999-2014 by
# Wolfgang Kilian <kilian@physik.uni-siegen.de>
# Thorsten Ohl <ohl@physik.uni-wuerzburg.de>
# Juergen Reuter <juergen.reuter@desy.de>
# with contributions from
# Christian Speckner <cnspeckn@googlemail.com>
#
# WHIZARD is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# WHIZARD is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
########################################################################
## Subdirectories to configure
SUBDIRS = \
hepmc lhapdf lhapdf5 stdhep hoppet \
misc fastjet pdf_builtin shower muli \
whizard-core prebuilt models
if MPOST_AVAILABLE
SUBDIRS += gamelan feynmf
endif
## -------------------------------------------------------------------
## Build the toplevel WHIZARD library, which wraps various libraries
## built in the subdirectories
## and the wrapper O'Mega library, which contains omegalib and
## the W/O interface modules for the various models
lib_LTLIBRARIES = libwhizard.la libomega.la
libwhizard_la_SOURCES =
libwhizard_la_LDFLAGS = $(LIBRARY_VERSION)
libomega_la_SOURCES =
## Collect the various partial libraries
libwhizard_la_LIBADD = \
whizard-core/libwhizard_core.la \
../vamp/src/libvamp.la \
../circe1/src/libcirce1.la \
../circe2/src/libcirce2.la \
misc/libaux.la \
pdf_builtin/libpdf_builtin.la
if SHOWER_AVAILABLE
libwhizard_la_LIBADD += \
shower/libshower.la
else
libwhizard_la_LIBADD += \
shower/libshower_dummy.la
endif
if MPI_AVAILABLE
libwhizard_la_LIBADD += \
muli/libmuli.la
else
libwhizard_la_LIBADD += \
muli/libmuli_dummy.la
endif
if HEPMC_AVAILABLE
libwhizard_la_LIBADD += hepmc/libHepMCWrap.la
else
libwhizard_la_LIBADD += hepmc/libHepMCWrap_dummy.la
endif
libomega_la_LIBADD = \
../omega/src/libomega_core.la \
models/libmodels.la
## If (parts of) LHAPDF is not available, link in a dummy as replacements
-if LHAPDF5_AVAILABLE
+if LHAPDF_AVAILABLE
libwhizard_la_LIBADD += $(LDFLAGS_LHAPDF)
endif
if LHAPDF_DUMMY
libwhizard_la_LIBADD += lhapdf5/libLHAPDF5_dummy.la
endif
## If STDHEP is not available, link in a dummy as replacements
if STDHEP_AVAILABLE
libwhizard_la_LIBADD += $(LDFLAGS_STDHEP)
else
libwhizard_la_LIBADD += stdhep/libstdhep_dummy.la
endif
if HOPPET_AVAILABLE
libwhizard_la_LIBADD += $(LDFLAGS_HOPPET) hoppet/libhoppet.la
else
libwhizard_la_LIBADD += hoppet/libhoppet_dummy.la
endif
if FASTJET_AVAILABLE
libwhizard_la_LIBADD += $(FASTJET_LIBS) fastjet/libFastjetWrap.la
else
libwhizard_la_LIBADD += fastjet/libFastjetWrap_dummy.la
endif
+if LHAPDF6_AVAILABLE
+libwhizard_la_LIBADD += $(LHAPDF_LIBS) lhapdf/libLHAPDFWrap.la
+endif
+
## -------------------------------------------------------------------
## Build a standalone program
bin_PROGRAMS = whizard
whizard_SOURCES =
## A dummy source tells libtool that the F90 compiler is used for linking
## Without dummy, libtool uses the C linker (default: ld)
nodist_EXTRA_whizard_SOURCES = dummy.f90
whizard_LDADD = whizard-core/libwhizard_main.la
whizard_LDADD += ./libwhizard.la
whizard_LDADD += prebuilt/libwhizard_prebuilt.la
whizard_LDADD += $(LDFLAGS_LHAPDF)
whizard_LDADD += $(LDFLAGS_STDHEP)
whizard_LDADD += $(LDFLAGS_HEPMC)
whizard_LDADD += $(LDFLAGS_HOPPET)
whizard_LDADD += $(FASTJET_LIBS)
AM_FCFLAGS =
########################################################################
## Default Fortran compiler options
## Profiling
if FC_USE_PROFILING
AM_FCFLAGS += $(FCFLAGS_PROFILING)
endif
## OpenMP
if FC_USE_OPENMP
AM_FCFLAGS += $(FCFLAGS_OPENMP)
endif
########################################################################
## Non-standard cleanup tasks
## Remove backup files
maintainer-clean-local:
-rm -f *~
Index: trunk/m4/lhapdf.m4
===================================================================
--- trunk/m4/lhapdf.m4 (revision 5887)
+++ trunk/m4/lhapdf.m4 (revision 5888)
@@ -1,215 +1,221 @@
dnl lhapdf.m4 -- checks for LHAPDF library
dnl
### Determine paths to LHAPDF components
### Sets LDFLAGS_LHAPDF and the conditional LHAPDF_AVAILABLE if successful
### Also: LHAPDF_ROOT LHAPDF_VERSION LHAPDF_PDFSETS_PATH
AC_DEFUN([WO_PROG_LHAPDF],
[dnl
AC_REQUIRE([AC_PROG_FC])
AC_ARG_ENABLE([lhapdf],
[AS_HELP_STRING([--enable-lhapdf],
[enable LHAPDF for structure functions [[yes]]])],
[], [enable_lhapdf="yes"])
if test "$enable_lhapdf" = "yes"; then
if test -n "$LHAPDF_DIR"; then
wo_lhapdf_config_path=$LHAPDF_DIR/bin:$PATH
else
wo_lhapdf_config_path=$PATH
fi
AC_PATH_PROG([LHAPDF], [lhapdf], [no],
[$wo_lhapdf_config_path])
if test "$LHAPDF" != "no"; then
AC_CACHE_CHECK([the LHAPDF version],
[wo_cv_lhapdf_version],
[dnl,
wo_cv_lhapdf_version=[`$LHAPDF --version | $SED -e 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`]
])
LHAPDF_FULL_VERSION="wo_cv_lhapdf_version"
AC_SUBST([LHAPDF_FULL_VERSION])
AC_CACHE_CHECK([the major version],
[wo_cv_lhapdf_major_version],
[wo_cv_lhapdf_major_version=[`echo $wo_cv_lhapdf_version | $SED -e 's/\([0-9][0-9]*\)\..*/\1/'`]
])
LHAPDF_MAJOR_VERSION="$wo_cv_lhapdf_major_version"
AC_SUBST([LHAPDF_MAJOR_VERSION])
AC_PATH_PROG([LHAPDF_CONFIG], [lhapdf-config], [no],
[$wo_lhapdf_config_path])
AC_MSG_CHECKING([the LHAPDF pdfsets path])
LHAPDF_PDFSETS_PATH=`$LHAPDF_CONFIG --datadir`
AC_MSG_RESULT([$LHAPDF_PDFSETS_PATH])
else
AC_PATH_PROG([LHAPDF_CONFIG], [lhapdf-config], [no],
[$wo_lhapdf_config_path])
if test "$LHAPDF_CONFIG" != "no"; then
LHAPDF_ROOT=`$LHAPDF_CONFIG --prefix`
AC_CACHE_CHECK([the LHAPDF version],
[wo_cv_lhapdf_version],
[dnl,
wo_cv_lhapdf_version=[`$LHAPDF_CONFIG --version | $SED -e 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`]
])
LHAPDF_FULL_VERSION="wo_cv_lhapdf_version"
AC_SUBST([LHAPDF_FULL_VERSION])
AC_CACHE_CHECK([the major version],
[wo_cv_lhapdf_major_version],
[wo_cv_lhapdf_major_version=[`echo $wo_cv_lhapdf_version | $SED -e 's/\([0-9][0-9]*\)\..*/\1/'`]
])
LHAPDF_MAJOR_VERSION="$wo_cv_lhapdf_major_version"
AC_SUBST([LHAPDF_MAJOR_VERSION])
AC_MSG_CHECKING([the LHAPDF pdfsets path])
LHAPDF_PDFSETS_PATH=`$LHAPDF_CONFIG --pdfsets-path`
if test "$LHAPDF_FULL_VERSION" = "5.5.0"; then
LHAPDF_PDFSETS_PATH=`$LHAPDF_CONFIG --datarootdir`$LHAPDF_PDFSETS_PATH
fi
AC_MSG_RESULT([$LHAPDF_PDFSETS_PATH])
AC_MSG_CHECKING([the standard PDF sets])
if test -f "$LHAPDF_PDFSETS_PATH/cteq61.LHpdf" -a -f "$LHAPDF_PDFSETS_PATH/cteq5l.LHgrid" -a -f "$LHAPDF_PDFSETS_PATH/GSG961.LHgrid" -a -f "$LHAPDF_PDFSETS_PATH/cteq6ll.LHpdf"; then
AC_MSG_RESULT([ all standard PDF sets installed])
else
AC_MSG_RESULT([ not all standard PDF sets installed])
AC_MSG_NOTICE([error: *************************************************************])
AC_MSG_NOTICE([error: LHAPDF standard PDF sets not installed, please install these ])
AC_MSG_NOTICE([error: PDF sets: cteq61.LHpdf, cteq6ll.LHpdf, cteq5l.LHgrid, ])
AC_MSG_NOTICE([error: GSG961.LHgrid. ])
AC_MSG_NOTICE([error: *************************************************************])
enable_lhapdf="no"
AC_MSG_CHECKING([for LHAPDF])
AC_MSG_RESULT([(disabled)])
fi
else
enable_lhapdf="no"
fi
fi
else
AC_MSG_CHECKING([for LHAPDF])
AC_MSG_RESULT([(disabled)])
fi
AC_SUBST(LHAPDF_ROOT)
AC_SUBST(LHAPDF_FULL_VERSION)
AC_SUBST(LHAPDF_PDFSETS_PATH)
dnl LHAPDF requires the STD C++ library, when linking statically
if test "$enable_lhapdf" = "yes"; then
### Checking for static C++ libraries for the static version
### This is only necessary for MAC OS X and BSD-like OS
case $host in
*-darwin*)
case "$XCODE_VERSION" in
1.*|2.*|3.*)
wo_ldflags_stdcpp="-lstdc++-static" ;;
*)
wo_ldflags_stdcpp="-lstdc++" ;;
esac ;;
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
wo_ldflags_stdcpp="-lstdc++-static" ;;
*)
wo_ldflags_stdcpp="-lstdc++" ;;
esac
AC_MSG_CHECKING([for wo_ldflags_stdcpp: host system is $host_os: static flag])
AC_MSG_RESULT([$wo_ldflags_stdcpp])
fi
if test "$enable_lhapdf" = "yes"; then
if test "$LHAPDF_MAJOR_VERSION" = "5"; then
wo_lhapdf_libdir="-L$LHAPDF_ROOT/lib"
AC_LANG_PUSH([Fortran])
AC_CHECK_LIB([LHAPDF],[getxminm],[LDFLAGS_LHAPDF="$wo_lhapdf_libdir -lLHAPDF"],
[dnl
AC_MSG_NOTICE([warning: ********************************************************])
AC_MSG_NOTICE([warning: Either your LHAPDF version is too old (you need 5.3.0 or])
AC_MSG_NOTICE([warning: higher), or LHAPDF was compiled with a different FORTRAN])
AC_MSG_NOTICE([warning: compiler you and forgot to add the proper runtime to ])
AC_MSG_NOTICE([warning: LIBS / LD_LIBRARY_PATH. Disabling LHAPDF support... ])
AC_MSG_NOTICE([warning: ********************************************************])
enable_lhapdf=no
],[$wo_lhapdf_libdir])
AC_LANG_POP()
elif test "$LHAPDF_MAJOR_VERSION" = "6"; then
dnl now see if LHAPDF 6 is functional
ACX_CHECK_LHAPDF()
fi
fi
AC_SUBST(LDFLAGS_LHAPDF)
dnl Determine whether we need to stub photon-as-parton related bits of LHAPDF
+dnl Only necessary for LHAPDF 5 as all versions of LHAPDF 6 support this
if test "$enable_lhapdf" = "yes"; then
- AC_LANG_PUSH([Fortran])
- AC_CHECK_LIB([LHAPDF],[has_photon],[test],[dnl
- AC_MSG_NOTICE([warning: ********************************************************])
- AC_MSG_NOTICE([warning: Your LHAPDF version is not supported for PDF sets like ])
- AC_MSG_NOTICE([warning: MRTS2004QED which include the photon as a parton --- ])
- AC_MSG_NOTICE([warning: don't try to use those! ])
- AC_MSG_NOTICE([warning: ********************************************************])
- LHAPDF_HAS_PHOTON_DUMMY=true
- ],[$wo_lhapdf_libdir])
+ if test "$LHAPDF_MAJOR_VERSION" = "5"; then
+ AC_LANG_PUSH([Fortran])
+ AC_CHECK_LIB([LHAPDF],[has_photon],[test],[dnl
+ AC_MSG_NOTICE([warning: ********************************************************])
+ AC_MSG_NOTICE([warning: Your LHAPDF version is not supported for PDF sets like ])
+ AC_MSG_NOTICE([warning: MRTS2004QED which include the photon as a parton --- ])
+ AC_MSG_NOTICE([warning: don't try to use those! ])
+ AC_MSG_NOTICE([warning: ********************************************************])
+ LHAPDF_HAS_PHOTON_DUMMY=true
+ ],[$wo_lhapdf_libdir])
+ elif test "$LHAPDF_MAJOR_VERSION" = "6"; then
+ AC_MSG_CHECKING([for has_photon in -lLHAPDF])
+ AC_MSG_RESULT([yes])
+ fi
fi
if test "$enable_lhapdf" = "yes"; then
LHAPDF_AVAILABLE_FLAG=".true."
else
LHAPDF_AVAILABLE_FLAG=".false."
fi
AC_SUBST(LHAPDF_AVAILABLE_FLAG)
AM_CONDITIONAL([LHAPDF_AVAILABLE], [test "$enable_lhapdf" = "yes"])
AM_CONDITIONAL([LHAPDF6_AVAILABLE], [
test "$enable_lhapdf" = "yes" -a "$LHAPDF_MAJOR_VERSION" = "6"])
AM_CONDITIONAL([LHAPDF5_AVAILABLE], [
test "$enable_lhapdf" = "yes" -a "$LHAPDF_MAJOR_VERSION" = "5"])
AM_CONDITIONAL([LHAPDF_FULL_DUMMY], [test "$enable_lhapdf" = "no"])
AM_CONDITIONAL([LHAPDF_HAS_PHOTON_DUMMY], [test -n "$LHAPDF_HAS_PHOTON_DUMMY"])
AM_CONDITIONAL([LHAPDF_DUMMY], [
test -n "$LHAPDF_HAS_PHOTON_DUMMY" || \
test "$enable_lhapdf" = "no" dnl
])
])
AC_DEFUN([ACX_CHECK_LHAPDF],
[
save_CXXFLAGS="$CXXFLAGS"
save_LIBS="$LIBS"
CXXFLAGS="${CXXFLAGS} `${LHAPDF_CONFIG} --cxxflags`"
LDFLAGS="${LDFLAGS} `${LHAPDF_CONFIG} --ldflags`"
AC_MSG_CHECKING([if LHAPDF is functional (may take a while)])
AC_LANG_PUSH([C++])
AC_LINK_IFELSE(dnl
[AC_LANG_PROGRAM([[#include "LHAPDF/LHAPDF.h"]],
[[using namespace LHAPDF; LHAPDF::PDF* pdf = LHAPDF::mkPDF("CT10nlo", 0); delete pdf;]])],
[lhapdfok="yes"], [lhapdfok="no"])
AC_MSG_RESULT([$lhapdfok])
CXXFLAGS="$save_CXXFLAGS"
LDFLAGS="$save_LDFLAGS"
AC_LANG_POP()
AC_MSG_CHECKING(LHAPDF)
if test "${lhapdfok}" = "yes"; then
LHAPDF_CXXFLAGS="`${LHAPDF_CONFIG} --cxxflags`"
LDFLAGS_LHAPDF="`${LHAPDF_CONFIG} --ldflags`"
AC_MSG_RESULT(yes)
$1
else
AC_MSG_RESULT(no)
$2
fi
AC_SUBST([LHAPDF_CXXFLAGS])
AC_SUBST([LDFLAGS_LHAPDF])
])

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 8:41 PM (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3806123
Default Alt Text
(20 KB)

Event Timeline