Commit 92409280 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl

Handle modules for test programs

Now they just cluttered the main build directory, put them also in
private_modules/. This of course assumes that no two test programs
define modules with the same name.

Also, this necessitates that the shared sources are also only compiled
once, thus I put them into an internal libtool convenience library and
link all test programs with it.
parent ce80e103
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
AM_FCFLAGS = $(SCALAPACK_FCFLAGS) @FC_MODINC@modules @FC_MODINC@private_modules AM_FCFLAGS = $(SCALAPACK_FCFLAGS) @FC_MODINC@modules
AM_LDFLAGS = $(SCALAPACK_LDFLAGS) AM_LDFLAGS = $(SCALAPACK_LDFLAGS)
# libelpa # libelpa
# parts with public interface # parts with public interface
noinst_LTLIBRARIES = libelpa@SUFFIX@_public.la noinst_LTLIBRARIES = libelpa@SUFFIX@_public.la
libelpa@SUFFIX@_public_la_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@modules libelpa@SUFFIX@_public_la_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@modules @FC_MODINC@private_modules
libelpa@SUFFIX@_public_la_SOURCES = \ libelpa@SUFFIX@_public_la_SOURCES = \
src/elpa1.F90 \ src/elpa1.F90 \
src/elpa2.F90 \ src/elpa2.F90 \
...@@ -18,7 +18,7 @@ libelpa@SUFFIX@_public_la_SOURCES = \ ...@@ -18,7 +18,7 @@ libelpa@SUFFIX@_public_la_SOURCES = \
# internal parts # internal parts
noinst_LTLIBRARIES += libelpa@SUFFIX@_private.la noinst_LTLIBRARIES += libelpa@SUFFIX@_private.la
libelpa@SUFFIX@_private_la_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules libelpa@SUFFIX@_private_la_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
libelpa@SUFFIX@_private_la_SOURCES = \ libelpa@SUFFIX@_private_la_SOURCES = \
src/mod_precision.f90 \ src/mod_precision.f90 \
src/mod_mpi.F90 \ src/mod_mpi.F90 \
...@@ -164,7 +164,7 @@ endif ...@@ -164,7 +164,7 @@ endif
include generated_headers.am include generated_headers.am
BUILT_SOURCES = $(generated_headers) BUILT_SOURCES = $(generated_headers)
# install any .mod files in the include/ dir # install public Fortran modules files in the include/ dir
elpa_includedir = $(includedir)/elpa@SUFFIX@-@PACKAGE_VERSION@ elpa_includedir = $(includedir)/elpa@SUFFIX@-@PACKAGE_VERSION@
nobase_elpa_include_HEADERS = $(wildcard modules/*) nobase_elpa_include_HEADERS = $(wildcard modules/*)
nobase_elpa_include_HEADERS += elpa/elpa.h elpa/elpa_kernel_constants.h elpa/elpa_generated.h nobase_elpa_include_HEADERS += elpa/elpa.h elpa/elpa_kernel_constants.h elpa/elpa_generated.h
...@@ -225,95 +225,109 @@ noinst_PROGRAMS += \ ...@@ -225,95 +225,109 @@ noinst_PROGRAMS += \
elpa2_test_complex_c_version@SUFFIX@ elpa2_test_complex_c_version@SUFFIX@
endif endif
build_lib = libelpa@SUFFIX@.la build_lib = libelpa@SUFFIX@.la libelpatest@SUFFIX@.la
# library with shared sources for the test files
noinst_LTLIBRARIES += libelpatest@SUFFIX@.la
libelpatest@SUFFIX@_la_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
libelpatest@SUFFIX@_la_SOURCES = \
test/shared_sources/util.F90 \
test/shared_sources/read_input_parameters.F90 \
test/shared_sources/check_correctnes.F90 \
test/shared_sources/setup_mpi.F90 \
test/shared_sources/blacs_infrastructure.F90 \
test/shared_sources/prepare_matrix.F90 \
test/shared_sources/mod_output_types.F90 \
test/shared_sources/mod_from_c.F90 \
test/shared_sources/call_elpa1.c
if HAVE_REDIRECT if HAVE_REDIRECT
redirect_sources = test/shared_sources/redir.c test/shared_sources/redirect.F90 libelpatest@SUFFIX@_la_SOURCES += \
else test/shared_sources/redir.c \
redirect_sources = test/shared_sources/redirect.F90
endif endif
#test/shared_sources/mod_precision_created.f90: src/mod_precision.f90
# cp $(top_srcdir)/src/mod_precision.f90 $(top_srcdir)/test/shared_sources/mod_precision_created.f90
shared_sources = test/shared_sources/util.F90 test/shared_sources/read_input_parameters.F90 \
test/shared_sources/check_correctnes.F90 test/shared_sources/setup_mpi.F90 \
test/shared_sources/blacs_infrastructure.F90 test/shared_sources/prepare_matrix.F90 \
test/shared_sources/mod_output_types.F90
if !WITH_OPENMP if !WITH_OPENMP
elpa1_test_real_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa1_test_real_c_version.c $(shared_sources) $(redirect_sources) elpa1_test_real_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa1_test_real_c_version.c
elpa1_test_real_c_version@SUFFIX@_LDADD = $(build_lib) elpa1_test_real_c_version@SUFFIX@_LDADD = $(build_lib)
elpa1_test_real_c_version@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
elpa1_test_real_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS) elpa1_test_real_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
EXTRA_elpa1_test_real_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa1_test_real_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa1_test_complex_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa1_test_complex_c_version.c $(shared_sources) $(redirect_sources) elpa1_test_complex_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa1_test_complex_c_version.c
elpa1_test_complex_c_version@SUFFIX@_LDADD = $(build_lib) elpa1_test_complex_c_version@SUFFIX@_LDADD = $(build_lib)
elpa1_test_complex_c_version@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
elpa1_test_complex_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS) elpa1_test_complex_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
EXTRA_elpa1_test_complex_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa1_test_complex_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa2_test_real_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa2_test_real_c_version.c $(shared_sources) $(redirect_sources) elpa2_test_real_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa2_test_real_c_version.c
elpa2_test_real_c_version@SUFFIX@_LDADD = $(build_lib) elpa2_test_real_c_version@SUFFIX@_LDADD = $(build_lib)
elpa2_test_real_c_version@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
elpa2_test_real_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS) elpa2_test_real_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
EXTRA_elpa2_test_real_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa2_test_real_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa2_test_complex_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa2_test_complex_c_version.c $(shared_sources) $(redirect_sources) elpa2_test_complex_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa2_test_complex_c_version.c
elpa2_test_complex_c_version@SUFFIX@_LDADD = $(build_lib) elpa2_test_complex_c_version@SUFFIX@_LDADD = $(build_lib)
elpa2_test_complex_c_version@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
elpa2_test_complex_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS) elpa2_test_complex_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
EXTRA_elpa2_test_complex_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa2_test_complex_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
endif endif
elpa1_test_real@SUFFIX@_SOURCES = test/fortran_test_programs/test_real.F90 $(shared_sources) $(redirect_sources) elpa1_test_real@SUFFIX@_SOURCES = test/fortran_test_programs/test_real.F90
elpa1_test_real@SUFFIX@_LDADD = $(build_lib) elpa1_test_real@SUFFIX@_LDADD = $(build_lib)
elpa1_test_real@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
EXTRA_elpa1_test_real@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa1_test_real@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa1_test_real_with_c@SUFFIX@_SOURCES = test/fortran_test_programs/test_real_with_c.F90 test/shared_sources/mod_from_c.F90 \ elpa1_test_real_with_c@SUFFIX@_SOURCES = test/fortran_test_programs/test_real_with_c.F90
test/shared_sources/call_elpa1.c $(shared_sources) $(redirect_sources)
elpa1_test_real_with_c@SUFFIX@_LDADD = $(build_lib) elpa1_test_real_with_c@SUFFIX@_LDADD = $(build_lib)
elpa1_test_real_with_c@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
EXTRA_elpa1_test_real_with_c@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa1_test_real_with_c@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
#elpa1_test_complex_with_c@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex_with_c.F90 test/shared_sources/mod_from_c.F90 test/shared_sources/call_elpa1.c $(shared_sources) $(redirect_sources) elpa2_test_real@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2.F90
#elpa1_test_complex_with_c@SUFFIX@_LDADD = $(build_lib)
#EXTRA_elpa1_test_complex_with_c@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa2_test_real@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2.F90 $(shared_sources) $(redirect_sources)
elpa2_test_real@SUFFIX@_LDADD = $(build_lib) elpa2_test_real@SUFFIX@_LDADD = $(build_lib)
elpa2_test_real@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
EXTRA_elpa2_test_real@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa2_test_real@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa2_test_real_default_kernel@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_default_kernel.F90 $(shared_sources) $(redirect_sources) elpa2_test_real_default_kernel@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_default_kernel.F90
elpa2_test_real_default_kernel@SUFFIX@_LDADD = $(build_lib) elpa2_test_real_default_kernel@SUFFIX@_LDADD = $(build_lib)
elpa2_test_real_default_kernel@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
EXTRA_elpa2_test_real_default_kernel@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa2_test_real_default_kernel@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_default_kernel_qr_decomposition.F90 \ elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_default_kernel_qr_decomposition.F90
$(shared_sources) $(redirect_sources)
elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_LDADD = $(build_lib) elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_LDADD = $(build_lib)
elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
EXTRA_elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa2_test_real_choose_kernel_with_api@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_choose_kernel_with_api.F90 \ elpa2_test_real_choose_kernel_with_api@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_choose_kernel_with_api.F90
$(shared_sources) $(redirect_sources)
elpa2_test_real_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib) elpa2_test_real_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib)
elpa2_test_real_choose_kernel_with_api@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
EXTRA_elpa2_test_real_choose_kernel_with_api@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa2_test_real_choose_kernel_with_api@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa1_test_complex@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex.F90 $(shared_sources) $(redirect_sources) elpa1_test_complex@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex.F90
elpa1_test_complex@SUFFIX@_LDADD = $(build_lib) elpa1_test_complex@SUFFIX@_LDADD = $(build_lib)
elpa1_test_complex@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
EXTRA_elpa1_test_complex@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa1_test_complex@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa2_test_complex@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2.F90 $(shared_sources) $(redirect_sources) elpa2_test_complex@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2.F90
elpa2_test_complex@SUFFIX@_LDADD = $(build_lib) elpa2_test_complex@SUFFIX@_LDADD = $(build_lib)
elpa2_test_complex@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
EXTRA_elpa2_test_complex@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa2_test_complex@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa2_test_complex_default_kernel@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2_default_kernel.F90 $(shared_sources) $(redirect_sources) elpa2_test_complex_default_kernel@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2_default_kernel.F90
elpa2_test_complex_default_kernel@SUFFIX@_LDADD = $(build_lib) elpa2_test_complex_default_kernel@SUFFIX@_LDADD = $(build_lib)
elpa2_test_complex_default_kernel@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
EXTRA_elpa2_test_complex_default_kernel@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa2_test_complex_default_kernel@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2_choose_kernel_with_api.F90 \ elpa2_test_complex_choose_kernel_with_api@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2_choose_kernel_with_api.F90
$(shared_sources) $(redirect_sources)
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib) elpa2_test_complex_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib)
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
EXTRA_elpa2_test_complex_choose_kernel_with_api@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90 EXTRA_elpa2_test_complex_choose_kernel_with_api@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
elpa2_print_kernels@SUFFIX@_SOURCES = src/elpa2_print_kernels.F90 $(shared_sources) $(redirect_sources) elpa2_print_kernels@SUFFIX@_SOURCES = src/elpa2_print_kernels.F90
elpa2_print_kernels@SUFFIX@_LDADD = $(build_lib) elpa2_print_kernels@SUFFIX@_LDADD = $(build_lib)
elpa2_print_kernels@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) @FC_MODOUT@private_modules @FC_MODINC@private_modules
check_SCRIPTS = \ check_SCRIPTS = \
elpa1_test_real@SUFFIX@.sh \ elpa1_test_real@SUFFIX@.sh \
...@@ -339,23 +353,14 @@ endif ...@@ -339,23 +353,14 @@ endif
# test scripts # test scripts
if WITH_MPI if WITH_MPI
wrapper="mpiexec -n 2 " wrapper=mpiexec -n 2
else else
wrapper="" wrapper=
endif endif
TESTS = $(check_SCRIPTS) TESTS = $(check_SCRIPTS)
%.sh: % %.sh: %
echo '$(wrapper)./$^ $$TEST_FLAGS' > $@ @echo $(wrapper) ./$^ '$$TEST_FLAGS' > $@
chmod +x $@ @chmod +x $@
## this one does not want any arguments
#elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@.sh:
# echo '$(wrapper)./elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@' > $@
# chmod +x $@
#elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@.sh:
# echo '$(wrapper)./elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@' > $@
# chmod +x $@
# Preprocessed files (just used for manual inspection) # Preprocessed files (just used for manual inspection)
elpa2_utilities.i: $(top_srcdir)/src/elpa2_utilities.F90 elpa2_utilities.i: $(top_srcdir)/src/elpa2_utilities.F90
......
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