source: CIVL/examples/xsbench/src/Makefile@ bb03188

main test-branch
Last change on this file since bb03188 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 2.8 KB
Line 
1#===============================================================================
2# User Options
3#===============================================================================
4
5COMPILER = gnu
6OPTIMIZE = yes
7DEBUG = no
8PROFILE = no
9MPI = no
10PAPI = no
11VEC_INFO = no
12VERIFY = no
13BENCHMARK = no
14BINARY_DUMP = no
15BINARY_READ = no
16CIVL = civl
17
18#===============================================================================
19# Program name & source code list
20#===============================================================================
21
22program = XSBench
23
24source = \
25Main.c \
26io.c \
27CalculateXS.c \
28GridInit.c \
29XSutils.c \
30Materials.c
31
32obj = $(source:.c=.o)
33
34#===============================================================================
35# Sets Flags
36#===============================================================================
37
38# Standard Flags
39CFLAGS := -std=gnu99
40
41# Linker Flags
42LDFLAGS = -lm
43
44# Regular gcc Compiler
45ifeq ($(COMPILER),gnu)
46# CC = gcc
47 CC = gcc-mp-4.8
48 CFLAGS += -fopenmp
49endif
50
51# Intel Compiler
52ifeq ($(COMPILER),intel)
53 CC = icc
54 CFLAGS += -openmp
55endif
56
57# BG/Q gcc Cross-Compiler
58ifeq ($(MACHINE),bluegene)
59 CC = mpicc
60endif
61
62# Debug Flags
63ifeq ($(DEBUG),yes)
64 CFLAGS += -g
65 LDFLAGS += -g
66endif
67
68# Profiling Flags
69ifeq ($(PROFILE),yes)
70 CFLAGS += -pg
71 LDFLAGS += -pg
72endif
73
74# Optimization Flags
75ifeq ($(OPTIMIZE),yes)
76 CFLAGS += -O3
77endif
78
79# Compiler Vectorization (needs -O3 flag) information
80ifeq ($(VEC_INFO),yes)
81 CFLAGS += -ftree-vectorizer-verbose=6
82endif
83
84# PAPI source (you may need to provide -I and -L pointing
85# to PAPI depending on your installation
86ifeq ($(PAPI),yes)
87 source += papi.c
88 CFLAGS += -DPAPI
89 #CFLAGS += -I/soft/apps/packages/papi/papi-5.1.1/include
90 #LDFLAGS += -L/soft/apps/packages/papi/papi-5.1.1/lib -lpapi
91 LDFLAGS += -lpapi
92endif
93
94# MPI
95ifeq ($(MPI),yes)
96 CC = mpicc
97 CFLAGS += -DMPI
98endif
99
100# Verification of results mode
101ifeq ($(VERIFY),yes)
102 CFLAGS += -DVERIFICATION
103endif
104
105# Adds outer 'benchmarking' loop to do multiple trials for
106# 1 < threads <= max_threads
107ifeq ($(BENCHMARK),yes)
108 CFLAGS += -DBENCHMARK
109endif
110
111# Binary dump for file I/O based initialization
112ifeq ($(BINARY_DUMP),yes)
113 CFLAGS += -DBINARY_DUMP
114endif
115
116# Binary read for file I/O based initialization
117ifeq ($(BINARY_READ),yes)
118 CFLAGS += -DBINARY_READ
119endif
120
121
122#===============================================================================
123# Targets to Build
124#===============================================================================
125
126$(program): $(obj) XSbench_header.h
127 $(CC) $(CFLAGS) $(obj) -o $@ $(LDFLAGS)
128
129%.o: %.c
130 $(CC) $(CFLAGS) -c $< -o $@
131
132clean:
133 rm -rf $(program) $(obj)
134
135edit:
136 vim -p $(source) papi.c XSbench_header.h
137
138run:
139 ./$(program)
140
141bgqrun:
142 qsub -t 10 -n 1 -O test XSBench
143
144civl: $(source) XSbench_header.h civl_extras.cvl Makefile
145 $(CIVL) verify $(source) civl_extras.cvl
Note: See TracBrowser for help on using the repository browser.