Deepfreeze essential parts of the encodings module. ### Description

This is a split off from #3582.

Deepfreeze essential parts of encodings module (encodings.\__init__, encodings.utf_8, and encodings.aliases), which is required during the Python bootstrap.

From 5e4cde22a2cf6b573c941a307ec1c5310b74715f Mon Sep 17 00:00:00 2001
From: Gyeongjae Choi <def6488@gmail.com>
Date: Tue, 14 Jun 2022 01:14:13 +0000
Subject: [PATCH 2/2] Remove non-essential build targets

For now sparseqr is the only package that uses suitesparse,
and we want to minimize the build time. So this patch removes
some build targets of suitesparse that are not used by sparseqr.
---
 Makefile                                 | 23 +----------------------
 SuiteSparse_config/SuiteSparse_config.mk |  4 ++--
 metis-5.1.0/CMakeLists.txt               |  1 -
 3 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/Makefile b/Makefile
index ed722693..6af48982 100644
--- a/Makefile
+++ b/Makefile
@@ -44,31 +44,14 @@ endif
 #       sudo make install INSTALL=/usr/local
 # See SuiteSparse/README.md for more details.
 # (note that CSparse is not installed; CXSparse is installed instead)
-install: metisinstall gbinstall moninstall
+install: metisinstall
 	( cd SuiteSparse_config && $(MAKE) install )
-	# ( cd Mongoose  && $(MAKE) CMAKE_OPTIONS='$(CMAKE_OPTIONS)' install )
 	( cd AMD && $(MAKE) install )
-	( cd BTF && $(MAKE) install )
 	( cd CAMD && $(MAKE) install )
 	( cd CCOLAMD && $(MAKE) install )
 	( cd COLAMD && $(MAKE) install )
 	( cd CHOLMOD && $(MAKE) install )
-	( cd CXSparse && $(MAKE) install )
-	( cd LDL && $(MAKE) install )
-	( cd KLU && $(MAKE) install )
-	( cd UMFPACK && $(MAKE) install )
-	( cd RBio && $(MAKE) install )
-ifneq (,$(GPU_CONFIG))
-	( cd SuiteSparse_GPURuntime && $(MAKE) install )
-	( cd GPUQREngine && $(MAKE) install )
-endif
 	( cd SPQR && $(MAKE) install )
-	# ( cd GraphBLAS && $(MAKE) JOBS=$(JOBS) CMAKE_OPTIONS='$(CMAKE_OPTIONS)' install )
-#	( cd PIRO_BAND && $(MAKE) install )
-#	( cd SKYLINE_SVD && $(MAKE) install )
-	( cd SLIP_LU && $(MAKE) install )
-	$(CP) README.md $(INSTALL_DOC)/SuiteSparse_README.md
-	chmod 644 $(INSTALL_DOC)/SuiteSparse_README.md
 
 metisinstall: metis
 ifeq (,$(MY_METIS_LIB))
@@ -77,15 +60,11 @@ ifeq (,$(MY_METIS_LIB))
 	@mkdir -p $(INSTALL_INCLUDE)
 	@mkdir -p $(INSTALL_DOC)
 	- $(CP) lib/libmetis.* $(INSTALL_LIB)
-	- $(CP) metis-5.1.0/manual/manual.pdf $(INSTALL_DOC)/METIS_manual.pdf
-	- $(CP) metis-5.1.0/README.txt $(INSTALL_DOC)/METIS_README.txt
         # the following is needed only on the Mac, so *.dylib is hardcoded:
 	$(SO_INSTALL_NAME) $(INSTALL_LIB)/libmetis.dylib $(INSTALL_LIB)/libmetis.dylib
 	- $(CP) include/metis.h $(INSTALL_INCLUDE)
 	chmod 755 $(INSTALL_LIB)/libmetis.*
 	chmod 644 $(INSTALL_INCLUDE)/metis.h
-	chmod 644 $(INSTALL_DOC)/METIS_manual.pdf
-	chmod 644 $(INSTALL_DOC)/METIS_README.txt
 endif
 
 # uninstall all packages
diff --git a/SuiteSparse_config/SuiteSparse_config.mk b/SuiteSparse_config/SuiteSparse_config.mk
index a9536643..564ba84b 100644
--- a/SuiteSparse_config/SuiteSparse_config.mk
+++ b/SuiteSparse_config/SuiteSparse_config.mk
@@ -225,7 +225,7 @@ SUITESPARSE_VERSION = 5.12.0
 
     # CUDA is detected automatically, and used if found.  To disable CUDA,
     # use CUDA=no
-    CUDA = auto
+    CUDA = no
 
     ifneq ($(CUDA),no)
         CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//")
@@ -468,7 +468,7 @@ else
         SO_PLAIN  = $(LIBRARY).so
         SO_MAIN   = $(LIBRARY).so.$(SO_VERSION)
         SO_TARGET = $(LIBRARY).so.$(VERSION)
-        SO_OPTS  += -shared -Wl,-soname -Wl,$(SO_MAIN) -Wl,--no-undefined \
+        SO_OPTS  += -shared -Wl,-soname -Wl,$(SO_MAIN) \
                      -Wl,-rpath,'$$ORIGIN' -Wl,-z,origin
         # Use rpath ORIGIN so that Linux/Unix *.so files can be moved without modification:
         SO_INSTALL_NAME = echo
diff --git a/metis-5.1.0/CMakeLists.txt b/metis-5.1.0/CMakeLists.txt
index 1a72ed0d..0134cd3a 100644
--- a/metis-5.1.0/CMakeLists.txt
+++ b/metis-5.1.0/CMakeLists.txt
@@ -25,4 +25,3 @@ include_directories(include)
 # Recursively look for CMakeLists.txt in subdirs.
 add_subdirectory("include")
 add_subdirectory("libmetis")
