File: makefile

package info (click to toggle)
mpi4py 4.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,540 kB
  • sloc: python: 34,465; ansic: 16,475; makefile: 614; sh: 325; cpp: 193; f90: 178
file content (49 lines) | stat: -rw-r--r-- 1,022 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
include ../config.mk
.PHONY: default build test clean
default: build test clean

LANGS = py c cxx f90
MASTERS = $(foreach lang,$(LANGS),cpi-master-$(lang).exe)
WORKERS = $(foreach lang,$(LANGS),cpi-worker-$(lang).exe)

build: $(MASTERS) $(WORKERS)

MPIEXEC = mpiexec -n 1
test: build
	@for i in $(LANGS); do \
	    for j in $(LANGS); do \
                 $(MPIEXEC) ./cpi-master-$$i.exe ./cpi-worker-$$j.exe; \
	    done; \
	done

clean:
	$(RM) -r $(MASTERS) $(WORKERS) __pycache__


# Python
cpi-master-py.exe: cpi-master.py
	echo '#!'`which python` > $@
	cat $< >> $@
	chmod +x $@
cpi-worker-py.exe: cpi-worker.py
	echo '#!'`which python` > $@
	cat $< >> $@
	chmod +x $@

# C
cpi-master-c.exe: cpi-master.c
	$(MPICC) $< -o $@
cpi-worker-c.exe: cpi-worker.c
	$(MPICC) $< -o $@

# C++
cpi-master-cxx.exe: cpi-master.cxx
	$(MPICXX) $< -o $@
cpi-worker-cxx.exe: cpi-worker.cxx
	$(MPICXX) $< -o $@

# Fortran 90
cpi-master-f90.exe: cpi-master.f90
	$(MPIFORT) $< -o $@
cpi-worker-f90.exe: cpi-worker.f90
	$(MPIFORT) $< -o $@