Commit 95a9cfab authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Add option for custom library suffix instead of compiler name

parent 57ad918e
......@@ -5,10 +5,10 @@ AM_LDFLAGS = -L$(libdir) -Wl,-rpath -Wl,$(libdir) @AM_LDFLAGS@ $(OPENMP_CFLAGS)
AM_FCFLAGS = @AM_FCFLAGS@ $(OPENMP_FCFLAGS)
# libraries
lib_LTLIBRARIES = libftimings-@FC@.la libftimings_perflib-@FC@.la
lib_LTLIBRARIES = libftimings-@FCNAME@.la libftimings_perflib-@FCNAME@.la
# libftimings
libftimings_@FC@_la_SOURCES = \
libftimings_@FCNAME@_la_SOURCES = \
ftimings/time.c \
ftimings/resident_set_size.c \
ftimings/virtual_memory.c \
......@@ -19,46 +19,46 @@ libftimings_@FC@_la_SOURCES = \
ftimings/ftimings_c_support.c
if HAVE_LIBPAPI
libftimings_@FC@_la_SOURCES += \
libftimings_@FCNAME@_la_SOURCES += \
ftimings/papi.c
endif
if HAVE_PERF
libftimings_@FC@_la_SOURCES += \
libftimings_@FCNAME@_la_SOURCES += \
ftimings/perf_memory_counter.c
endif
libftimings_@FC@_la_LDFLAGS = -version-info @FTIMINGS_SO_VERSION@
libftimings_@FCNAME@_la_LDFLAGS = -version-info @FTIMINGS_SO_VERSION@
# perflib wrapper library
libftimings_perflib_@FC@_la_SOURCES = \
libftimings_perflib_@FCNAME@_la_SOURCES = \
perf_wrapper/perf_wrapper.F90
libftimings_perflib_@FC@_la_LDFLAGS = -version-info @FTIMINGS_SO_VERSION@
libftimings_perflib_@FCNAME@_la_LDFLAGS = -version-info @FTIMINGS_SO_VERSION@
ftimings_includedir = $(includedir)/ftimings-@API_VERSION@-$(FC)
ftimings_includedir = $(includedir)/ftimings-@API_VERSION@-@FCNAME@
nobase_ftimings_include_HEADERS = ftimings.mod
ftimings_include_HEADERS = ftimings/ftimings.h ftimings/ftimings_generated.h
ftimings_libincludedir = $(libdir)/ftimings-@API_VERSION@-$(FC)/include
ftimings_libincludedir = $(libdir)/ftimings-@API_VERSION@-@FCNAME@/include
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = ftimings-@API_VERSION@-$(FC).pc ftimings_perflib-@API_VERSION@-$(FC).pc
pkgconfig_DATA = ftimings-@API_VERSION@-@FCNAME@.pc ftimings_perflib-@API_VERSION@-@FCNAME@.pc
# programs
noinst_PROGRAMS = ftimings_@FC@_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_perf test_papi test_perflib
# Fortran example
ftimings_@FC@_example_SOURCES = \
ftimings_@FCNAME@_example_SOURCES = \
examples/example.F90 \
examples/do_flops.c \
examples/do_memory_transfer.c
ftimings_@FC@_example_LDADD = libftimings-@FC@.la
ftimings_@FC@_example_LDFLAGS = -static
ftimings_@FCNAME@_example_LDADD = libftimings-@FCNAME@.la
ftimings_@FCNAME@_example_LDFLAGS = -static
# C example
ftimings_c_example_SOURCES = \
examples/c_example.c
ftimings_c_example_LDADD = libftimings-@FC@.la
ftimings_c_example_LDADD = libftimings-@FCNAME@.la
ftimings_c_example_LINK = $(FCLINK) -static
......@@ -82,10 +82,10 @@ test_papi_CPPFLAGS = -DTEST_PAPI
test_perflib_SOURCES = \
examples/perflib.F90
test_perflib_LDADD = libftimings-@FC@.la libftimings_perflib-@FC@.la
test_perflib_LDADD = libftimings-@FCNAME@.la libftimings_perflib-@FCNAME@.la
# other files to distribute
filesdir = $(datadir)/@PACKAGE@-@FC@/examples
filesdir = $(datadir)/@PACKAGE@-@FCNAME@/examples
files_DATA = examples/example.F90
include doxygen.am
......
......@@ -38,6 +38,13 @@ if test "$want_perf" = "yes" ; then
fi
AM_CONDITIONAL([HAVE_PERF],[test "$want_perf" = "yes"])
AC_MSG_CHECKING([for custom library name suffix])
AC_ARG_ENABLE([compiler-suffix],
[AS_HELP_STRING([--enable-compiler-suffix=NAME],[Libraries are named libftimings-$API_VERSION-NAME and libftimings_perflib-$API_VERSION-NAME @<:@default=$FC@:>@
])],
[AC_MSG_RESULT([$enableval]); compiler_suffix=$enableval],[AC_MSG_RESULT([default: $FC]); compiler_suffix=$FC])
AC_SUBST([FCNAME],[$compiler_suffix])
AC_MSG_CHECKING([whether we can compile AVX opcodes (important for example programs only)])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
int main(int argc, char **argv) {
......@@ -85,8 +92,8 @@ AC_SUBST([DOXYGEN_OUTPUT_DIR], [docs])
AC_CONFIG_FILES([Makefile
Doxyfile
ftimings-${API_VERSION}-${FC}.pc:ftimings.pc.in
ftimings_perflib-${API_VERSION}-${FC}.pc:ftimings_perflib.pc.in
ftimings-${API_VERSION}-${FCNAME}.pc:ftimings.pc.in
ftimings_perflib-${API_VERSION}-${FCNAME}.pc:ftimings_perflib.pc.in
])
AC_OUTPUT
......
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