Commit a934c4b8 authored by Ralf Müller's avatar Ralf Müller
Browse files

Change multithread building into CC specific settings (refs #965)

parent e91fa7b3
......@@ -42,10 +42,10 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
config/ltmain.sh config/missing config/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
......@@ -187,6 +187,9 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROJ_INCLUDE = @PROJ_INCLUDE@
PROJ_LDFLAGS = @PROJ_LDFLAGS@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
......@@ -199,6 +202,7 @@ THREADS_INCLUDE = @THREADS_INCLUDE@
THREADS_LDFLAGS = @THREADS_LDFLAGS@
USER_NAME = @USER_NAME@
VERSION = @VERSION@
ZLIB_INCLUDE = @ZLIB_INCLUDE@
ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
......@@ -212,6 +216,7 @@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
......
......@@ -13,8 +13,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.66],,
[m4_warning([this file was generated for autoconf 2.66.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
[m4_warning([this file was generated for autoconf 2.68.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
......@@ -1037,6 +1037,7 @@ AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([m4/acx_options.m4])
m4_include([m4/ax_pthread.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
......
......@@ -5,7 +5,6 @@
"CFLAGS" : "@CFLAGS@",
"LDFLAGS" : "@LDFLAGS@",
"LIBS" : "@LIBS@",
"FCPPFLAGS" : "@FCPPFLAGS@",
"FCFLAGS" : "@FCFLAGS@",
"INCLUDES" : "@INCLUDES@",
"LD" : "@LD@",
......
This diff is collapsed.
......@@ -38,10 +38,10 @@ subdir = contrib
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
......@@ -131,6 +131,9 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROJ_INCLUDE = @PROJ_INCLUDE@
PROJ_LDFLAGS = @PROJ_LDFLAGS@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
......@@ -143,6 +146,7 @@ THREADS_INCLUDE = @THREADS_INCLUDE@
THREADS_LDFLAGS = @THREADS_LDFLAGS@
USER_NAME = @USER_NAME@
VERSION = @VERSION@
ZLIB_INCLUDE = @ZLIB_INCLUDE@
ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
......@@ -156,6 +160,7 @@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
......
AC_DEFUN([ACX_OPTIONS],
[
# ----------------------------------------------------------------------
# Checks for pthread library
# Checks for multithreaded compiling + linking
AC_ARG_WITH([threads],
[AC_HELP_STRING([--with-threads=<directory>],
[Use the pthread library [default=yes]])],
[AC_HELP_STRING([--with-threads=<yes/no/directory>],
[Compuile + link for multithreading [default=yes]])],
[],
[with_threads=yes])
AS_CASE([$with_threads],
[no],[AC_MSG_CHECKING([for pthread library])
[no],[AC_MSG_CHECKING([multithreading])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS(pthread.h)
AC_CHECK_LIB([pthread],[pthread_create])
AC_SUBST([THREADS_LDFLAGS],[" -lpthread"])
AC_SUBST([THREADS_INCLUDE],[""])],
[yes],[AX_PTHREAD([AC_DEFINE([HAVE_LIBPTHREAD],[1],[Define 1 for multithread support])],[AC_MSG_ERROR([multithreaded settings NOT found])])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
AS_ECHO(["CC:$CC CFLAGS:$CFLAGS LIBS:$LIBS"])
AC_SUBST([THREADS_LDFLAGS],[])
AC_SUBST([THREADS_INCLUDE],[])],
[*],[THREADS_ROOT=$with_threads
LDFLAGS="$LDFLAGS -L$THREADS_ROOT/lib"
CPPFLAGS="$CPPFLAGS -I$THREADS_ROOT/include"
LDFLAGS="-L$THREADS_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$THREADS_ROOT/include $CPPFLAGS "
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_LIB([pthread],[pthread_create])
AC_SUBST([THREADS_LDFLAGS],[" -L$THREADS_ROOT/lib -lpthread"])
......@@ -30,12 +33,20 @@ AC_ARG_WITH([zlib],
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS(zlib.h)
AC_SEARCH_LIBS([deflate],[z],[AC_DEFINE([HAVE_LIBZ],[1],[Define 1 for ZLIB support])])
AC_SUBST([ZLIB_INCLUDE],[])
AC_SUBST([ZLIB_LDFLAGS],[" -lz"])],
[*],[ZLIB_ROOT=$with_zlib
LDFLAGS="$LDFLAGS -L$ZLIB_ROOT/lib"
CPPFLAGS="$CPPFLAGS -I$ZLIB_ROOT/include"
LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$ZLIB_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$ZLIB_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS(zlib.h)
AC_SEARCH_LIBS([deflate],[z],[AC_DEFINE([HAVE_LIBZ],[1],[Define 1 for ZLIB support])])
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
AC_SUBST([ZLIB_INCLUDE],[" -I$ZLIB_ROOT/include"])
AC_SUBST([ZLIB_LDFLAGS],[" -L$ZLIB_ROOT/lib -lz"])])],
[AC_CHECK_HEADERS(zlib.h)
AC_SEARCH_LIBS([deflate],[z],[AC_DEFINE([HAVE_LIBZ],[1],[Define 1 for ZLIB support])])
......@@ -56,13 +67,19 @@ AC_ARG_WITH([szlib],
AC_SUBST([SZLIB_INCLUDE],[""])],
[*],[SZLIB_ROOT=$with_szlib
AS_IF([test -d "$SZLIB_ROOT"],
[LDFLAGS="$LDFLAGS -L$SZLIB_ROOT/lib"
CPPFLAGS="$CPPFLAGS -I$SZLIB_ROOT/include"
[LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$SZLIB_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$SZLIB_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS(szlib.h)
AC_SEARCH_LIBS([SZ_BufftoBuffCompress],
[sz],
[AC_DEFINE([HAVE_LIBSZ],[1],[Define to 1 for SZIP support])],
[AC_MSG_ERROR([Could not link to szlib])])
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
AC_SUBST([SZLIB_LDFLAGS],[" -L$SZLIB_ROOT/lib -lsz"])
AC_SUBST([SZLIB_INCLUDE],[" -I$SZLIB_ROOT/include"])],
[AC_MSG_NOTICE([$SZLIB_ROOT is not a directory! SZLIB suppressed])])])],
......@@ -91,8 +108,11 @@ AC_ARG_WITH([hdf5],
AC_SUBST([HDF5_INCLUDE],[""])],
[*],[HDF5_ROOT=$with_hdf5
AS_IF([test -d "$HDF5_ROOT"],
[LDFLAGS="$LDFLAGS -L$HDF5_ROOT/lib"
CPPFLAGS="$CPPFLAGS -I$HDF5_ROOT/include"
[LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$HDF5_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$HDF5_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([hdf5.h])
AC_SEARCH_LIBS([H5Fopen],
[hdf5],
......@@ -106,6 +126,9 @@ AC_ARG_WITH([hdf5],
--with-zlib option. If HDF5 was also built with szlib, then the location of szlib must also be \
specified with the --with-szlib option..])
have_hdf5_hl=no])
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
AS_IF([test "x$have_libhdf5_hl" = 'xyes'],
[AC_SUBST([HDF5_LDFLAGS],[" -L$HDF5_ROOT/lib -lhdf5_hl -lhdf5"])],
[AC_SUBST([HDF5_LDFLAGS],[" -L$HDF5_ROOT/lib -lhdf5"])])
......@@ -129,13 +152,19 @@ AC_ARG_WITH([netcdf],
AC_SUBST([NETCDF_INCLUDE],[""])],
[*],[NETCDF_ROOT=$with_netcdf
AS_IF([test -d "$NETCDF_ROOT"],
[LDFLAGS="$LDFLAGS -L$NETCDF_ROOT/lib"
CPPFLAGS="$CPPFLAGS -I$NETCDF_ROOT/include"
[LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$NETCDF_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$NETCDF_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([netcdf.h])
AC_SEARCH_LIBS([nc_open],
[netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NETCDF support])],
[AC_MSG_ERROR([Could not link to netcdf library])])
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
AC_SUBST([NETCDF_LDFLAGS],[" -L$NETCDF_ROOT/lib -lnetcdf"])
AC_SUBST([NETCDF_INCLUDE],[" -I$NETCDF_ROOT/include"])],
[AC_MSG_NOTICE([$NETCDF_ROOT is not a directory! NETCDF suppressed])])])],
......@@ -180,13 +209,19 @@ AC_ARG_WITH([grib_api],
[AC_MSG_ERROR([Could not link to grib_api library])])],
[*],[GRIB_API_ROOT=$with_grib_api
AS_IF([test -d "$GRIB_API_ROOT"],
[LDFLAGS="-L$GRIB_API_ROOT/lib $LDFLAGS "
[LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$GRIB_API_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$GRIB_API_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([grib_api.h])
AC_SEARCH_LIBS([grib_get_message],
[grib_api],
[AC_DEFINE([HAVE_LIBGRIB_API],[1],[GRIB_API library is present if defined to 1])],
[AC_MSG_ERROR([Could not link to grib_api library])])
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
AC_SUBST([GRIB_API_LDFLAGS],[" -L$GRIB_API_ROOT/lib -lgrib_api"])
AC_SUBST([GRIB_API_INCLUDE],[" -I$GRIB_API_ROOT/include"])],
[AC_MSG_ERROR([$GRIB_API_ROOT is not a directory! GRIB_API suppressed])])])],
......@@ -267,13 +302,19 @@ AC_ARG_WITH([proj],
AC_SUBST([PROJ_INCLUDE],[""])],
[*],[PROJ_ROOT=$with_proj
AS_IF([test -d "$PROJ_ROOT"],
[LDFLAGS="$LDFLAGS -L$PROJ_ROOT/lib"
CPPFLAGS="$CPPFLAGS -I$PROJ_ROOT/include"
[LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$PROJ_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$PROJ_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([projects.h])
AC_SEARCH_LIBS([pj_init],
[proj],
[AC_DEFINE([HAVE_LIBPROJ],[1],[Define to 1 for PROJ support])],
[AC_MSG_ERROR([Could not link to PROJ library!])])
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
AC_SUBST([PROJ_LDFLAGS],[" -L$PROJ_ROOT/lib -lproj"])
AC_SUBST([PROJ_INCLUDE],[" -I$PROJ_ROOT/include"])],
[AC_MSG_ERROR([$PROJ_ROOT is not a directory! PROJ suppressed])])])],
......
......@@ -262,11 +262,10 @@ cdo_SOURCES += Arith.c \
vinterp.h \
zaxis.c
cdo_CPPFLAGS = -I$(top_srcdir)/libcdi/src
cdo_CPPFLAGS = -I$(top_srcdir)/libcdi/src @SZLIB_INCLUDE@ @HDF5_INCLUDE@ @NETCDF_INCLUDE@ @PROJ_INCLUDE@
cdo_LDADD = $(top_builddir)/libcdi/src/libcdi.la @LIBS@
cdo_LDFLAGS = @LDFLAGS@ \
@NETCDF_LDFLAGS@ \
@HDF5_LDFLAGS@ \
cdo_LDFLAGS = @HDF5_LDFLAGS@ \
@NETCDF_LDFLAGS@ \
@GRIB_API_LDFLAGS@ \
@ZLIB_LDFLAGS@ \
@SZLIB_LDFLAGS@ \
......
......@@ -43,10 +43,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
......@@ -266,6 +266,9 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROJ_INCLUDE = @PROJ_INCLUDE@
PROJ_LDFLAGS = @PROJ_LDFLAGS@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
......@@ -278,6 +281,7 @@ THREADS_INCLUDE = @THREADS_INCLUDE@
THREADS_LDFLAGS = @THREADS_LDFLAGS@
USER_NAME = @USER_NAME@
VERSION = @VERSION@
ZLIB_INCLUDE = @ZLIB_INCLUDE@
ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
......@@ -291,6 +295,7 @@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
......@@ -379,11 +384,10 @@ cdo_SOURCES = cdo.c Arith.c Arithc.c Arithdays.c Arithlat.c CDItest.c \
readline.c realtime.c remap.h remaplib.c specspace.c \
specspace.h statistic.c statistic.h table.c timebase.h timer.c \
userlog.c util.c util.h vinterp.c vinterp.h zaxis.c
cdo_CPPFLAGS = -I$(top_srcdir)/libcdi/src
cdo_CPPFLAGS = -I$(top_srcdir)/libcdi/src @SZLIB_INCLUDE@ @HDF5_INCLUDE@ @NETCDF_INCLUDE@ @PROJ_INCLUDE@
cdo_LDADD = $(top_builddir)/libcdi/src/libcdi.la @LIBS@
cdo_LDFLAGS = @LDFLAGS@ @NETCDF_LDFLAGS@ @HDF5_LDFLAGS@ \
@GRIB_API_LDFLAGS@ @ZLIB_LDFLAGS@ @SZLIB_LDFLAGS@ \
@PROJ_LDFLAGS@ $(am__append_1)
cdo_LDFLAGS = @HDF5_LDFLAGS@ @NETCDF_LDFLAGS@ @GRIB_API_LDFLAGS@ \
@ZLIB_LDFLAGS@ @SZLIB_LDFLAGS@ @PROJ_LDFLAGS@ $(am__append_1)
cdotest_SOURCES = cdo_int.h \
cdotest.c
......
......@@ -96,6 +96,9 @@
/* Define to 1 if you have the <projects.h> header file. */
#undef HAVE_PROJECTS_H
/* Define if you have POSIX threads libraries and header files. */
#undef HAVE_PTHREAD
/* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
......@@ -169,6 +172,10 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
#undef PTHREAD_CREATE_JOINABLE
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
......
......@@ -31,7 +31,7 @@ extern void Free (const char *caller, const char *file, int line, void *ptr
#if defined WITH_CALLER_NAME
# define realloc(p, s) Realloc(__func__, __FILE__, __LINE__, p, (size_t)s)
# define calloc(n, s) Calloc(__func__, __FILE__, __LINE__, n, (size_t)s)
# define malloc(s) Malloc(__func__, __FILE__, __LINE__, (size_t)s)
# define malloc(s) Malloc(__FUNCTION__, __FILE__, __LINE__, (size_t)s)
# define free(p) Free(__func__, __FILE__, __LINE__, p)
#else
# define realloc(p, s) Realloc((void *) NULL, __FILE__, __LINE__, p, (size_t)s)
......
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