mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2024-11-10 00:45:36 +00:00
latan-config utility and HDF5 is now mandatory
This commit is contained in:
parent
b4ad61406f
commit
8b9494029c
@ -1,3 +1,5 @@
|
||||
SUBDIRS = lib utils physics examples
|
||||
|
||||
bin_SCRIPTS=latan-config
|
||||
|
||||
ACLOCAL_AMFLAGS = -I .buildutils/m4
|
||||
|
45
configure.ac
45
configure.ac
@ -53,9 +53,6 @@ AC_ARG_WITH([latcore],
|
||||
[use this option for a non-standard install prefix of the LatCore library])],
|
||||
[AM_CXXFLAGS="$AM_CXXFLAGS -I$with_latcore/include"]
|
||||
[AM_LDFLAGS="$AM_LDFLAGS -L$with_latcore/lib"])
|
||||
CFLAGS="$AM_CFLAGS $CFLAGS"
|
||||
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
|
||||
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
|
||||
|
||||
# Get compilers informations
|
||||
AX_COMPILER_VENDOR
|
||||
@ -78,6 +75,10 @@ AC_DEFINE_UNQUOTED([GXX_VERSION],["$GXX_VERSION"],
|
||||
[version of g++ that will compile the code])
|
||||
|
||||
# Checks for libraries.
|
||||
CXXFLAGS_CPY=$CXXFLAGS
|
||||
LDFLAGS_CPY=$LDFLAGS
|
||||
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
|
||||
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
|
||||
AC_CHECK_LIB([m],[cos],[],[AC_MSG_ERROR([libm library not found])])
|
||||
AC_CHECK_LIB([gslcblas],[cblas_dgemm],[],
|
||||
[AC_MSG_ERROR([GSL CBLAS library not found])])
|
||||
@ -90,12 +91,8 @@ AC_CHECK_LIB([nlopt_cxx],[nlopt_create],
|
||||
[LIBS="$LIBS -lnlopt_cxx"],[])
|
||||
AM_CONDITIONAL([HAVE_NLOPT], [test x$have_nlopt = xtrue])
|
||||
AC_CHECK_LIB([hdf5_cpp],[H5Fopen],
|
||||
[AC_DEFINE([HAVE_HDF5],
|
||||
[1],
|
||||
[Define to 1 if you have the `HDF5' library (-lhdf5_cpp).])]
|
||||
[have_hdf5=true]
|
||||
[LIBS="$LIBS -lhdf5_cpp -lhdf5"],[],[-lhdf5])
|
||||
AM_CONDITIONAL([HAVE_HDF5], [test x$have_hdf5 = xtrue])
|
||||
[LIBS="$LIBS -lhdf5_cpp -lhdf5"],
|
||||
[AC_MSG_ERROR([HDF5 library not found])], [-lhdf5])
|
||||
SAVED_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -lMinuit2"
|
||||
AC_MSG_CHECKING([for ROOT::Minuit2::BasicMinimumError in -lMinuit2]);
|
||||
@ -123,24 +120,44 @@ AC_LINK_IFELSE(
|
||||
[AC_MSG_RESULT([no])]
|
||||
[AC_MSG_ERROR([LatCore library not found])])
|
||||
LDFLAGS=$SAVED_LDFLAGS
|
||||
CXXFLAGS=$CXXFLAGS_CPY
|
||||
LDFLAGS=$LDFLAGS_CPY
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
cwd=`pwd -P`; cd ${srcdir}; abs_srcdir=`pwd -P`; cd ${cwd}
|
||||
LATAN_CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
|
||||
LATAN_LDFLAGS="$AM_LDFLAGS $LDFLAGS"
|
||||
LATAN_LIBS=$LIBS
|
||||
LATAN_SHORT_SHA=`git rev-parse --short HEAD`
|
||||
LATAN_SHA=`git rev-parse HEAD`
|
||||
LATAN_BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||
AM_CXXFLAGS="-I${abs_srcdir}/lib $AM_CXXFLAGS"
|
||||
AM_CFLAGS="-I${abs_srcdir}/lib $AM_CFLAGS"
|
||||
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
|
||||
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
|
||||
AC_SUBST([LIBS])
|
||||
AC_SUBST([AM_CFLAGS])
|
||||
AC_SUBST([AM_CXXFLAGS])
|
||||
AC_SUBST([AM_LDFLAGS])
|
||||
AC_SUBST([LATAN_CXXFLAGS])
|
||||
AC_SUBST([LATAN_LDFLAGS])
|
||||
AC_SUBST([LATAN_LIBS])
|
||||
AC_SUBST([LATAN_SHA])
|
||||
AC_SUBST([LATAN_BRANCH])
|
||||
|
||||
AC_CONFIG_FILES([Makefile lib/Makefile utils/Makefile physics/Makefile
|
||||
examples/Makefile])
|
||||
AC_CONFIG_FILES([latan-config], [chmod +x latan-config])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_CONFIG_FILES([lib/Makefile])
|
||||
AC_CONFIG_FILES([utils/Makefile])
|
||||
AC_CONFIG_FILES([physics/Makefile])
|
||||
AC_CONFIG_FILES([examples/Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
echo "*********************************************"
|
||||
echo "* ${PACKAGE_NAME} v${VERSION}" build options
|
||||
echo "*********************************************"
|
||||
echo "* C++ compiler : $CXX"
|
||||
echo "* HDF5 support : `test x$HAVE_HDF5_TRUE = 'x' && echo yes \
|
||||
|| echo no`"
|
||||
echo "* Minuit minimizers: `test x$HAVE_MINUIT_TRUE = 'x' && echo yes \
|
||||
|| echo no`"
|
||||
echo "* NLopt minimizers : `test x$HAVE_NLOPT_TRUE = 'x' && echo yes \
|
||||
|
@ -20,9 +20,7 @@
|
||||
#include <LatAnalyze/Io.hpp>
|
||||
#include <LatAnalyze/includes.hpp>
|
||||
#include <LatAnalyze/AsciiFile.hpp>
|
||||
#ifdef HAVE_HDF5
|
||||
#include <LatAnalyze/Hdf5File.hpp>
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace Latan;
|
||||
@ -42,12 +40,10 @@ unique_ptr<File> Io::open(const std::string &fileName, const unsigned int mode)
|
||||
{
|
||||
return unique_ptr<File>(new AsciiFile(fileName, mode));
|
||||
}
|
||||
#ifdef HAVE_HDF5
|
||||
else if (ext == "h5")
|
||||
{
|
||||
return unique_ptr<File>(new Hdf5File(fileName, mode));
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
LATAN_ERROR(Io, "unknown file extension '" + ext + "'");
|
||||
|
@ -35,6 +35,7 @@ libLatAnalyze_la_SOURCES = \
|
||||
GslHybridRootFinder.cpp\
|
||||
GslMinimizer.cpp \
|
||||
GslQagsIntegrator.cpp \
|
||||
Hdf5File.cpp \
|
||||
Histogram.cpp \
|
||||
includes.hpp \
|
||||
Io.cpp \
|
||||
@ -69,6 +70,7 @@ libLatAnalyze_la_HEADERS = \
|
||||
GslHybridRootFinder.hpp\
|
||||
GslMinimizer.hpp \
|
||||
GslQagsIntegrator.hpp \
|
||||
Hdf5File.hpp \
|
||||
Histogram.hpp \
|
||||
Integrator.hpp \
|
||||
Io.hpp \
|
||||
@ -87,10 +89,6 @@ libLatAnalyze_la_HEADERS = \
|
||||
StatArray.hpp \
|
||||
XYSampleData.hpp \
|
||||
XYStatData.hpp
|
||||
if HAVE_HDF5
|
||||
libLatAnalyze_la_SOURCES += Hdf5File.cpp
|
||||
libLatAnalyze_la_HEADERS += Hdf5File.hpp
|
||||
endif
|
||||
if HAVE_MINUIT
|
||||
libLatAnalyze_la_SOURCES += MinuitMinimizer.cpp
|
||||
libLatAnalyze_la_HEADERS += MinuitMinimizer.hpp
|
||||
|
@ -25,12 +25,7 @@
|
||||
#ifndef DEF_NSAMPLE
|
||||
#define DEF_NSAMPLE "100"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_HDF5
|
||||
#define DEF_FMT "h5"
|
||||
#else
|
||||
#define DEF_FMT "sample"
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace Latan;
|
||||
|
Loading…
Reference in New Issue
Block a user