2 include ./Makefile.system
4 BLASDIRS = interface driver/level2 driver/level3 driver/others
19 PREFIX = /opt/OpenBLAS
23 ifneq ($(NO_LAPACK), 1)
27 SUBDIRS_ALL = $(SUBDIRS) test ctest utest exports benchmark ../laswp ../bench
29 .PHONY : all libs netlib test ctest shared install
30 .NOTPARALLEL : all libs prof lapack-test install
32 all :: libs netlib tests shared
34 @echo " GotoBLAS build complete."
36 @echo " OS ... $(OSNAME) "
37 @echo " Architecture ... $(ARCH) "
39 @echo " BINARY ... 32bit "
41 @echo " BINARY ... 64bit "
43 @echo " C compiler ... $(C_COMPILER) (command line : $(CC))"
44 @echo " Fortran compiler ... $(F_COMPILER) (command line : $(FC))"
45 ifneq ($(OSNAME), AIX)
46 @echo -n " Library Name ... $(LIBNAME)"
48 @echo " Library Name ... $(LIBNAME)"
52 @echo " (Single threaded) "
54 @echo " (Multi threaded; Max num-threads is $(NUM_THREADS))"
59 ifeq ($(OSNAME), Linux)
61 -ln -fs $(LIBSONAME) libopenblas.so
63 ifeq ($(OSNAME), FreeBSD)
65 -ln -fs $(LIBSONAME) libopenblas.so
67 ifeq ($(OSNAME), NetBSD)
69 -ln -fs $(LIBSONAME) libopenblas.so
71 ifeq ($(OSNAME), Darwin)
72 $(MAKE) -C exports dyn
73 -ln -fs $(LIBDYNNAME) libopenblas.dylib
75 ifeq ($(OSNAME), WINNT)
76 $(MAKE) -C exports dll
77 -ln -fs $(LIBDLLNAME) libopenblas.dll
79 ifeq ($(OSNAME), CYGWIN_NT)
80 $(MAKE) -C exports dll
81 -ln -fs $(LIBDLLNAME) libopenblas.dll
103 ifeq ($(CORE), UNKOWN)
104 $(error OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail.)
106 -ln -fs $(LIBNAME) libopenblas.$(LIBSUFFIX)
107 for d in $(SUBDIRS) ; \
108 do if test -d $$d; then \
109 $(MAKE) -C $$d $(@F) || exit 1 ; \
112 #Save the config files for installation
113 cp Makefile.conf Makefile.conf_last
114 cp config.h config_last.h
116 $(MAKE) -C kernel commonlibs || exit 1
117 for d in $(DYNAMIC_CORE) ; \
118 do $(MAKE) GOTOBLAS_MAKEFILE= -C kernel TARGET_CORE=$$d kernel || exit 1 ;\
120 echo DYNAMIC_ARCH=1 >> Makefile.conf_last
124 prof : prof_blas prof_lapack
127 ln -fs $(LIBNAME_P) libopenblas_p.$(LIBSUFFIX)
128 for d in $(SUBDIRS) ; \
129 do if test -d $$d; then \
130 $(MAKE) -C $$d prof || exit 1 ; \
134 $(MAKE) -C kernel commonprof || exit 1
138 ln -fs $(LIBNAME) libopenblas.$(LIBSUFFIX)
139 for d in $(BLASDIRS) ; \
140 do if test -d $$d; then \
141 $(MAKE) -C $$d libs || exit 1 ; \
146 ln -fs $(LIBNAME) libopenblas.$(LIBSUFFIX)
147 for d in $(BLASDIRS) ../laswp exports ; \
148 do if test -d $$d; then \
149 $(MAKE) -C $$d $(@F) || exit 1 ; \
153 $(MAKE) -C kernel commonlibs || exit 1
154 for d in $(DYNAMIC_CORE) ; \
155 do $(MAKE) GOTOBLAS_MAKEFILE= -C kernel TARGET_CORE=$$d kernel || exit 1 ;\
160 ln -fs $(LIBNAME_P) libopenblas_p.$(LIBSUFFIX)
161 for d in $(SUBDIRS) ../laswp exports ; \
162 do if test -d $$d; then \
163 $(MAKE) -C $$d $(@F) || exit 1 ; \
167 ifeq ($(NO_LAPACK), 1)
171 netlib : lapack-3.1.1 patch.for_lapack-3.1.1 lapack-3.1.1/make.inc
173 -@$(MAKE) -C lapack-3.1.1 lapacklib
177 prof_lapack : lapack-3.1.1 lapack-3.1.1/make.inc
178 -@$(MAKE) -C lapack-3.1.1 lapack_prof
180 lapack-3.1.1/make.inc :
182 -@echo "FORTRAN = $(FC)" > lapack-3.1.1/make.inc
183 -@echo "OPTS = $(FFLAGS)" >> lapack-3.1.1/make.inc
184 -@echo "POPTS = $(FPFLAGS)" >> lapack-3.1.1/make.inc
185 -@echo "NOOPT = $(FFLAGS) -O0" >> lapack-3.1.1/make.inc
186 -@echo "PNOOPT = $(FPFLAGS) -O0" >> lapack-3.1.1/make.inc
187 -@echo "LOADOPTS = $(FFLAGS) $(EXTRALIB)" >> lapack-3.1.1/make.inc
188 -@echo "ARCH = $(AR)" >> lapack-3.1.1/make.inc
189 -@echo "RANLIB = $(RANLIB)" >> lapack-3.1.1/make.inc
190 -@echo "LAPACKLIB = ../$(LIBNAME)" >> lapack-3.1.1/make.inc
191 -@echo "LAPACKLIB_P = ../$(LIBNAME_P)" >> lapack-3.1.1/make.inc
192 -@echo "SUFFIX = $(SUFFIX)" >> lapack-3.1.1/make.inc
193 -@echo "PSUFFIX = $(PSUFFIX)" >> lapack-3.1.1/make.inc
194 # -@echo "CEXTRALIB = $(CEXTRALIB)" >> lapack-3.1.1/make.inc
195 -@cat make.inc >> lapack-3.1.1/make.inc
198 lapack-3.1.1 : lapack-3.1.1.tgz
200 @if test `$(MD5SUM) lapack-3.1.1.tgz | $(AWK) '{print $$1}'` = 00b21551a899bcfbaa7b8443e1faeef9; then \
201 echo $(TAR) zxf $< ;\
202 $(TAR) zxf $< && (cd lapack-3.1.1; $(PATCH) -p1 < ../patch.for_lapack-3.1.1) ;\
204 echo " lapack-3.1.1.tgz check sum is wrong (Please use orignal)." ;\
205 rm -rf lapack-3.1.1 ;\
211 -wget http://www.netlib.org/lapack/lapack-3.1.1.tgz
216 -wget http://www.netlib.org/lapack/timing/large.tgz
221 -wget http://www.netlib.org/lapack/timing/timing.tgz
224 lapack-timing : lapack-3.1.1 large.tgz timing.tgz
226 (cd lapack-3.1.1; $(TAR) zxf ../timing.tgz TIMING)
227 (cd lapack-3.1.1/TIMING; $(TAR) zxf ../../large.tgz )
228 make -C lapack-3.1.1 tmglib
229 make -C lapack-3.1.1/TIMING
234 $(MAKE) -C lapack-3.1.1 tmglib
235 $(MAKE) -C lapack-3.1.1/TESTING xeigtstc xeigtstd xeigtsts xeigtstz xlintstc xlintstd xlintstds xlintsts xlintstz xlintstzc
236 @rm -f lapack-3.1.1/TESTING/*.out
237 $(MAKE) -j 1 -C lapack-3.1.1/TESTING
238 $(GREP) failed lapack-3.1.1/TESTING/*.out
243 $(MAKE) -f Makefile.install install
246 @for d in $(SUBDIRS_ALL) ; \
247 do if test -d $$d; then \
248 $(MAKE) -C $$d $(@F) || exit 1 ; \
252 @$(MAKE) -C kernel clean
254 @rm -f *.$(LIBSUFFIX) *.so *~ *.exe getarch getarch_2nd *.dll *.lib *.$(SUFFIX) *.dwf libopenblas.$(LIBSUFFIX) libopenblas_p.$(LIBSUFFIX) *.lnk myconfig.h
255 @rm -f Makefile.conf config.h Makefile_kernel.conf config_kernel.h st* *.dylib
256 @if test -d lapack-3.1.1; then \
257 echo deleting lapack-3.1.1; \
258 rm -rf lapack-3.1.1 ;\
260 @rm -f *.grd Makefile.conf_last config_last.h