Commit c56b2473 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Replace inclusion of individual headers in tests

with inclusion of installable yaxt.h. Header yaxt.h is no longer available
in src directory. Library components must use xt headers directly.
parent fee4076e
SUBDIRS = src tests examples inst_headers
SUBDIRS = src inst_headers tests examples
ACLOCAL_AMFLAGS=-I m4
......@@ -5,6 +5,6 @@ noinst_PROGRAMS = \
rrobin_SOURCES = rrobin.c
idxlist_examples_SOURCES = idxlist_examples.c
AM_CFLAGS = -I$(top_srcdir)/src $(MPI_C_INCLUDE)
AM_CFLAGS = -I../inst_headers $(MPI_C_INCLUDE)
AM_FCFLAGS = -I$(top_srcdir)/src -I../src $(MPI_FC_INCLUDE) $(MPI_FC_MOD)
LDADD = ../src/libyaxt.la $(MPI_C_LIB)
#include <stdlib.h>
#include <stdio.h>
#include "yaxt.h"
#include "xt/xt_idxlist.h"
#include "xt/xt_idxvec.h"
#include "xt/xt_idxstripes.h"
#include "xt/xt_idxsection.h"
#include "xt/xt_idxlist_collection.h"
#include <yaxt.h>
static void print_index_list(Xt_idxlist idxlist);
......
......@@ -4,12 +4,7 @@
#include <mpi.h>
#include "xt/xt_core.h"
#include "xt/xt_mpi.h"
#include "xt/xt_xmap_all2all.h"
#include "xt/xt_idxlist.h"
#include "xt/xt_redist_p2p.h"
#include "xt/xt_idxstripes.h"
#include <yaxt.h>
int main(void) {
......
......@@ -3,21 +3,32 @@ xtincludedir = $(includedir)/xt
include_HEADERS = yaxt.h
yaxt.h: Makefile
( echo '/* license */' ; echo '#ifndef YAXT_H' ; echo '#define YAXT_H' ; \
for header in $(xtinclude_HEADERS) ; \
do echo "#include <$$header>" ; done \
>yaxt.h
do echo "#include <$$header>" ; done ; \
echo '#endif' \
) >yaxt.h.tmp
if test ! -f $@ || ! cmp $@ $@.tmp >/dev/null ; then \
mv $@.tmp $@ ; else rm $@.tmp ; fi
all-local:
$(MKDIR_P) xt
for header in $(xtinclude_HEADERS) ; \
do \
headerbasedir=`test -f '../src/$$header' || echo '$(srcdir)/'` ; \
$(PERL) -I$(top_builddir)/scripts \
if test "$$headerbasedir../src/$$header" -ot "$$header" \
-a ../include/config.h -ot "$$header" ; then : ; else \
$(PERL) -I$(top_builddir)/scripts \
$(top_builddir)/scripts/header2installheader.pl \
--config-header=../include/config.h \
--srcdir=$$headerbasedir../src \
--dstdir=. \
$$headerbasedir../src/$$header ; done
$$headerbasedir../src/$$header ; \
fi ; \
done
clean-local:
rm -rf xt
install-data-local:
@echo " $(MKDIR_P) '$(DESTDIR)$(xtincludedir)'"; \
......@@ -28,7 +39,7 @@ install-data-local:
done
dist-hook:
rm xt/*.h
rm $(distdir)/xt/*.h
rmdir $(distdir)/xt
@AMDEP_TRUE@@am__include@ @am__quote@../src/xtinclude_Makefile.inc@am__quote@
......@@ -2,8 +2,9 @@ AM_CPPFLAGS = -I../include -I$(srcdir)/../include $(MPI_C_INCLUDE)
AM_FCFLAGS = $(MPI_FC_INCLUDE)
lib_LTLIBRARIES = libyaxt.la
include_HEADERS = yaxt.h
# headers from subdir xt will be installed (after substituting
# definitions from config.h). These must be listed in a sequence in
# which they can be combined in yaxt.h.
libyaxt_la_SOURCES = \
xt/xt_core.h \
xt/xt_handles.h \
......@@ -67,7 +68,7 @@ xtinclude_Makefile.inc: Makefile
for header in $$headers ; do echo " $$header \\" ; done \
| sed '$$s/\\$$//' >>$@
all-local: yaxt.h xtinclude_Makefile.inc
all-local: xtinclude_Makefile.inc
clean-local:
-rm -f *.$(FCMODEXT) i.*.L
......
#ifndef YAXT_H
#define YAXT_H
#ifndef XT_CORE_H
#define XT_CORE_H
#ifdef HAVE_CONFIG_H
#include "config.h"
......@@ -55,4 +55,4 @@ void xt_idxlist_delete(Xt_idxlist idxlist);
*/
int xt_xmap_is_bijective(Xt_xmap xmap);
#endif // YAXT_H
#endif
#include <xt/xt_core.h>
......@@ -54,7 +54,7 @@ test_yaxt_SOURCES = test_yaxt.f90
test_yaxt_LDADD = ../src/libyaxt.la $(MPI_FC_LIB)
test_mpi_generate_datatype_SOURCES = test_mpi_generate_datatype.c tests.h
AM_CFLAGS = -I$(top_srcdir)/src $(MPI_C_INCLUDE)
AM_CFLAGS = -I../inst_headers $(MPI_C_INCLUDE)
AM_FCFLAGS = -I$(top_srcdir)/src -I../src $(MPI_FC_INCLUDE) $(MPI_FC_MOD)
LDADD = ../src/libyaxt.la $(MPI_C_LIB)
......
../src/core
\ No newline at end of file
#include "tests.h"
#include <mpi.h>
#include <yaxt.h>
#include "xt/xt_mpi.h"
#include "yaxt.h"
#include "xt/xt_handles.h"
#include "tests.h"
int main(void) {
const int hsize = 32;
......
#include <stdlib.h>
#include <mpi.h>
#include <yaxt.h>
#define VERBOSE
#include "tests.h"
#include "yaxt.h"
#include "xt/xt_idxlist.h"
#include "xt/xt_idxvec.h"
#include "xt/xt_idxstripes.h"
#include "xt/xt_idxsection.h"
#include "xt/xt_idxlist_collection.h"
#include "test_idxlist_utils.h"
#include "xt/xt_mpi.h"
#include "core/ppm_xfuncs.h"
static void
......
#ifndef TEST_IDXLIST_UTILS_H
#define TEST_IDXLIST_UTILS_H
#include "tests.h"
#include <yaxt.h>
#include "yaxt.h"
#include "xt/xt_idxlist.h"
#include "tests.h"
static void
ref_get_positions_of_indices(Xt_idx * indices, Xt_count num_indices,
......
......@@ -7,14 +7,8 @@
#include "tests.h"
#include "test_idxlist_utils.h"
#include "xt/xt_mpi.h"
#include "core/ppm_xfuncs.h"
#include "xt/xt_idxvec.h"
#include "xt/xt_idxstripes.h"
#include "xt/xt_idxmod.h"
int main(void) {
// init:
......
#include <stdlib.h>
#include "mpi.h"
#include <mpi.h>
#include <yaxt.h>
#include "core/ppm_xfuncs.h"
#include "tests.h"
#include "test_idxlist_utils.h"
#include "yaxt.h"
#include "xt/xt_idxsection.h"
#include "xt/xt_mpi.h"
#include "core/ppm_xfuncs.h"
static void
do_tests(Xt_idxlist idxlist, Xt_idx * ref_indices, Xt_count num_indices,
......
#include <stdlib.h>
#include "mpi.h"
#include <mpi.h>
#include "tests.h"
#include "test_idxlist_utils.h"
#include <yaxt.h>
#include "yaxt.h"
#include "xt/xt_idxstripes.h"
#include "xt/xt_idxvec.h"
#include "xt/xt_mpi.h"
#include "core/ppm_xfuncs.h"
#include "tests.h"
#include "test_idxlist_utils.h"
static void
do_tests(Xt_idxlist idxlist, Xt_idx * ref_indices, Xt_count num_indices);
......
#include <stdlib.h>
#include <assert.h>
#include "mpi.h"
#include <mpi.h>
#include <yaxt.h>
#define VERBOSE
#include "tests.h"
#include "test_idxlist_utils.h"
#include "yaxt.h"
#include "xt/xt_idxvec.h"
#include "xt/xt_mpi.h"
#include "core/ppm_xfuncs.h"
static void
......
#include <mpi.h>
#include "tests.h"
#include "yaxt.h"
#include "xt/xt_mpi.h"
#include <yaxt.h>
#include "tests.h"
#undef FIXED_MPI_ON_BLIZZARD
......
......@@ -2,15 +2,9 @@
#include <mpi.h>
#include "tests.h"
#include <yaxt.h>
#include "yaxt.h"
#include "xt/xt_idxlist.h"
#include "xt/xt_idxvec.h"
#include "xt/xt_redist_p2p.h"
#include "xt/xt_redist_collection.h"
#include "xt/xt_mpi.h"
#include "xt/xt_xmap_all2all.h"
#include "tests.h"
int main(void) {
......
#include <stdlib.h>
#include <mpi.h>
#include "tests.h"
#include <yaxt.h>
#include "yaxt.h"
#include "xt/xt_idxvec.h"
#include "xt/xt_idxsection.h"
#include "xt/xt_redist_p2p.h"
#include "xt/xt_redist_collection.h"
#include "xt/xt_idxstripes.h"
#include "xt/xt_idxlist_collection.h"
#include "xt/xt_idxlist.h"
#include "xt/xt_mpi.h"
#include "xt/xt_xmap_all2all.h"
#include "tests.h"
static inline int imin(int a, int b) {
return (((a)<(b))?(a):(b));
......
Supports Markdown
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