lhapdf

view configure.ac @ 1110:2ba52dbf2312

Add release instructions for new sets
author Andy Buckley <andy@insectnation.org>
date Tue, 17 Oct 2017 17:12:04 +0100
parents f36029e297d2
children
line source
1 ## Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.61)
4 AC_INIT([LHAPDF],[6.2.1],[lhapdf@projects.hepforge.org],[LHAPDF])
5 if test "$prefix" = "$PWD"; then
6 AC_MSG_ERROR([Installation into the build directory is not supported: use a different --prefix argument])
7 fi
8 AC_CONFIG_AUX_DIR([config])
9 AC_CONFIG_MACRO_DIR([m4])
10 AM_INIT_AUTOMAKE()
11 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
14 ## Library version flags (at least update the version comment with each new release version)
15 AC_DEFINE_UNQUOTED(LHAPDF_VERSION, "$PACKAGE_VERSION", "LHAPDF version string")
16 # TODO: improve this sed'ing so that it'll work with version digits > 9
17 #PACKAGE_VERSION_CODE=[`echo $PACKAGE_VERSION | sed -e 's/\./0/g' -e 's/\([0-9]\+\).*/\1/'`] # sed \+ doesn't work on OS X!
18 PACKAGE_VERSION_CODE=[`echo $PACKAGE_VERSION | sed -e 's/\./0/g' -e 's/\([0-9]*\).*/\1/'`]
19 PACKAGE_MAJOR_VERSION=[`echo $PACKAGE_VERSION | sed -e 's/^\(.\..\).*/\1/'`]
20 AC_DEFINE_UNQUOTED(LHAPDF_VERSION_CODE, $PACKAGE_VERSION_CODE, "LHAPDF version as an int")
23 ## Mac OS X compatibility
24 AC_CHECK_TOOL(SWVERS, sw_vers)
25 if test x$SWVERS != x; then
26 PROD_NAME=$($SWVERS -productName | cut -f 2 -d:)
27 fi
28 AM_CONDITIONAL(WITH_OSX, [test "$PROD_NAME" == "Mac OS X"])
29 if test "$PROD_NAME" == "Mac OS X"; then
30 MACOSX_DEPLOYMENT_TARGET=$($SWVERS -productVersion | cut -f 1,2 -d.)
31 AC_MSG_NOTICE([MACOSX_DEPLOYMENT_TARGET = $MACOSX_DEPLOYMENT_TARGET])
32 AM_CXXFLAGS="$AM_CXXFLAGS -Dunix"
33 AM_CXXFLAGS="$AM_CXXFLAGS -flat_namespace"
34 fi
37 ## Checks and config headers
38 AC_LANG(C++)
39 AC_CONFIG_SRCDIR([src/GridPDF.cc])
40 AC_CONFIG_HEADERS([config/config.h include/LHAPDF/Version.h])
42 ## Set default C++ optimisation level to -O3 and drop the -g debug flag
43 if test -z $CXXFLAGS; then
44 CXXFLAGS='-O3'
45 fi
47 ## Require C++11
48 AC_PROG_CXX
49 AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
51 ## Substitute compiler flags for the lhapdf-config script
52 LHAPDF_CXX="$CXX"
53 AC_SUBST(LHAPDF_CXX)
54 LHAPDF_CXXFLAGS="$CXXFLAGS"
55 AC_SUBST(LHAPDF_CXXFLAGS)
57 AC_PROG_CC
58 AC_PROG_INSTALL
59 AC_PROG_LN_S
60 AC_PROG_LIBTOOL
63 ## Enable LHAGLUE compatibility fns for Fortran and the old C++ interface
64 AC_ARG_ENABLE([lhaglue],
65 [AC_HELP_STRING(--disable-lhaglue, [build without LHAPDF5 compatibility routines])],
66 [], [enable_lhaglue=yes])
67 AC_ARG_ENABLE([lhaglue-cxx],
68 [AC_HELP_STRING(--disable-lhaglue-cxx, [build without LHAPDF5 C++ compatibility routines])],
69 [], [enable_lhaglue_cxx=yes])
70 if test x$enable_lhaglue == xyes; then
71 AC_MSG_NOTICE(Building LHAGLUE Fortran wrappers)
72 if test x$enable_lhaglue_cxx == xyes; then
73 AC_MSG_NOTICE(Building LHAGLUE C++ wrappers)
74 else
75 AC_MSG_NOTICE(Not building LHAGLUE C++ wrappers)
76 fi
77 else
78 AC_MSG_NOTICE(Not building LHAGLUE wrappers)
79 fi
80 AM_CONDITIONAL(ENABLE_LHAGLUE, [test x$enable_lhaglue == xyes])
81 if test x$enable_lhaglue == xyes; then flag=1; else flag=0; fi
82 AC_DEFINE_UNQUOTED(LHAPDF_PDFLIB, $flag, "Whether PDFLIB Fortran compatibility is available")
83 AM_CONDITIONAL(ENABLE_LHAGLUE_CXX, [test x$enable_lhaglue_cxx == xyes])
84 if test x$enable_lhaglue_cxx == xyes; then flag=1; else flag=0; fi
85 AC_DEFINE_UNQUOTED(LHAPDF_LHA5CXX, $flag, "Whether LHAPDF5 C++ compatibility is available")
88 ## Find pdflatex if possible
89 AC_PATH_PROG(PDFLATEX, pdflatex)
90 AM_CONDITIONAL(WITH_PDFLATEX, [test x$PDFLATEX != x])
93 ## Find Doxygen if possible
94 AC_PATH_PROG(DOXYGEN, doxygen)
95 AM_CONDITIONAL(WITH_DOXYGEN, [test x$DOXYGEN != x])
98 ## Find Python and Cython if possible
99 AC_ARG_ENABLE([python],
100 [AC_HELP_STRING(--disable-python, [disable the build of the Python interface (default=enabled)])],
101 [], [enable_python=yes])
102 if test x$enable_python == xyes; then
103 AC_PATH_PROG(PYTHON, python)
104 if test x$PYTHON != x; then
105 PYTHON_VERSION=`$PYTHON -c "import sys; print('.'.join(map(str, sys.version_info@<:@:2@:>@)))"`
106 AC_SUBST(PYTHON_VERSION)
107 PYTHON_PATH=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(prefix='$prefix', plat_specific=True))"`
108 AC_SUBST(PYTHON_PATH)
109 fi
110 AM_CHECK_CYTHON([0.19], [:], [:])
111 if test x$CYTHON_FOUND = xyes; then
112 AC_MSG_NOTICE([Cython >= 0.19 found: Python extension source can be rebuilt (for developers)])
113 fi
114 fi
115 AM_CONDITIONAL(WITH_PYTHON, [test x$PYTHON != x])
116 AM_CONDITIONAL(WITH_CYTHON, [test x$CYTHON_FOUND = xyes])
119 dnl ## Build Octave interface if possible
120 dnl AC_ARG_ENABLE([octave],
121 dnl [AC_HELP_STRING(--disable-octave, [don't try to make Octave interface])],
122 dnl [], [enable_octave=yes])
123 dnl if test x$enable_octave == xyes; then
124 dnl AC_PATH_PROG(OCTAVE, octave)
125 dnl AC_PATH_PROG(MKOCTFILE, mkoctfile)
126 dnl fi
127 dnl AM_CONDITIONAL(WITH_OCTAVE, [test x$OCTAVE != x && test x$MKOCTFILE != x])
130 ## Set base compiler flags
131 AC_CEDAR_CHECKCXXFLAG([-pedantic], [AM_CXXFLAGS="$AM_CXXFLAGS -pedantic "])
132 AC_CEDAR_CHECKCXXFLAG([-Wall], [AM_CXXFLAGS="$AM_CXXFLAGS -Wall "])
133 AC_CEDAR_CHECKCXXFLAG([-Wno-long-long], [AM_CXXFLAGS="$AM_CXXFLAGS -Wno-long-long "])
134 AC_CEDAR_CHECKCXXFLAG([-Qunused-arguments], [AM_CPPFLAGS="$AM_CPPFLAGS -Qunused-arguments "])
137 ## Include $prefix in the compiler flags for the rest of the configure run
138 if test x$prefix != xNONE; then
139 CPPFLAGS="$CPPFLAGS -I$prefix/include"
140 LDFLAGS="$LDFLAGS -L$prefix/lib"
141 fi
144 ## Export base compiler flags
145 AC_SUBST(AM_CPPFLAGS)
146 AC_SUBST(AM_CXXFLAGS)
147 AC_SUBST(AM_LDFLAGS)
150 ## Output
151 AC_CONFIG_FILES([Makefile])
152 AC_CONFIG_FILES([src/Makefile])
153 AC_CONFIG_FILES([src/yamlcpp/Makefile])
154 AC_CONFIG_FILES([include/Makefile include/LHAPDF/Makefile])
155 AC_CONFIG_FILES([bin/Makefile])
156 AC_CONFIG_FILES([bin/lhapdf bin/lhapdf-config])
157 AC_CONFIG_FILES([examples/Makefile])
158 AC_CONFIG_FILES([tests/Makefile])
159 AC_CONFIG_FILES([doc/Makefile doc/Doxyfile])
160 AC_CONFIG_FILES([lhapdf.pc])
161 AC_CONFIG_FILES([wrappers/Makefile])
162 AC_CONFIG_FILES([wrappers/python/Makefile wrappers/python/setup.py])
163 dnl AC_CONFIG_FILES([wrappers/octave/Makefile])
164 AC_OUTPUT
166 ## Message about getting PDF sets
167 pkgdatadir=`eval "echo $datarootdir/$PACKAGE_TARNAME"`
168 echo
169 echo "****************************************************************"
170 echo "IMPORTANT INFORMATION ABOUT PDF SETS"
171 echo
172 echo "LHAPDF no longer bundles PDF set data in the package tarball."
173 echo "The sets are instead all stored online at"
174 echo " http://www.hepforge.org/archive/lhapdf/pdfsets/${PACKAGE_MAJOR_VERSION}/"
175 echo "and you should install those that you wish to use into"
176 echo " $pkgdatadir"
177 echo
178 echo "The downloadable PDF sets are packaged as tarballs, which"
179 echo "must be expanded to be used. Here is an example of how to"
180 echo "retrieve and install a PDF set from the command line:"
181 echo
182 echo " wget http://www.hepforge.org/archive/lhapdf/pdfsets/${PACKAGE_MAJOR_VERSION}/CT10nlo.tar.gz -O- | tar xz -C $pkgdatadir"
183 echo
184 echo "****************************************************************"
185 echo