xianyi/OpenBLAS — Issue #72: Use lapack 3.4.0 instead of 3.1.1
Author: MarbolanGos
Created: 2011-11-23 12:45:09+00:00
State: open

As lapack was updated I was thinking is it possible easily to use it.
I made those changes to the Makefile:

--- Makefile.old	2011-11-23 13:36:44.000000000 +0100
+++ Makefile	2011-11-23 13:38:38.000000000 +0100
@@ -195,47 +195,47 @@
netlib :

else
-netlib : lapack-3.1.1 patch.for_lapack-3.1.1 lapack-3.1.1/make.inc
+netlib : lapack-3.4.0 patch.for_lapack-3.4.0 lapack-3.4.0/make.inc
ifndef NOFORTRAN
-	-@$(MAKE) -C lapack-3.1.1 lapacklib
+	-@$(MAKE) -C lapack-3.4.0 lapacklib
endif
endif

-prof_lapack : lapack-3.1.1 lapack-3.1.1/make.inc
-	-@$(MAKE) -C lapack-3.1.1 lapack_prof
+prof_lapack : lapack-3.4.0 lapack-3.4.0/make.inc
+	-@$(MAKE) -C lapack-3.4.0 lapack_prof

-lapack-3.1.1/make.inc :
+lapack-3.4.0/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
+	-@echo "FORTRAN = $(FC)" > lapack-3.4.0/make.inc
+	-@echo "OPTS = $(FFLAGS)" >> lapack-3.4.0/make.inc
+	-@echo "POPTS = $(FPFLAGS)" >> lapack-3.4.0/make.inc
+	-@echo "NOOPT = $(FFLAGS) -O0" >> lapack-3.4.0/make.inc
+	-@echo "PNOOPT = $(FPFLAGS) -O0" >> lapack-3.4.0/make.inc
+	-@echo "LOADOPTS = $(FFLAGS) $(EXTRALIB)" >> lapack-3.4.0/make.inc
+	-@echo "ARCH = $(AR)" >> lapack-3.4.0/make.inc
+	-@echo "RANLIB = $(RANLIB)" >> lapack-3.4.0/make.inc
+	-@echo "LAPACKLIB = ../$(LIBNAME)" >> lapack-3.4.0/make.inc
+	-@echo "LAPACKLIB_P = ../$(LIBNAME_P)" >> lapack-3.4.0/make.inc
+	-@echo "SUFFIX = $(SUFFIX)" >> lapack-3.4.0/make.inc
+	-@echo "PSUFFIX = $(PSUFFIX)" >> lapack-3.4.0/make.inc
+#	-@echo "CEXTRALIB = $(CEXTRALIB)" >> lapack-3.4.0/make.inc
+	-@cat make.inc >> lapack-3.4.0/make.inc
endif

-lapack-3.1.1 : lapack-3.1.1.tgz
+lapack-3.4.0 : lapack-3.4.0.tgz
ifndef NOFORTRAN
-	@if test `$(MD5SUM) lapack-3.1.1.tgz | $(AWK) '{print $$1}'` = 00b21551a899bcfbaa7b8443e1faeef9; then \
+	@if test `$(MD5SUM) lapack-3.4.0.tgz | $(AWK) '{print $$1}'` = 00b21551a899bcfbaa7b8443e1faeef9; then \
echo $(TAR) zxf $< ;\
-	$(TAR) zxf $< && (cd lapack-3.1.1; $(PATCH) -p1 < ../patch.for_lapack-3.1.1) ;\
+	$(TAR) zxf $< && (cd lapack-3.4.0; $(PATCH) -p1 < ../patch.for_lapack-3.4.0) ;\
else \
-	echo "	lapack-3.1.1.tgz check sum is wrong (Please use orignal)." ;\
-	rm -rf lapack-3.1.1 ;\
+	echo "	lapack-3.4.0.tgz check sum is wrong (Please use orignal)." ;\
+	rm -rf lapack-3.4.0 ;\
fi
endif

-lapack-3.1.1.tgz :
+lapack-3.4.0.tgz :
ifndef NOFORTRAN
-	-wget http://www.netlib.org/lapack/lapack-3.1.1.tgz
+	-wget http://www.netlib.org/lapack/lapack-3.4.0.tgz
endif

large.tgz :
@@ -248,21 +248,21 @@
-wget http://www.netlib.org/lapack/timing/timing.tgz
endif

-lapack-timing : lapack-3.1.1 large.tgz timing.tgz
+lapack-timing : lapack-3.4.0 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
+	(cd lapack-3.4.0; $(TAR) zxf ../timing.tgz TIMING)
+	(cd lapack-3.4.0/TIMING; $(TAR) zxf ../../large.tgz )
+	make -C lapack-3.4.0 tmglib
+	make -C lapack-3.4.0/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
+	$(MAKE) -C lapack-3.4.0 tmglib
+	$(MAKE) -C lapack-3.4.0/TESTING xeigtstc xeigtstd xeigtsts xeigtstz xlintstc xlintstd xlintstds xlintsts xlintstz xlintstzc
+	@rm	-f lapack-3.4.0/TESTING/*.out
+	$(MAKE) -j 1 -C lapack-3.4.0/TESTING
+	$(GREP) failed lapack-3.4.0/TESTING/*.out

dummy :

@@ -280,9 +280,9 @@
#endif
@rm -f *.$(LIBSUFFIX) *.so *~ *.exe getarch getarch_2nd *.dll *.lib *.$(SUFFIX) *.dwf libopenblas.$(LIBSUFFIX) libopenblas_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 ;\
+	@if test -d lapack-3.4.0; then \
+	echo deleting lapack-3.4.0; \
+	rm -rf lapack-3.4.0 ;\
fi
@rm -f *.grd Makefile.conf_last config_last.h
-	@echo Done.
\ Pas de fin de ligne à la fin du fichier.
+	@echo Done.

Copied patch.for_lapack-3.1.1 into patch.for_lapack-3.4.0 and all compiled correctly in my:
OpenBLAS build complete.

OS ... Linux
Architecture ... x86_64
BINARY ... 64bit
C compiler ... GCC (command line : gcc)
Fortran compiler ... GFORTRAN (command line : gfortran)
Library Name ... libopenblas_penrynp-r0.1alpha2.4.a (Multi threaded; Max num-threads is 8)