Skip to content

Commit 0d8f3f9

Browse files
committed
Add basic Makefiles.
Signed-off-by: Matthew Emmett <[email protected]>
1 parent dbb1e6a commit 0d8f3f9

File tree

8 files changed

+83
-0
lines changed

8 files changed

+83
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
PFASST := $(abspath ../..)
2+
CXX := mpic++
3+
STACK ?= $(PFASST)/stack
4+
CXXFLAGS ?= -std=c++11 -I$(PFASST)/include -I$(STACK)/include -I$(STACK)/include/eigen3
5+
6+
LDFLAGS ?= -L$(STACK)/lib -Wl,-rpath=$(STACK)/lib -lboost_program_options -lfftw3
7+
8+
all: vanilla_sdc mpi_pfasst serial_mlsdc
9+
10+
vanilla_sdc: vanilla_sdc.cpp
11+
g++ -o $@ $(CXXFLAGS) $^ $(LDFLAGS)
12+
13+
serial_mlsdc: serial_mlsdc.cpp
14+
g++ -o $@ $(CXXFLAGS) $^ $(LDFLAGS)
15+
16+
mpi_pfasst: mpi_pfasst.cpp
17+
mpic++ -o $@ $(CXXFLAGS) $^ $(LDFLAGS)

tests/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
PFASST := $(abspath ..)
3+
SUBDIR := examples
4+
TESTS := test_quadrature
5+
6+
include $(PFASST)/tests/Makefile.tests
7+
include $(PFASST)/tools/make/Makefile.inc

tests/Makefile.tests

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# settings
3+
#
4+
CXX := mpic++
5+
STACK ?= $(PFASST)/stack
6+
CXXFLAGS ?= -std=c++11 -I$(PFASST)/include -I$(STACK)/include -I$(STACK)/include/eigen3
7+
8+
TESTLIBS += -pthread -lboost_program_options -L$(STACK)/lib -Wl,-rpath=$(STACK)/lib -lgmock
9+
MPINPROCS ?= 4
10+
11+
all: $(TESTS) $(MPITESTS)
12+
13+
#
14+
# compile, eg, build/test-quadrature.test from test-quadrature.cpp
15+
#
16+
build/%.test: %.cpp
17+
mkdir -p build
18+
$(CXX) $(CXXFLAGS) -o $@ $^ $(TESTLIBS)
19+
20+
#
21+
# run tests
22+
#
23+
$(TESTS):: $(addsuffix .test,$(addprefix build/,$(TESTS)))
24+
25+
26+
#
27+
# run mpi tests
28+
#
29+
$(MPITESTS):: $(addsuffix .test,$(addprefix build/,$(MPITESTS)))
30+
mpirun -n $(MPINPROCS) build/[email protected]

tests/examples/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
PFASST := $(abspath ../..)
3+
SUBDIR = advection_diffusion scalar vanderpol
4+
5+
all: $(SUBDIR)
6+
7+
include $(PFASST)/tools/make/Makefile.inc
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
PFASST := $(abspath ../../..)
3+
4+
TESTS := test_advection_diffusion
5+
MPITESTS := test_mpi_advection_diffusion
6+
TESTLIBS := -lfftw3
7+
8+
include $(PFASST)/tests/Makefile.tests
9+
include $(PFASST)/tools/make/Makefile.inc

tests/examples/scalar/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
PFASST := $(abspath ../../..)
3+
TESTS := test_scalar_conv test_scalar_highprec
4+
5+
include $(PFASST)/tests/Makefile.tests

tests/examples/vanderpol/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
PFASST := $(abspath ../../..)
3+
TESTS := test_vdp_zeronu_conv
4+
5+
include $(PFASST)/tests/Makefile.tests

tools/make/Makefile.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
$(SUBDIR)::
3+
cd $@ && make

0 commit comments

Comments
 (0)