diff --git a/configure.ac b/configure.ac index 50d86b30c27..a83b53f817b 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,18 @@ if test "x$enable_logging" = xyes; then AC_DEFINE([PIO_ENABLE_LOGGING], 1, [If true, turn on logging.]) fi +# Does the user want to enable timing? +AC_MSG_CHECKING([whether GPTL timing library is used]) +AC_ARG_ENABLE([timing], + [AS_HELP_STRING([--enable-timing], + [enable use of the GPTL timing library.])]) +test "x$enable_timing" = xyes || enable_timing=no +AC_MSG_RESULT([$enable_timing]) +if test "x$enable_timing" = xyes; then + AC_DEFINE([TIMING], 1, [If true, use GPTL timing library.]) +fi +AM_CONDITIONAL(USE_GPTL, [test "x$enable_timing" = xyes]) + # Does the user want to enable Fortran library? AC_MSG_CHECKING([whether Fortran library should be build]) AC_ARG_ENABLE([fortran], @@ -148,6 +160,12 @@ fi #AC_CHECK_SIZEOF([MPI_Offset], [], [[#include ]]) #AC_DEFINE([SIZEOF_MPI_OFFSET], [8], [netCDF classic library available]) +# If we want the timing library, we must find it. +if test "x$enable_timing" = xyes; then + AC_CHECK_HEADERS([gptl.h]) + AC_CHECK_LIB([gptl], [GPTLinitialize], [], [AC_MSG_ERROR([Can't find or link to the GPTL library.])]) +fi + AC_CONFIG_FILES(src/flib/piodarray.F90:src/flib/piodarray.F90.in2) AC_CONFIG_FILES(src/flib/pionfatt_mod.F90:src/flib/pionfatt_mod.F90.in2) AC_CONFIG_FILES(src/flib/pionfget_mod.F90:src/flib/pionfget_mod.F90.in2) @@ -165,11 +183,13 @@ AC_OUTPUT(Makefile src/Makefile src/clib/Makefile src/flib/Makefile + src/gptl/Makefile tests/Makefile tests/cunit/Makefile tests/unit/Makefile tests/general/Makefile tests/general/util/Makefile + tests/performance/Makefile doc/Makefile examples/Makefile examples/c/Makefile) diff --git a/src/Makefile.am b/src/Makefile.am index 68e4497dfb0..7cd8d61f77b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,6 +7,10 @@ if BUILD_FORTRAN FLIB = flib endif -SUBDIRS = clib $(FLIB) +if USE_GPTL +GPTL = gptl +endif + +SUBDIRS = clib ${GPTL} $(FLIB) EXTRA_DIST = CMakeLists.txt diff --git a/src/gptl/Makefile.am b/src/gptl/Makefile.am new file mode 100644 index 00000000000..3bd4da9e0d5 --- /dev/null +++ b/src/gptl/Makefile.am @@ -0,0 +1,23 @@ +# This is part of PIO. It creates the Makefile for the GPTL directory. + +# Ed Hartnett 4/9/19 + +# Turn off parallel builds in this directory. +.NOTPARALLEL: + +# Build these uninstalled convenience libraries. +noinst_LTLIBRARIES = libperf_utils.la libperf_mod.la + +# The convenience libraries depends on their source. +libperf_utils_la_SOURCES = perf_utils.F90 +libperf_mod_la_SOURCES = perf_mod.F90 + +# Each mod file depends on the .o file. +perf_utils.mod: perf_utils.$(OBJEXT) +perf_mod.mod: perf_mod.$(OBJEXT) + +# Does the user want to build fortran? +#if BUILD_FORTRAN +#endif + +EXTRA_DIST = CMakeLists.txt diff --git a/tests/Makefile.am b/tests/Makefile.am index 7377b2aa9a5..a643bbcd976 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,8 +8,11 @@ if BUILD_FORTRAN UNIT = unit GENERAL = general +if USE_GPTL +PERFORMANCE = performance +endif endif -SUBDIRS = cunit ${UNIT} ${GENERAL} +SUBDIRS = cunit ${UNIT} ${GENERAL} ${PERFORMANCE} EXTRA_DIST = CMakeLists.txt diff --git a/tests/performance/Makefile.am b/tests/performance/Makefile.am new file mode 100644 index 00000000000..c02e9dad8a0 --- /dev/null +++ b/tests/performance/Makefile.am @@ -0,0 +1,27 @@ +## This is the automake file for building the Fortran performance +## tests for the PIO library. + +# Ed Hartnett 4/6/19 + +# Parallel builds don't currently work in this directory. +.NOTPARALLEL: + +# Put together AM_CPPFLAGS and AM_LDFLAGS. +include $(top_srcdir)/set_flags.am + +LDADD = libpio_tutil.la \ +${top_builddir}/src/flib/libpiof.la \ +${top_builddir}/src/clib/libpio.la + +# Build the test for make check. +bin_PROGRAMS = pioperformance + +pioperformance_SOURCES = pioperformance.F90 + +# Tests will run from a bash script. +#TESTS = run_tests.sh + +EXTRA_DIST = CMakeLists.txt gensimple.pl + +# Clean up files produced during testing. +CLEANFILES = *.nc *.log *.mod