From c206a99fc4692ef9ea48a11bbb9de8a7dd44a7f8 Mon Sep 17 00:00:00 2001 From: Thomas Danckaert Date: Fri, 17 Jun 2016 07:55:58 +0200 Subject: [PATCH 1/2] Build only GCTP. --- Makefile.am | 2 +- configure.ac | 430 +---------------------------------------------------------- 2 files changed, 2 insertions(+), 430 deletions(-) diff --git a/Makefile.am b/Makefile.am index 01ed024..335cf1a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,5 +11,5 @@ else INCLUDE= endif -SUBDIRS=gctp src $(INCLUDE) samples $(TESTDRIVERS) +SUBDIRS=gctp diff --git a/configure.ac b/configure.ac index cfa9d4e..2b531e4 100644 --- a/configure.ac +++ b/configure.ac @@ -22,80 +22,6 @@ AC_PREFIX_DEFAULT([`pwd`/hdfeos5]) # Check for the math library that HDF5 needs AC_CHECK_LIB([m], [ceil]) -# Check whether zlib is enabled. -# HDF-EOS5 doesn't use zlib, but HDF5 might. If HDF5 does, it needs -# to be given to the linker or there will be undefined symbols in HDF5. -# Using h5cc avoids the need to specify zlib at configure time. -AC_ARG_WITH([zlib], - [AC_HELP_STRING([--with-zlib=DIR], - [Specify path to external zlib library. - Linker must be able to find zlib if HDF5 - was built with zlib. - [default=yes]])],, - withval=yes) - -case $withval in - yes) - HAVE_ZLIB="yes" - AC_CHECK_HEADERS([zlib.h],) - AC_CHECK_LIB([z], [compress2],, [unset HAVE_ZLIB]) - - if test -z "$HAVE_ZLIB"; then - AC_MSG_ERROR([couldn't find zlib library]) - fi - ;; - no) - HAVE_ZLIB="no" - AC_MSG_CHECKING([for GNU zlib]) - AC_MSG_RESULT([suppressed]) - ;; - *) - HAVE_ZLIB="yes" - case "$withval" in - *,*) - zlib_inc="`echo $withval |cut -f1 -d,`" - zlib_lib="`echo $withval |cut -f2 -d, -s`" - ;; - *) - if test -n "$withval"; then - zlib_inc="$withval/include" - zlib_lib="$withval/lib" - fi - ;; - esac - - dnl Trying to include -I/usr/include and -L/usr/lib is redundant and - dnl can mess some compilers up. - if test "X$zlib_inc" = "X/usr/include"; then - zlib_inc="" - fi - if test "X$zlib_lib" = "X/usr/lib"; then - zlib_lib="" - fi - - saved_CPPFLAGS="$CPPFLAGS" - saved_LDFLAGS="$LDFLAGS" - - if test -n "$zlib_inc"; then - CPPFLAGS="$CPPFLAGS -I$zlib_inc" - fi - - AC_CHECK_HEADERS([zlib.h], , - [CPPFLAGS="$saved_CPPFLAGS"]) - - if test -n "$zlib_lib"; then - LDFLAGS="$LDFLAGS -L$zlib_lib" - fi - - AC_CHECK_LIB([z], [compress2],, - [LDFLAGS="$saved_LDFLAGS"; unset HAVE_ZLIB]) - - if test -z "$HAVE_ZLIB"; then - AC_MSG_ERROR([couldn't find zlib library]) - fi - ;; -esac - dnl -------------------------------------------------- dnl Check if -Df2cFortran is specified dnl Running only the preprocessor may not be a good idea @@ -172,356 +98,6 @@ if test ${he5_cv_f2cFortran_defined} = "yes"; then fi fi -# Check whether szlib (szip) is enabled. -# HDF-EOS5 doesn't use szlib, but HDF5 might. If HDF5 does, it needs -# to be given to the linker or there will be undefined symbols in HDF5. -# Using h5cc should avoid the need to specify szlib at configure time. -AC_ARG_WITH([szlib], - [AC_HELP_STRING([--with-szlib=DIR], - [Use szlib library for external szlib I/O - filter. Linker must be able to find szlib - if HDF5 was build with szip. [default=no]])],, - withval=no) - -case $withval in - yes) - HAVE_SZLIB="yes" - AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"]) - AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZLIB]) - - if test -z "$HAVE_SZLIB"; then - AC_MSG_ERROR([couldn't find szlib library, you may need to specify szip library path]) - fi - ;; - no) - HAVE_SZLIB="no" - AC_MSG_CHECKING([for szlib]) - AC_MSG_RESULT([suppressed]) - ;; - *) - HAVE_SZLIB="yes" - case "$withval" in - *,*) - szlib_inc="`echo $withval |cut -f1 -d,`" - szlib_lib="`echo $withval |cut -f2 -d, -s`" - ;; - *) - if test -n "$withval"; then - szlib_inc="$withval/include" - szlib_lib="$withval/lib" - fi - ;; - esac - - dnl Check if szlib.h exists. We cannot use AC_CHECK_HEADERS here - dnl because it will use preprocessor. Preprocessor always succeeds in - dnl finding szlib.h because h4cc provides the path to szlib.h. - AC_CHECK_FILE($szlib_inc/szlib.h, , [unset HAVE_SZLIB]) - if test -z "$HAVE_SZLIB"; then - AC_MSG_ERROR([couldn't find szlib.h, check szip library path]) - fi - - dnl Trying to include -I/usr/include and -L/usr/lib is redundant and - dnl can mess some compilers up. - if test "X$szlib_inc" = "X/usr/include"; then - szlib_inc="" - fi - if test "X$szlib_lib" = "X/usr/lib"; then - szlib_lib="" - fi - - saved_CPPFLAGS="$CPPFLAGS" - saved_LDFLAGS="$LDFLAGS" - - if test -n "$szlib_inc"; then - CPPFLAGS="$CPPFLAGS -I$szlib_inc" - fi - - AC_CHECK_HEADERS([szlib.h], - [HAVE_SZLIB_H="yes"], - [CPPFLAGS="$saved_CPPFLAGS"]) - - if test -n "$szlib_lib"; then - LDFLAGS="$LDFLAGS -L$szlib_lib" - fi - - AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, - [LDFLAGS="$saved_LDFLAGS"; unset HAVE_SZLIB]) - - if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then - AC_MSG_ERROR([couldn't find szlib library, check if szip library is valid]) - fi - ;; -esac - - -if test "X$HAVE_SZLIB" = "Xyes"; then - dnl SZLIB library is available. Check if it can encode - - dnl Given that user specifies h5cc, LDFLAGS in h5cc should be overriden; otherwise, - dnl the encoding test will be performed on the SZIP library linked with HDF5, not - dnl the SZIP library user specifies. To suppress the SZIP library linked with HDF5, - dnl we prepend the user-specified SZIP library path to LDFLAGS in h5cc by using awk. - - AC_PROG_AWK - - AC_MSG_CHECKING([for h5cc]) - PURE_CC="" - if ($CC -show &> /dev/null); then - dnl Since CC can be "h5cc -Df2cFortran", arguments should be removed - PURE_CC=`echo "$CC" | $AWK '{ split($1, array, " ") ; printf array[[1]] }'` - AC_MSG_RESULT([$PURE_CC]) - else - AC_MSG_RESULT([$CC]) - AC_MSG_ERROR([CC is not h5cc]) - fi - - SZIP_CC=szip_cc - cat $PURE_CC | $AWK '{ if ( $0 ~ /^LDFLAGS=\"(.*)/ ) { print substr($0, 1, 9) " -L'$szlib_lib' " substr($0, 10) } else { print } } ' > $SZIP_CC - chmod 755 $SZIP_CC - saved_CC="$CC" - CC=./$SZIP_CC - - AC_MSG_CHECKING([for szlib encoder]) - - AC_CACHE_VAL([he5_cv_szlib_functional], - [AC_TRY_RUN([ - #include - #include - - int main(void) - { - SZ_encoder_enabled(); - exit(0); - } - ], [he5_cv_szlib_functional=yes], [he5_cv_szlib_functional=no],)]) - - AC_CACHE_VAL([he5_cv_szlib_can_encode], - [AC_TRY_RUN([ - #include - #include - - int main(void) - { - /* SZ_encoder_enabled returns 1 if encoder is present */ - if(SZ_encoder_enabled() == 1) - exit(0); - else - exit(1); - } - ], [he5_cv_szlib_can_encode=yes], [he5_cv_szlib_can_encode=no],)]) - - CC="$saved_CC" - rm -f $SZIP_CC - - if test ${he5_cv_szlib_functional} = "no"; then - he5_cv_szlib_can_encode=broken - else - AC_DEFINE(HAVE_FILTER_SZIP, 1, - [Define if support for szip filter is enabled]) - USE_FILTER_SZIP="yes" - fi - - if test ${he5_cv_szlib_can_encode} = "yes"; then - AC_DEFINE(HAVE_FILTER_SZIP_ENCODER, 1, - [Define if support for szip encoder filter is enabled]) - USE_SZIP_ENCODER="yes" - AC_MSG_RESULT([yes]) - fi - if test ${he5_cv_szlib_can_encode} = "no"; then - AC_MSG_RESULT([no]) - fi - if test ${he5_cv_szlib_can_encode} = "broken"; then - AC_MSG_RESULT([shared szlib doesn't work. disabling szip.]) - fi - - dnl Add "szip" to external filter list - if test ${he5_cv_szlib_can_encode} = "yes"; then - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" - fi - if test ${he5_cv_szlib_can_encode} = "no"; then - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" - fi -fi - -# Check for the HDF5 library using the --with argument -# Of course HDF5 is required, but the user may be using h5cc, in which case -# they don't need to specify --with-hdf5. They can also use -# --with-hdf5=/path/to/hdf5 to give a specific path. -HAVE_HDF5="yes" -AC_ARG_WITH([hdf5], - [AC_HELP_STRING([--with-hdf5=DIR], - [Specify path to HDF5 library to use while building - [default=yes]])],, - withval=yes) - -case $withval in - yes) - ;; - no) - AC_MSG_ERROR([HDF5 disabled in confugre, but is required to build HDF-EOS5.]) - ;; - *) - case "$withval" in - *,*) - hdf5_inc="`echo $withval |cut -f1 -d,`" - hdf5_lib="`echo $withval |cut -f2 -d, -s`" - ;; - *) - if test -n "$withval"; then - hdf5_inc="$withval/include" - hdf5_lib="$withval/lib" - fi - ;; - esac - - dnl Trying to include -I/usr/include and -L/usr/lib is redundant and - dnl can mess some compilers up. - if test "X$hdf5_inc" = "X/usr/include"; then - hdf5_inc="" - fi - if test "X$hdf5_lib" = "X/usr/lib"; then - hdf5_lib="" - fi - - if test -n "$hdf5_inc"; then - CPPFLAGS="$CPPFLAGS -I$hdf5_inc" - CFLAGS="$CFLAGS -I$hdf5_inc" - fi - - if test -n "$hdf5_lib"; then - LDFLAGS="$LDFLAGS -L$hdf5_lib" - fi - ;; -esac - -dnl See if we have a valid linking path to the HDF5 library, either because -dnl it's in the user's path or because they provided the correct path using -dnl --with-hdf5 -AC_CHECK_HEADERS([hdf5.h], , [HAVE_HDF5="no"]) -AC_CHECK_LIB(hdf5, H5Fcreate,, [HAVE_HDF5="no"]) - -if test "X$HAVE_HDF5" = "Xno"; then - AC_MSG_ERROR([can't link against HDF5 library]) -fi - - -# Check whether HDF5 threadsafety is enabled -AC_MSG_CHECKING([if HDF5 threadsafe mode is enabled]) -AC_TRY_RUN([ -#include "hdf5.h" - -int main(void) { -#ifdef H5_HAVE_THREADSAFE - return 0; -#else - return 1; -#endif -} ], - [ AC_MSG_RESULT([yes]) - THREADSAFE="yes"], - [AC_MSG_RESULT([no]) - THREADSAFE="no"]) - -# Record threadsafe status in config.h and for Makefiles -if test "X$THREADSAFE" = "Xyes"; then - AC_DEFINE([_HDFEOS5_THREADSAFE], [1], - [Define if threadsafe HDF-EOS is enabled]) -fi - -AM_CONDITIONAL([THREADSAFE_CONDITIONAL], [test "X$THREADSAFE" = "Xyes"]) - - -if test "x$HAVE_HDF5" = "xyes"; then - dnl Check if HDF5 is linked with SZIP encoder - - AC_MSG_CHECKING([for hdf5 szip decoding filter]) - AC_CACHE_VAL([he5_cv_hdf5_szip_can_decode], - [AC_TRY_RUN([ - #include - #include - - int main(int argc, char **argv) - { - herr_t ret; - unsigned int flags = 0; - int decoder = 0; - - ret = H5Zget_filter_info(H5Z_FILTER_SZIP, &flags); - if (ret < 0) exit(1); - decoder = flags & H5Z_FILTER_CONFIG_DECODE_ENABLED; - if (decoder) exit(0); - else exit(1); - } - ], [he5_cv_hdf5_szip_can_decode=yes], [he5_cv_hdf5_szip_can_decode=no],)]) - if test ${he5_cv_hdf5_szip_can_decode} = "yes"; then - AC_DEFINE(HAVE_HDF5_SZIP_DECODER, 1, - [Define if HDF5 has szip decoder filter]) - AC_DEFINE(H5_HAVE_FILTER_SZIP, 1, - [Define if HDF5 has szip any type of filter]) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - - AC_MSG_CHECKING([for hdf5 szip encoding filter]) - AC_CACHE_VAL([he5_cv_hdf5_szip_can_encode], - [AC_TRY_RUN([ - #include - #include - - int main(int argc, char **argv) - { - herr_t ret; - unsigned int flags = 0; - int encoder = 0; - - ret = H5Zget_filter_info(H5Z_FILTER_SZIP, &flags); - if (ret < 0) exit(1); - encoder = flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED; - if (encoder) exit(0); - else exit(1); - } - ], [he5_cv_hdf5_szip_can_encode=yes], [he5_cv_hdf5_szip_can_encode=no],)]) - - if test ${he5_cv_hdf5_szip_can_encode} = "yes"; then - AC_DEFINE(HAVE_HDF5_SZIP_ENCODER, 1, - [Define if HDF5 has szip encoder filter]) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - - dnl Check if SZIP linked with HDF5 has the same configuration as SZIP given by --with-szlib option has - if test ${he5_cv_hdf5_szip_can_decode} = "no"; then - if test "X$HAVE_SZLIB" = "Xyes"; then - AC_MSG_ERROR([HDF5 was linked without SZIP, but --with-szlib was given]) - fi - else - if test "X$HAVE_SZLIB" != "Xyes"; then - AC_MSG_ERROR([HDF5 was linked with SZIP, but --with-szlib was not given]) - fi - if test ${he5_cv_szlib_functional} = "no"; then - AC_MSG_ERROR([SZIP specified in --with-szlib is not functional]) - fi - if test ${he5_cv_hdf5_szip_can_encode} = "no"; then - if test ${he5_cv_szlib_can_encode} = "yes"; then - AC_MSG_ERROR([HDF5 was linked without SZIP encoder, but yours has SZIP encoder]) - fi - else - if test ${he5_cv_szlib_can_encode} = "no"; then - AC_MSG_ERROR([HDF5 was linked with SZIP encoder, but yours does not have SZIP encoder]) - fi - fi - fi -fi - # Set CFLAGS to prevent AC_PROG_CC from setting it CFLAGS=$CFLAGS @@ -584,14 +160,10 @@ AM_CONDITIONAL([INSTALL_INCLUDE_CONDITIONAL], [test "X$INSTALL_INCLUDE" = "Xyes" AM_CONDITIONAL([F2CFORTRAN_CONDITIONAL], [test "X$F2CFORTRAN_MACRO" = "Xyes"]) AM_CONDITIONAL([F2CFORTRAN_90_CONDITIONAL], [test "X$F2CFORTRAN_90" = "Xyes"]) AM_CONDITIONAL([F2CFORTRAN_32PTR_CONDITIONAL], [test "X$F2CFORTRAN_32PTR" = "Xyes"]) -AM_CONDITIONAL([SZIP_ENCODER_CONDITIONAL], [test "X$USE_SZIP_ENCODER" = "Xyes"]) AC_CONFIG_FILES([Makefile - include/Makefile - src/Makefile gctp/Makefile gctp/include/Makefile - gctp/src/Makefile - samples/Makefile]) + gctp/src/Makefile]) AC_OUTPUT -- 2.5.0