Commit ed3e2b60 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Only build PAPI/perf example programs if PAPI/perf is enabled

parent 314fa509
......@@ -44,7 +44,15 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = ftimings-@API_VERSION@-@FCNAME@.pc ftimings_perflib-@API_VERSION@-@FCNAME@.pc
# programs
noinst_PROGRAMS = ftimings_@FCNAME@_example ftimings_c_example do_flops do_memory_transfer test_perf test_papi test_perflib
noinst_PROGRAMS = ftimings_@FCNAME@_example ftimings_c_example do_flops do_memory_transfer test_perflib
if HAVE_PERF
noinst_PROGRAMS += test_perf
endif
if HAVE_LIBPAPI
noinst_PROGRAMS += test_papi
endif
# Fortran example
......@@ -72,13 +80,17 @@ do_memory_transfer_SOURCES = \
examples/do_memory_transfer.c
do_memory_transfer_CPPFLAGS = -DTEST_DO_MEMORY_TRANSFER
if HAVE_PERF
test_perf_SOURCES = \
ftimings/perf_memory_counter.c
test_perf_CPPFLAGS = -DTEST_PERF
endif
if HAVE_LIBPAPI
test_papi_SOURCES = \
ftimings/papi.c
test_papi_CPPFLAGS = -DTEST_PAPI
endif
test_perflib_SOURCES = \
examples/perflib.F90
......
......@@ -33,7 +33,6 @@ static int papi_available = 0;
static int flop_available = 0;
static int cycle_available = 0;
#ifdef HAVE_LIBPAPI
#include <papi.h>
#define papi_try(x, on_error) if ((ret = x) < 0) { \
......@@ -164,5 +163,3 @@ int main(int argc, char *argv[argc + 1]) {
print_papi_counters(event_set);
}
#endif /* TEST_PAPI */
#endif /* HAVE_LIBPAPI */
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