blob: 8cd18de742fdd5d0b25e4f255f10fdbf1ec47d9a [file] [log] [blame]
Jim Cownie76cb79d2014-05-10 17:02:09 +00001# General Makefile containing all the necessary compiler flags for the tests
2
3# modify CC and CFLAGS for OpenMP C compilers
4# modify FC and FFLAGS for OpenMP Fortran compilers
5
6
7# Content:
8#########################################################
9
10# 1. Basic usage
11# 2. General testsuite settings
12# 3. Compiler selection and Flags
13
14#########################################################
15
16
17#########################################################
18# 1. Basic usage
19#########################################################
20# make ctest generate c test "ctest"
21# make ftest generate fortran test "ftest"
22# make clean removes all sources and binaries
23# make cleanall removes sources,binaries and logfiles
24
25
26#########################################################
27# 2. General testsuite settings
28#########################################################
29
30# For general testsuite settings see the configuration file
31# ompts.conf
32
33#########################################################
34# 3. Compiler selection and Flags
35#########################################################
36
37# GNU Compiler
38CC = gcc
39CFLAGS = -fopenmp -lm -O3
40CFLAGS = -fopenmp -lm -O3
41FC = gfortran
42FFLAGS = -fopenmp -lm
43FFLAGS = -fopenmp -lm -O3
44
45
46# Fujitsu Compilers:
47#CC = fcc
48#CFLAGS = -KOMP,fast_GP2=2
49#FC=frt
50#FFLAGS=-KOMP,fast_GP2=2 -w -Am -X9 -Fixed
51
52
53# PGI compilers
54#CC = pgcc
55#CFLAGS = -mp
56#CFLAGS = -mp -DVERBOSE
57#CFLAGS = -fast -mp
58
59#FC = pgf90
60#FFLAGS = -fast -mp
61#FFLAGS = -mp -g
62
63
64# Intel compilers:
65#CC = icc
66#CFLAGS = -O3 -ip -openmp
67#CFLAGS = -Wall -O0 -openmp
68#CFLAGS = -openmp -lm
69#CFLAGS = -openmp -lm -DVERBOSE
70
71#FC = ifort
72#FFLAGS = -openmp -lm -fpp
73
74# Omni compilers:
75#CC = ompcc
76#CFLAGS = -O3 -lm
77
78
79# Assure compilers:
80#CC = assurec
81#CFLAGS = -O3 -WApname=project -DUSE_ASSURE=1
82#FC =
83#FFLAGS =
84
85# NEC:
86#CC = c++
87#CC = sxc++
88#CFLAGS = -Popenmp
89
90#FC=sxf90
91#FFLAGS= -Popenmp
92
93
94# Hitachi:
95#CC = xcc
96#CFLAGS = -O4 -pvec +Op -parallel -omp
97#FC =
98#FFLAGS =
99
100
101# SGI:
102#CC = cc
103#CFLAGS = -mp -lm
104#FC =
105#FFLAGS =
106
107
108# IBM compilers:
109#CC = xlc_r
110#CFLAGS = -qsmp=omp -lm
111
112
113#FC=xlf90_r
114#FFLAGS=-qsmp=omp -qfixed=132 -qlanglvl=extended
115
116
117# SUN compilers
118#CC = cc
119#CFLAGS = -fast -xopenmp -lm
120
121#FC =f90
122#FFLAGS = -xopenmp -fast -lm
123
124
125# open64 compilers
126# remark: -I. was a workaround because the installation came without omp.h file
127#CC = opencc
128#CFLAGS = -O0 -openmp -lm -I. -lomp -lpthread
129#CFLAGS = -O0 -openmp -lm -I /home/matthew/opt/usr/include -lpthread
130#CFLAGS = -openmp -lm
131
132#FC = openf90
133#FFLAGS = -O0 -openmp -lm -lomp -lpthread
134
135
136#Pathscale Compiler
137#CC = pathcc
138#CFLAGS = -mp -Ofast -lm
139
140#FC=pathf90
141#FFLAGS= -mp -Ofast -lm
142
143
144#OpenUH Compiler
145#CC = uhcc
146#CFLAGS = -mp
147
148#FC = uhf90
149#FFLAGS = -mp
150
151#########################################################################
152
153help:
154 @echo "OpenMP Validation Suite, v3.0"
155 @echo "(C) University of Stuttgart, University of Houston"
156 @echo ""
157 @echo "Do make [rule], where rule may be one of:"
158 @echo " ctest"
159 @echo " Build and run the OpenMP/C validation tests."
160 @echo " ftest"
161 @echo " Build and run the OpenMP/Fortran validation tests."
162 @echo " print_compile_options"
163 @echo " Display the default compiler and compiler options being tested"
164 @echo " cleansrcs"
165 @echo " Remove sources generated from the templates"
166 @echo " cleanbins"
167 @echo " Remove executables from bin/ directory"
168 @echo " cleanouts"
169 @echo " Remove all *.out files from bin/ directory"
170 @echo " cleanlogs"
171 @echo " Remove all *.log files from bin/ directory"
172 @echo " clean"
173 @echo " Remove all sources and executables from bin/ directory"
174 @echo " cleanall"
175 @echo " Remove the entire bin/ directory"
176
177omp_my_sleep:
178 mkdir -p bin/c
179 cp omp_my_sleep.h bin/c/
180omp_testsuite: omp_testsuite.h
181 mkdir -p bin/c
182 cp omp_testsuite.h bin/c/
183omp_testsuite.h: ompts-c.conf c/*
184 ./ompts_makeHeader.pl -f=ompts-c.conf -t=c
185.c.o: omp_testsuite omp_my_sleep
186 $(CC) $(CFLAGS) -c $<
187
188ctest: omp_my_sleep omp_testsuite
189 ./runtest.pl --lang=c testlist-c.txt
190
191ftest:
192 mkdir -p bin/fortran
193 cp omp_testsuite.f bin/fortran
194 cp omp_my_sleep.f bin/fortran
195 ./runtest.pl --lang=fortran testlist-f.txt
196
197print_compile_options:
198 @echo "-------------------"
199 @echo "C compiler"
200 @echo "-------------------"
201 @echo "compilation: $(CC) $(CFLAGS)"
202 @$(CC) --version
203 @echo "-------------------"
204 @echo "Fortran compiler"
205 @echo "-------------------"
206 @echo "compilation: $(FC) $(FFLAGS)"
207 @$(FC) --version
208
209cleansrcs:
210 find bin/ -iname "*.[cf]" -exec rm {} \;
211cleanbins:
212 find bin/ -perm /a+x -type f -exec rm {} \;
213cleanouts:
214 find bin/ -iname "*.out" -exec rm {} \;
215cleanlogs:
216 find bin/ -iname "*.log" -exec rm {} \;
217
218clean: cleansrcs cleanbins
219
220cleanall:
221 rm -rf bin/
222