This repository has been archived by the owner on Aug 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
230 lines (202 loc) · 5.74 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
TOPDIR = .
include ./Makefile.system
BLASDIRS = interface driver/level2 driver/level3 driver/others
ifndef DYNAMIC_ARCH
BLASDIRS += kernel
endif
ifdef SANITY_CHECK
BLASDIRS += reference
endif
SUBDIRS = $(BLASDIRS) lapack
SUBDIRS_ALL = $(SUBDIRS) test ctest exports benchmark ../laswp ../bench
.PHONY : all libs netlib test ctest shared
.NOTPARALLEL : all libs prof lapack-test
all :: libs netlib tests shared
@echo
@echo " GotoBLAS build complete."
@echo
@echo " OS ... $(OSNAME) "
@echo " Architecture ... $(ARCH) "
ifndef BINARY64
@echo " BINARY ... 32bit "
else
@echo " BINARY ... 64bit "
endif
@echo " C compiler ... $(C_COMPILER) (command line : $(CC))"
@echo " Fortran compiler ... $(F_COMPILER) (command line : $(FC))"
ifneq ($(OSNAME), AIX)
@echo -n " Library Name ... $(LIBNAME)"
else
@echo " Library Name ... $(LIBNAME)"
endif
ifndef SMP
@echo " (Single threaded) "
else
@echo " (Multi threaded; Max num-threads is $(NUM_THREADS))"
endif
@echo
shared :
ifeq ($(OSNAME), Linux)
$(MAKE) -C exports so
-ln -fs $(LIBSONAME) libgoto2.so
endif
ifeq ($(OSNAME), FreeBSD)
$(MAKE) -C exports so
-ln -fs $(LIBSONAME) libgoto2.so
endif
ifeq ($(OSNAME), NetBSD)
$(MAKE) -C exports so
-ln -fs $(LIBSONAME) libgoto2.so
endif
ifeq ($(OSNAME), Darwin)
$(MAKE) -C exports dyn
-ln -fs $(LIBDYNNAME) libgoto2.dylib
endif
ifeq ($(OSNAME), WINNT)
$(MAKE) -C exports dll
# -ln -fs $(LIBDLLNAME) libgoto2.dll
endif
ifeq ($(OSNAME), CYGWIN_NT)
$(MAKE) -C exports dll
-ln -fs $(LIBDLLNAME) libgoto2.dll
endif
tests :
ifndef NOFORTRAN
ifndef TARGET
ifndef CROSS
touch $(LIBNAME)
ifndef NO_FBLAS
$(MAKE) -C test all
endif
ifndef NO_CBLAS
$(MAKE) -C ctest all
endif
endif
endif
endif
libs :
-ln -fs $(LIBNAME) libgoto2.$(LIBSUFFIX)
for d in $(SUBDIRS) ; \
do if test -d $$d; then \
$(MAKE) -C $$d $(@F) || exit 1 ; \
fi; \
done
ifdef DYNAMIC_ARCH
$(MAKE) -C kernel commonlibs || exit 1
for d in $(DYNAMIC_CORE) ; \
do $(MAKE) GOTOBLAS_MAKEFILE= -C kernel TARGET_CORE=$$d kernel || exit 1 ;\
done
endif
prof : prof_blas prof_lapack
prof_blas :
ln -fs $(LIBNAME_P) libgoto2_p.$(LIBSUFFIX)
for d in $(SUBDIRS) ; \
do if test -d $$d; then \
$(MAKE) -C $$d prof || exit 1 ; \
fi; \
done
ifdef DYNAMIC_ARCH
$(MAKE) -C kernel commonprof || exit 1
endif
blas :
ln -fs $(LIBNAME) libgoto2.$(LIBSUFFIX)
for d in $(BLASDIRS) ; \
do if test -d $$d; then \
$(MAKE) -C $$d libs || exit 1 ; \
fi; \
done
hpl :
ln -fs $(LIBNAME) libgoto2.$(LIBSUFFIX)
for d in $(BLASDIRS) ../laswp exports ; \
do if test -d $$d; then \
$(MAKE) -C $$d $(@F) || exit 1 ; \
fi; \
done
ifdef DYNAMIC_ARCH
$(MAKE) -C kernel commonlibs || exit 1
for d in $(DYNAMIC_CORE) ; \
do $(MAKE) GOTOBLAS_MAKEFILE= -C kernel TARGET_CORE=$$d kernel || exit 1 ;\
done
endif
hpl_p :
ln -fs $(LIBNAME_P) libgoto2_p.$(LIBSUFFIX)
for d in $(SUBDIRS) ../laswp exports ; \
do if test -d $$d; then \
$(MAKE) -C $$d $(@F) || exit 1 ; \
fi; \
done
netlib : lapack-3.1.1 patch.for_lapack-3.1.1 lapack-3.1.1/make.inc
ifndef NOFORTRAN
-@$(MAKE) -C lapack-3.1.1 lapacklib
endif
prof_lapack : lapack-3.1.1 lapack-3.1.1/make.inc
-@$(MAKE) -C lapack-3.1.1 lapack_prof
lapack-3.1.1/make.inc :
ifndef NOFORTRAN
-@echo "FORTRAN = $(FC)" > lapack-3.1.1/make.inc
-@echo "OPTS = $(FFLAGS)" >> lapack-3.1.1/make.inc
-@echo "POPTS = $(FPFLAGS)" >> lapack-3.1.1/make.inc
-@echo "NOOPT = $(FFLAGS) -O0" >> lapack-3.1.1/make.inc
-@echo "PNOOPT = $(FPFLAGS) -O0" >> lapack-3.1.1/make.inc
-@echo "LOADOPTS = $(FFLAGS) $(EXTRALIB)" >> lapack-3.1.1/make.inc
-@echo "ARCH = $(AR)" >> lapack-3.1.1/make.inc
-@echo "RANLIB = $(RANLIB)" >> lapack-3.1.1/make.inc
-@echo "LAPACKLIB = ../$(LIBNAME)" >> lapack-3.1.1/make.inc
-@echo "LAPACKLIB_P = ../$(LIBNAME_P)" >> lapack-3.1.1/make.inc
-@echo "SUFFIX = $(SUFFIX)" >> lapack-3.1.1/make.inc
-@echo "PSUFFIX = $(PSUFFIX)" >> lapack-3.1.1/make.inc
# -@echo "CEXTRALIB = $(CEXTRALIB)" >> lapack-3.1.1/make.inc
-@cat make.inc >> lapack-3.1.1/make.inc
endif
lapack-3.1.1 : lapack-3.1.1.tgz
ifndef NOFORTRAN
@if test `$(MD5SUM) lapack-3.1.1.tgz | $(AWK) '{print $$1}'` = 00b21551a899bcfbaa7b8443e1faeef9; then \
echo $(TAR) zxf $< ;\
$(TAR) zxf $< && (cd lapack-3.1.1; $(PATCH) -p1 < ../patch.for_lapack-3.1.1) ;\
else \
echo " lapack-3.1.1.tgz check sum is wrong (Please use orignal)." ;\
rm -rf lapack-3.1.1 ;\
fi
endif
lapack-3.1.1.tgz :
ifndef NOFORTRAN
-curl -O http://www.netlib.org/lapack/lapack-3.1.1.tgz
endif
large.tgz :
ifndef NOFORTRAN
-curl -O http://www.netlib.org/lapack/timing/large.tgz
endif
timing.tgz :
ifndef NOFORTRAN
-curl -O http://www.netlib.org/lapack/timing/timing.tgz
endif
lapack-timing : lapack-3.1.1 large.tgz timing.tgz
ifndef NOFORTRAN
(cd lapack-3.1.1; $(TAR) zxf ../timing.tgz TIMING)
(cd lapack-3.1.1/TIMING; $(TAR) zxf ../../large.tgz )
make -C lapack-3.1.1 tmglib
make -C lapack-3.1.1/TIMING
endif
lapack-test :
$(MAKE) -C lapack-3.1.1 tmglib
$(MAKE) -C lapack-3.1.1/TESTING xeigtstc xeigtstd xeigtsts xeigtstz xlintstc xlintstd xlintstds xlintsts xlintstz xlintstzc
@rm -f lapack-3.1.1/TESTING/*.out
$(MAKE) -j 1 -C lapack-3.1.1/TESTING
$(GREP) failed lapack-3.1.1/TESTING/*.out
dummy :
clean ::
@for d in $(SUBDIRS_ALL) ; \
do if test -d $$d; then \
$(MAKE) -C $$d $(@F) || exit 1 ; \
fi; \
done
ifdef DYNAMIC_ARCH
@$(MAKE) -C kernel clean
endif
@rm -f *.$(LIBSUFFIX) *.so *~ *.exe getarch getarch_2nd *.dll *.lib *.$(SUFFIX) *.dwf libgoto2.$(LIBSUFFIX) libgoto2_p.$(LIBSUFFIX) *.lnk myconfig.h
@rm -f Makefile.conf config.h Makefile_kernel.conf config_kernel.h st* *.dylib
@if test -d lapack-3.1.1; then \
echo deleting lapack-3.1.1; \
rm -rf lapack-3.1.1 ;\
fi
@echo Done.