From 1a0a474f948a459dd1254de2764d5c8b889cf1e3 Mon Sep 17 00:00:00 2001 From: Dexter Chua Date: Tue, 15 Dec 2020 01:04:02 +0800 Subject: [PATCH] Tidy up CLAPACK patches (#862) --- packages/CLAPACK/Makefile | 1 + packages/CLAPACK/Makefile.envs | 2 - packages/CLAPACK/make.inc | 81 ++++++++++++++++ .../0001-hacks-for-WebAssembly-build.patch | 92 +------------------ .../0003-Remove-redundant-symbols.patch | 25 +---- 5 files changed, 89 insertions(+), 112 deletions(-) delete mode 100644 packages/CLAPACK/Makefile.envs create mode 100644 packages/CLAPACK/make.inc diff --git a/packages/CLAPACK/Makefile b/packages/CLAPACK/Makefile index 5d9d91f71..d3f6464ed 100644 --- a/packages/CLAPACK/Makefile +++ b/packages/CLAPACK/Makefile @@ -32,3 +32,4 @@ $(SRC)/Makefile: cd $(SRC); \ (cat ../patches/*.patch | patch -p1) \ ) + cp make.inc $(SRC) diff --git a/packages/CLAPACK/Makefile.envs b/packages/CLAPACK/Makefile.envs deleted file mode 100644 index 90787a362..000000000 --- a/packages/CLAPACK/Makefile.envs +++ /dev/null @@ -1,2 +0,0 @@ -CFLAGS_OPT=-Os -s INLINING_LIMIT=5 -LDFLAGS_OPT=-Os -s INLINING_LIMIT=5 diff --git a/packages/CLAPACK/make.inc b/packages/CLAPACK/make.inc new file mode 100644 index 000000000..914b33348 --- /dev/null +++ b/packages/CLAPACK/make.inc @@ -0,0 +1,81 @@ +# -*- Makefile -*- +#################################################################### +# LAPACK make include file. # +# LAPACK, Version 3.2.1 # +# June 2009 # +#################################################################### +# +# See the INSTALL/ directory for more examples. +# +SHELL = /bin/sh +# +# The machine (platform) identifier to append to the library names +# +# WA for WebAssembly +PLAT = _WA +# +# Modify the FORTRAN and OPTS definitions to refer to the +# compiler and desired compiler options for your machine. NOOPT +# refers to the compiler options desired when NO OPTIMIZATION is +# selected. Define LOADER and LOADOPTS to refer to the loader +# and desired load options for your machine. +# +####################################################### +# This is used to compile C libary +#CC = gcc # inherit $CC from emmake +# if no wrapping of the blas library is needed, uncomment next line +#CC = gcc -DNO_BLAS_WRAP +CFLAGS = -O3 -I$(TOPDIR)/INCLUDE -fPIC -DNO_BLAS_WRAP +LDFLAGS = -O3 +LOADER = $(CC) +LOADOPTS = +NOOPT = -O0 -I$(TOPDIR)/INCLUDE +DRVCFLAGS = $(CFLAGS) +F2CCFLAGS = $(CFLAGS) +####################################################################### + +# +# Timer for the SECOND and DSECND routines +# +# Default : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME +# TIMER = EXT_ETIME +# For RS6K : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME_ +# TIMER = EXT_ETIME_ +# For gfortran compiler: SECOND and DSECND will use a call to the INTERNAL FUNCTION ETIME +# TIMER = INT_ETIME +# If your Fortran compiler does not provide etime (like Nag Fortran Compiler, etc...) +# SECOND and DSECND will use a call to the Fortran standard INTERNAL FUNCTION CPU_TIME +TIMER = INT_CPU_TIME +# If neither of this works...you can use the NONE value... In that case, SECOND and DSECND will always return 0 +# TIMER = NONE +# +# The archiver and the flag(s) to use when building archive (library) +# If you system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS= cr +RANLIB = ranlib +# +# The location of BLAS library for linking the testing programs. +# The target's machine-specific, optimized BLAS library should be +# used whenever possible. +# +BLASLIB = ../../blas$(PLAT).bc +# +# Location of the extended-precision BLAS (XBLAS) Fortran library +# used for building and testing extended-precision routines. The +# relevant routines will be compiled and XBLAS will be linked only if +# USEXBLAS is defined. +# +# USEXBLAS = Yes +XBLASLIB = +# XBLASLIB = -lxblas +# +# Names of generated libraries. +# +LAPACKLIB = lapack$(PLAT).bc +F2CLIB = ../../F2CLIBS/libf2c.bc +TMGLIB = tmglib$(PLAT).bc +EIGSRCLIB = eigsrc$(PLAT).bc +LINSRCLIB = linsrc$(PLAT).bc + diff --git a/packages/CLAPACK/patches/0001-hacks-for-WebAssembly-build.patch b/packages/CLAPACK/patches/0001-hacks-for-WebAssembly-build.patch index 2b16d79bc..5b136d780 100644 --- a/packages/CLAPACK/patches/0001-hacks-for-WebAssembly-build.patch +++ b/packages/CLAPACK/patches/0001-hacks-for-WebAssembly-build.patch @@ -1,13 +1,13 @@ -commit 59d50b7beb0f004f3ce690bac9ccbe7b558ee296 +commit 423fe1e36498c0e42508d7d92521f4a4665c60ab Author: Adrian Bauer Date: Tue Sep 19 13:30:49 2017 -0700 Hacks for WebAssembly build in pyodide - + Co-authored-by: Roman Yurchak diff --git a/BLAS/SRC/Makefile b/BLAS/SRC/Makefile -index 4835fd2..a062032 100644 +index 4835fd2..e52e4ed 100644 --- a/BLAS/SRC/Makefile +++ b/BLAS/SRC/Makefile @@ -139,8 +139,7 @@ ALLOBJ=$(SBLAS1) $(SBLAS2) $(SBLAS3) $(DBLAS1) $(DBLAS2) $(DBLAS3) \ @@ -186,89 +186,3 @@ index 223f4da..7491963 100644 single: $(SLASRC) $(ALLAUX) $(SCLAUX) $(ARCH) $(ARCHFLAGS) ../$(LAPACKLIB) $(SLASRC) $(ALLAUX) \ -diff --git a/make.inc b/make.inc -new file mode 100644 -index 0000000..41020d9 ---- /dev/null -+++ b/make.inc -@@ -0,0 +1,80 @@ -+# -*- Makefile -*- -+#################################################################### -+# LAPACK make include file. # -+# LAPACK, Version 3.2.1 # -+# June 2009 # -+#################################################################### -+# -+# See the INSTALL/ directory for more examples. -+# -+SHELL = /bin/sh -+# -+# The machine (platform) identifier to append to the library names -+# -+# WA for WebAssembly -+PLAT = _WA -+# -+# Modify the FORTRAN and OPTS definitions to refer to the -+# compiler and desired compiler options for your machine. NOOPT -+# refers to the compiler options desired when NO OPTIMIZATION is -+# selected. Define LOADER and LOADOPTS to refer to the loader -+# and desired load options for your machine. -+# -+####################################################### -+# This is used to compile C libary -+#CC = gcc # inherit $CC from emmake -+# if no wrapping of the blas library is needed, uncomment next line -+#CC = gcc -DNO_BLAS_WRAP -+CFLAGS = -O3 -I$(TOPDIR)/INCLUDE -fPIC -DNO_BLAS_WRAP -+LDFLAGS = -O3 -+LOADER = $(CC) -+LOADOPTS = -+NOOPT = -O0 -I$(TOPDIR)/INCLUDE -+DRVCFLAGS = $(CFLAGS) -+F2CCFLAGS = $(CFLAGS) -+####################################################################### -+ -+# -+# Timer for the SECOND and DSECND routines -+# -+# Default : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME -+# TIMER = EXT_ETIME -+# For RS6K : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME_ -+# TIMER = EXT_ETIME_ -+# For gfortran compiler: SECOND and DSECND will use a call to the INTERNAL FUNCTION ETIME -+# TIMER = INT_ETIME -+# If your Fortran compiler does not provide etime (like Nag Fortran Compiler, etc...) -+# SECOND and DSECND will use a call to the Fortran standard INTERNAL FUNCTION CPU_TIME -+TIMER = INT_CPU_TIME -+# If neither of this works...you can use the NONE value... In that case, SECOND and DSECND will always return 0 -+# TIMER = NONE -+# -+# The archiver and the flag(s) to use when building archive (library) -+# If you system has no ranlib, set RANLIB = echo. -+# -+ARCH = ar -+ARCHFLAGS= cr -+RANLIB = ranlib -+# -+# The location of BLAS library for linking the testing programs. -+# The target's machine-specific, optimized BLAS library should be -+# used whenever possible. -+# -+BLASLIB = ../../blas$(PLAT).bc -+# -+# Location of the extended-precision BLAS (XBLAS) Fortran library -+# used for building and testing extended-precision routines. The -+# relevant routines will be compiled and XBLAS will be linked only if -+# USEXBLAS is defined. -+# -+# USEXBLAS = Yes -+XBLASLIB = -+# XBLASLIB = -lxblas -+# -+# Names of generated libraries. -+# -+LAPACKLIB = lapack$(PLAT).bc -+F2CLIB = ../../F2CLIBS/libf2c.bc -+TMGLIB = tmglib$(PLAT).bc -+EIGSRCLIB = eigsrc$(PLAT).bc -+LINSRCLIB = linsrc$(PLAT).bc diff --git a/packages/CLAPACK/patches/0003-Remove-redundant-symbols.patch b/packages/CLAPACK/patches/0003-Remove-redundant-symbols.patch index 868a70693..3cf5d5a21 100644 --- a/packages/CLAPACK/patches/0003-Remove-redundant-symbols.patch +++ b/packages/CLAPACK/patches/0003-Remove-redundant-symbols.patch @@ -1,26 +1,9 @@ -From 8aae131e7bf4cfe3979edbbdce21803e1c5f9ac1 Mon Sep 17 00:00:00 2001 -From: Roman Yurchak -Date: Thu, 25 Oct 2018 11:50:14 +0200 -Subject: [PATCH 3/3] Remove redundant symbols +commit 75c2ad0e2f981805b55eef6a8b69e502c07da2bf +Author: Roman Yurchak +Date: Thu Oct 25 11:50:14 2018 +0200 ---- - Makefile | 9 +++++++++ - SRC/Makefile | 30 ++++++++++++++++++++---------- - make.inc | 6 +----- - 3 files changed, 30 insertions(+), 15 deletions(-) + Remove redundant symbols -diff --git a/Makefile b/Makefile -index b3467a6..83baba5 100644 ---- a/Makefile -+++ b/Makefile -@@ -5,6 +5,7 @@ - # - - include make.inc -+include ../Makefile.envs - - all: f2clib lib - #all: f2clib lapack_install lib lapack_testing blas_testing variants_testing diff --git a/SRC/Makefile b/SRC/Makefile index 7491963..0cc1cda 100644 --- a/SRC/Makefile