-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
79 lines (62 loc) · 1.33 KB
/
Makefile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# These flags work with pretty much any compiler
OPT = -O3
# Fortran 2008 compiler
FC = ifort
ifeq ($(FC),ifort)
FFLAGS = $(OPT) -std08 -coarray
endif
ifeq ($(FC),gfortran)
FFLAGS = $(OPT) -std=f2008 -fcoarray=single
endif
# OpenMP C99 compiler
OMPCC = icc
ifeq ($(OMPCC),icc)
OMPCFLAGS = $(OPT) -qopenmp
else # GCC and Clang, at least
OMPCFLAGS = $(OPT) -fopenmp
endif
# OpenSHMEM compiler wrapper script
OSHCC = oshcc
OSHCFLAGS = $(CFLAGS)
# UPC Compiler
UPCC = gupc
# Berkeley UPC
ifeq ($(UPCC),upcc)
UPCFLAGS = -Wc,$(CFLAGS)
endif
# Intrepid GCC UPC
ifeq ($(UPCC),gupc)
UPCFLAGS = $(CFLAGS) -x upc
endif
# MPI Compiler
MPICC = mpicc
MPICFLAGS = $(CFLAGS)
TESTS = shmem.x upc.x mpirma.x openmp1.x openmp2.x openmp3.x
# Intel Fortran does not support coarrays on Mac...
ifeq ($(FC),ifort)
ifeq ($(shell uname),Linux)
TESTS += coarray.x
endif
endif
ifeq ($(FC),gfortran)
TESTS += coarray.x
endif
all: $(TESTS)
upc.x: upc.upc
$(UPCC) $(UPCFLAGS) $< -o $@
shmem.x: shmem.c
$(OSHCC) $(OSHCFLAGS) $< -o $@
mpirma.x: mpirma.c
$(MPICC) $(MPICFLAGS) $< -o $@
openmp1.x: openmp1.c
$(OMPCC) $(OMPCFLAGS) $< -o $@
openmp2.x: openmp2.c
$(OMPCC) $(OMPCFLAGS) $< -o $@
openmp3.x: openmp3.c
$(OMPCC) $(OMPCFLAGS) $< -o $@
coarray.x: coarray.f90
$(FC) $(FFLAGS) $< -o $@
clean:
-rm -f *.o
-rm -f $(TESTS)
-rm -fr *.dSYM