-add_subdirectory("programs")
-- 
2.36.1


From 5e4cde22a2cf6b573c941a307ec1c5310b74715f Mon Sep 17 00:00:00 2001
From: Gyeongjae Choi <def6488@gmail.com>
Date: Tue, 14 Jun 2022 01:14:13 +0000
Subject: [PATCH 2/2] Remove non-essential build targets

For now sparseqr is the only package that uses suitesparse,
and we want to minimize the build time. So this patch removes
some build targets of suitesparse that are not used by sparseqr.
---
 Makefile                                 | 23 +----------------------
 SuiteSparse_config/SuiteSparse_config.mk |  4 ++--
 metis-5.1.0/CMakeLists.txt               |  1 -
 3 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/Makefile b/Makefile
index ed722693..6af48982 100644
--- a/Makefile
+++ b/Makefile
@@ -44,31 +44,14 @@ endif
 #       sudo make install INSTALL=/usr/local
 # See SuiteSparse/README.md for more details.
 # (note that CSparse is not installed; CXSparse is installed instead)
-install: metisinstall gbinstall moninstall
+install: metisinstall
 	( cd SuiteSparse_config && $(MAKE) install )
-	# ( cd Mongoose  && $(MAKE) CMAKE_OPTIONS='$(CMAKE_OPTIONS)' install )
 	( cd AMD && $(MAKE) install )
-	( cd BTF && $(MAKE) install )
 	( cd CAMD && $(MAKE) install )
 	( cd CCOLAMD && $(MAKE) install )
 	( cd COLAMD && $(MAKE) install )
 	( cd CHOLMOD && $(MAKE) install )
-	( cd CXSparse && $(MAKE) install )
-	( cd LDL && $(MAKE) install )
-	( cd KLU && $(MAKE) install )
-	( cd UMFPACK && $(MAKE) install )
-	( cd RBio && $(MAKE) install )
-ifneq (,$(GPU_CONFIG))
-	( cd SuiteSparse_GPURuntime && $(MAKE) install )
-	( cd GPUQREngine && $(MAKE) install )
-endif
 	( cd SPQR && $(MAKE) install )
-	# ( cd GraphBLAS && $(MAKE) JOBS=$(JOBS) CMAKE_OPTIONS='$(CMAKE_OPTIONS)' install )
-#	( cd PIRO_BAND && $(MAKE) install )
-#	( cd SKYLINE_SVD && $(MAKE) install )
-	( cd SLIP_LU && $(MAKE) install )
-	$(CP) README.md $(INSTALL_DOC)/SuiteSparse_README.md
-	chmod 644 $(INSTALL_DOC)/SuiteSparse_README.md
 
 metisinstall: metis
 ifeq (,$(MY_METIS_LIB))
@@ -77,15 +60,11 @@ ifeq (,$(MY_METIS_LIB))
 	@mkdir -p $(INSTALL_INCLUDE)
 	@mkdir -p $(INSTALL_DOC)
 	- $(CP) lib/libmetis.* $(INSTALL_LIB)
-	- $(CP) metis-5.1.0/manual/manual.pdf $(INSTALL_DOC)/METIS_manual.pdf
-	- $(CP) metis-5.1.0/README.txt $(INSTALL_DOC)/METIS_README.txt
         # the following is needed only on the Mac, so *.dylib is hardcoded:
 	$(SO_INSTALL_NAME) $(INSTALL_LIB)/libmetis.dylib $(INSTALL_LIB)/libmetis.dylib
 	- $(CP) include/metis.h $(INSTALL_INCLUDE)
 	chmod 755 $(INSTALL_LIB)/libmetis.*
 	chmod 644 $(INSTALL_INCLUDE)/metis.h
-	chmod 644 $(INSTALL_DOC)/METIS_manual.pdf
-	chmod 644 $(INSTALL_DOC)/METIS_README.txt
 endif
 
 # uninstall all packages
diff --git a/SuiteSparse_config/SuiteSparse_config.mk b/SuiteSparse_config/SuiteSparse_config.mk
index a9536643..564ba84b 100644
--- a/SuiteSparse_config/SuiteSparse_config.mk
+++ b/SuiteSparse_config/SuiteSparse_config.mk
@@ -225,7 +225,7 @@ SUITESPARSE_VERSION = 5.12.0
 
     # CUDA is detected automatically, and used if found.  To disable CUDA,
     # use CUDA=no
-    CUDA = auto
+    CUDA = no
 
     ifneq ($(CUDA),no)
         CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//")
@@ -468,7 +468,7 @@ else
         SO_PLAIN  = $(LIBRARY).so
         SO_MAIN   = $(LIBRARY).so.$(SO_VERSION)
         SO_TARGET = $(LIBRARY).so.$(VERSION)
-        SO_OPTS  += -shared -Wl,-soname -Wl,$(SO_MAIN) -Wl,--no-undefined \
+        SO_OPTS  += -shared -Wl,-soname -Wl,$(SO_MAIN) \
                      -Wl,-rpath,'$$ORIGIN' -Wl,-z,origin
         # Use rpath ORIGIN so that Linux/Unix *.so files can be moved without modification:
         SO_INSTALL_NAME = echo
diff --git a/metis-5.1.0/CMakeLists.txt b/metis-5.1.0/CMakeLists.txt
index 1a72ed0d..0134cd3a 100644
--- a/metis-5.1.0/CMakeLists.txt
+++ b/metis-5.1.0/CMakeLists.txt
@@ -25,4 +25,3 @@ include_directories(include)
 # Recursively look for CMakeLists.txt in subdirs.
 add_subdirectory("include")
 add_subdirectory("libmetis")
-add_subdirectory("programs")
-- 
2.36.1

