Commit 665b5485 authored by Adam Mercer's avatar Adam Mercer
Browse files

check for header/library mismatch

this adds checks to the sub-libraries, and lalapps, configure scripts
that ensure that the headers and libraries, of the lal* packages, that
are used for building are consistent
Original: be4bb2cd22b2c6ced8f5b6eaafe997a187e2d6f2
parent 18f4a60d
# lalsuite_build.m4 - top level build macros
#
# serial 4
# serial 5
AC_DEFUN([LALSUITE_ENABLE_MODULE],[
AM_CONDITIONAL([$1],[test x$$2 = xtrue])
......@@ -9,49 +9,85 @@ eval $1_ENABLE_VAL="`eval test "$$2" = "true" && echo "ENABLED" || echo "DISABLE
AC_DEFUN([LALSUITE_CHECK_LIB],[
define([lowercase],translit($1, "A-Z", "a-z"))
PKG_CHECK_MODULES([$1],[lowercase >= $2],[lowercase="true"],[lowercase="false"])
define([uppercase],translit($1, "a-z", "A-Z"))
PKG_CHECK_MODULES(uppercase,[lowercase >= $2],[lowercase="true"],[lowercase="false"])
if test "$lowercase" = "true"; then
CPPFLAGS="$CPPFLAGS $$1_CFLAGS"
LIBS="$LIBS $$1_LIBS"
CPPFLAGS="$CPPFLAGS $[]uppercase[]_CFLAGS"
LIBS="$LIBS $[]uppercase[]_LIBS"
if test "$LALSUITE_BUILD" = "true"; then
AC_DEFINE([HAVE_LIB$1],[1],[Define to 1 if you have the $1 library])
AC_DEFINE([HAVE_LIB[]uppercase[]],[1],[Define to 1 if you have the $1 library])
lowercase="true"
else
AC_CHECK_LIB(lowercase,[$3],[lowercase="true"],[AC_MSG_ERROR([could not find the $1 library])])
AC_CHECK_HEADERS([$4],,[AC_MSG_ERROR([could not find the $4 header])])
AC_DEFINE([HAVE_LIB$1],[1],[Define to 1 if you have the $1 library])
if test "$1" != "LALSupport"; then
LALSUITE_HEADER_LIBRARY_MISMATCH_CHECK([$1])
fi
AC_DEFINE([HAVE_LIB[]uppercase[]],[1],[Define to 1 if you have the $1 library])
fi
else
AC_MSG_ERROR([could not find the $1 library])
fi
LALSUITE_ENABLE_MODULE([$1],[lowercase])
LALSUITE_ENABLE_MODULE(uppercase,lowercase)
])
AC_DEFUN([LALSUITE_CHECK_OPT_LIB],[
define([lowercase],translit($1, "A-Z", "a-z"))
define([uppercase],translit($1, "a-z", "A-Z"))
if test "$lowercase" = "true"; then
PKG_CHECK_MODULES([$1],[lowercase >= $2],[lowercase="true"],[lowercase="false"])
PKG_CHECK_MODULES(uppercase,[lowercase >= $2],[lowercase="true"],[lowercase="false"])
if test "$lowercase" = "true"; then
if test "$LALSUITE_BUILD" = "true"; then
AC_DEFINE([HAVE_LIB$1],[1],[Define to 1 if you have the $1 library])
AC_DEFINE([HAVE_LIB[]uppercase[]],[1],[Define to 1 if you have the $1 library])
lowercase="true"
CPPFLAGS="$CPPFLAGS $$1_CFLAGS"
LIBS="$LIBS $$1_LIBS"
CPPFLAGS="$CPPFLAGS $[]uppercase[]_CFLAGS"
LIBS="$LIBS $[]uppercase[]_LIBS"
else
CPPFLAGS="$CPPFLAGS $$1_CFLAGS"
LIBS="$LIBS $$1_LIBS"
CPPFLAGS="$CPPFLAGS $[]uppercase[]_CFLAGS"
LIBS="$LIBS $[]uppercase[]_LIBS"
AC_CHECK_LIB(lowercase,[$3],[lowercase="true"],[lowercase=false
AC_MSG_WARN([could not find the $1 library])])
if test "$lowercase" = true; then
AC_CHECK_HEADERS([$4],,[lowercase=false])
if test "$lowercase" = true; then
AC_DEFINE([HAVE_LIB$1],[1],[Define to 1 if you have the $1 library])
if test "$1" != "LALSupport"; then
LALSUITE_HEADER_LIBRARY_MISMATCH_CHECK([$1])
fi
if test "$lowercase" = true; then
AC_DEFINE([HAVE_LIB[]uppercase[]],[1],[Define to 1 if you have the $1 library])
fi
fi
fi
fi
fi
fi
LALSUITE_ENABLE_MODULE([$1],[lowercase])
LALSUITE_ENABLE_MODULE(uppercase,lowercase)
])
AC_DEFUN([LALSUITE_HEADER_LIBRARY_MISMATCH_CHECK],[
AC_MSG_CHECKING([whether $1 headers match the library])
lib_structure=`echo $1 | sed 's/LAL/lal/'`VCSInfo
header_structure=`echo $1 | sed 's/LAL/lal/'`HeaderVCSInfo
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <string.h>
#include <stdlib.h>
#include <lal/$1VCSInfo.h>
int main(void) { exit(XLALVCSInfoCompare(&$lib_structure, &$header_structure) ? 1 : 0); }
]])],
[
AC_MSG_RESULT(yes)
],
[
AC_MSG_RESULT(no)
AC_MSG_ERROR([Your $1 headers do not match your
library. Check config.log for details.
])
],
[
AC_MSG_WARN([cross compiling: not checking])
]
)
])
AC_DEFUN([LALSUITE_ENABLE_NIGHTLY],
......
......@@ -347,14 +347,14 @@ fi
# check for lal libararies and headers
LALSUITE_CHECK_LIB([LAL],[6.4.1.2],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSUPPORT],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_OPT_LIB([LALFRAME],[1.0.0],[LALFrOpen],[lal/LALFrameL.h])
LALSUITE_CHECK_OPT_LIB([LALMETAIO],[1.0.0],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
LALSUITE_CHECK_OPT_LIB([LALBURST],[1.0.0],[XLALEPSearch],[lal/EPSearch.h])
LALSUITE_CHECK_OPT_LIB([LALINSPIRAL],[1.0.0],[LALInspiralParameterCalc],[lal/LALInspiral.h])
LALSUITE_CHECK_OPT_LIB([LALPULSAR],[1.0.0],[XLALComputeFaFb],[lal/ComputeFstat.h])
LALSUITE_CHECK_OPT_LIB([LALSTOCHASTIC],[1.1.0],[LALStochasticOptimalFilter],[lal/StochasticCrossCorrelation.h])
LALSUITE_CHECK_OPT_LIB([LALXML],[1.0.0],[XLALXMLFilePrintElements],[lal/LALXML.h])
LALSUITE_CHECK_LIB([LALSupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_OPT_LIB([LALFrame],[1.0.0.2],[LALFrOpen],[lal/LALFrameL.h])
LALSUITE_CHECK_OPT_LIB([LALMetaIO],[1.0.0.2],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
LALSUITE_CHECK_OPT_LIB([LALBurst],[1.0.0.2],[XLALEPSearch],[lal/EPSearch.h])
LALSUITE_CHECK_OPT_LIB([LALInspiral],[1.0.0.2],[LALInspiralParameterCalc],[lal/LALInspiral.h])
LALSUITE_CHECK_OPT_LIB([LALPulsar],[1.0.0.2],[XLALComputeFaFb],[lal/ComputeFstat.h])
LALSUITE_CHECK_OPT_LIB([LALStochastic],[1.1.0.2],[LALStochasticOptimalFilter],[lal/StochasticCrossCorrelation.h])
LALSUITE_CHECK_OPT_LIB([LALXML],[1.0.0.2],[XLALXMLFilePrintElements],[lal/LALXML.h])
# back to c mode
if test "${boinc}" = "true" ; then
......
......@@ -114,10 +114,10 @@ AC_CHECK_LIB([metaio],[MetaioOpen],,[AC_MSG_ERROR([could not find the metaio lib
# check for libmetaio headers
AC_CHECK_HEADERS([metaio.h],,[AC_MSG_ERROR([could not find the metaio.h header])])
# check for lal
LALSUITE_CHECK_LIB([LAL],[lal],[6.4.0],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSUPPORT],[lalsupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_LIB([LALMETAIO],[lalmetaio],[1.0.0],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
# check for lal libraries and headers
LALSUITE_CHECK_LIB([LAL],[6.4.1.2],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_LIB([LALMetaIO],[1.0.0.2],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
# add gcc specific flags
if test "$GCC" = yes; then
......
......@@ -112,11 +112,9 @@ AC_CHECK_LIB([Frame],[FrLibIni],,[AC_MSG_ERROR([could not find the frame library
# check for frame library headers
AC_CHECK_HEADERS([FrameL.h],,[AC_MSG_ERROR([could not find the FrameL.h header])])
# check for lal
LALSUITE_CHECK_LIB([LAL],[lal],[6.4.0],[LALVersion],[lal/LALStdio.h])
# check for lalsupport, needed for test suite
LALSUITE_CHECK_LIB([LALSUPPORT],[lalsupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
# check for lal libraries and headers
LALSUITE_CHECK_LIB([LAL],[6.4.1.2],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
# add gcc specific flags
if test "$GCC" = yes; then
......
......@@ -117,11 +117,11 @@ AC_CHECK_LIB([metaio],[MetaioOpen],,[AC_MSG_ERROR([could not find the metaio lib
# check for libmetaio headers
AC_CHECK_HEADERS([metaio.h],,[AC_MSG_ERROR([could not find the metaio.h header])])
# check for lal
LALSUITE_CHECK_LIB([LAL],[lal],[6.4.0],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSUPPORT],[lalsupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_LIB([LALMETAIO],[lalmetaio],[1.0.0],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
LALSUITE_CHECK_OPT_LIB([LALFRAME],[lalframe],[1.0.0],[LALFrOpen],[lal/LALFrameL.h])
# check for lal libraries and headers
LALSUITE_CHECK_LIB([LAL],[6.4.1.2],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_LIB([LALMetaIO],[1.0.0.2],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
LALSUITE_CHECK_OPT_LIB([LALFrame],[1.0.0.2],[LALFrOpen],[lal/LALFrameL.h])
# add gcc specific flags
if test "$GCC" = yes; then
......
......@@ -103,11 +103,9 @@ AC_CHECK_LIB([metaio],[MetaioOpen],,[AC_MSG_ERROR([could not find the metaio lib
# check for libmetaio headers
AC_CHECK_HEADERS([metaio.h],,[AC_MSG_ERROR([could not find the metaio.h header])])
# check for lal
LALSUITE_CHECK_LIB([LAL],[lal],[6.4.0],[LALVersion],[lal/LALStdio.h])
# check for lalsupport, needed for test suite
LALSUITE_CHECK_LIB([LALSUPPORT],[lalsupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
# check for lal libraries and headers
LALSUITE_CHECK_LIB([LAL],[6.4.1.2],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
# add gcc specific flags
if test "$GCC" = yes; then
......
......@@ -118,8 +118,8 @@ if test "${boinc}" = "true" ; then
AC_LANG_PUSH([C++])
fi
# check for lal
LALSUITE_CHECK_LIB([LAL],[lal],[6.4.0],[LALVersion],[lal/LALStdio.h])
# check for lal libraries and headers
LALSUITE_CHECK_LIB([LAL],[6.4.1.2],[LALVersion],[lal/LALStdio.h])
# check that lal has been buil with boinc support, for boinc build
if test "${boinc}" = "true" ; then
......@@ -127,7 +127,7 @@ if test "${boinc}" = "true" ; then
fi
# check for lalsupport, needed for test suite
LALSUITE_CHECK_LIB([LALSUPPORT],[lalsupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_LIB([LALSupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
# back to c mode
if test "${boinc}" = "true" ; then
......
......@@ -104,10 +104,10 @@ AC_CHECK_LIB([metaio],[MetaioOpen],,[AC_MSG_ERROR([could not find the metaio lib
# check for libmetaio headers
AC_CHECK_HEADERS([metaio.h],,[AC_MSG_ERROR([could not find the metaio.h header])])
# check for lal
LALSUITE_CHECK_LIB([LAL],[lal],[6.4.0],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSUPPORT],[lalsupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_LIB([LALMETAIO],[lalmetaio],[1.0.0],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
# check for lal libraries and headers
LALSUITE_CHECK_LIB([LAL],[6.4.1.2],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_LIB([LALMetaIO],[1.0.0.2],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
# add gcc specific flags
if test "$GCC" = yes; then
......
......@@ -114,14 +114,10 @@ AC_CHECK_LIB([gsl],[gsl_strerror],,[AC_MSG_ERROR([could not find the gsl library
# check for gsl headers
AC_CHECK_HEADERS([gsl/gsl_errno.h],,[AC_MSG_ERROR([could not find the gsl/gsl_errno.h header])])
# check for lal
LALSUITE_CHECK_LIB([LAL],[lal],[6.4.0],[LALVersion],[lal/LALStdio.h])
# check for lalsupport, needed for test suite
LALSUITE_CHECK_LIB([LALSUPPORT],[lalsupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
# check for lalpulsar
LALSUITE_CHECK_LIB([LALPULSAR],[lalpulsar],[1.0.0],[XLALComputeFaFb],[lal/ComputeFstat.h])
# check for lal libraries and headers
LALSUITE_CHECK_LIB([LAL],[6.4.1.2],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSupport],[6.4.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_LIB([LALPulsar],[1.0.0.2],[XLALComputeFaFb],[lal/ComputeFstat.h])
# add gcc specific flags
if test "$GCC" = yes; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment