From b6417a3bed19ba81daf3b2e2776225f1f91c301f Mon Sep 17 00:00:00 2001 From: Theodore Kisner Date: Wed, 19 May 2021 14:16:45 -0700 Subject: [PATCH] Fix gmp and mpfr packages. Patch suitesparse makefile linking order. Fix typo in pixell build. --- configs/cori-gcc-gpu.pkgs | 7 ++++ configs/cori-gcc.pkgs | 10 +++-- configs/cori-intel.pkgs | 10 +++-- configs/docker-py3.7-debian.pkgs | 7 ++++ configs/docker-toastdeps-py37.pkgs | 7 ++++ configs/docker-ubuntu_20.04_gcc9_py38.pkgs | 7 ++++ configs/linux-conda-nomkl.pkgs | 7 ++++ configs/linux-conda.pkgs | 7 ++++ configs/linux-venv.pkgs | 7 ++++ configs/osx-homebrew-clang.pkgs | 7 ++++ configs/osx-macports-gcc.pkgs | 7 ++++ configs/simons-intel.pkgs | 7 ++++ configs/ubuntu-18.04-venv.pkgs | 7 ++++ configs/ubuntu-20.04-venv.pkgs | 7 ++++ pkgs/gmp.sh | 42 +++++++++++++++++++ pkgs/mpfr.sh | 43 +++++++++++++++++++ pkgs/patch_suitesparse | 49 ++++++++++++++++++++++ pkgs/pixell.sh | 2 +- pkgs/suitesparse.sh | 6 +++ templates/packages.txt | 13 ++++++ 20 files changed, 252 insertions(+), 7 deletions(-) create mode 100644 pkgs/gmp.sh create mode 100644 pkgs/mpfr.sh create mode 100644 pkgs/patch_suitesparse diff --git a/configs/cori-gcc-gpu.pkgs b/configs/cori-gcc-gpu.pkgs index f5f4906..2f67770 100644 --- a/configs/cori-gcc-gpu.pkgs +++ b/configs/cori-gcc-gpu.pkgs @@ -64,12 +64,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# # Install suitesparse suitesparse # diff --git a/configs/cori-gcc.pkgs b/configs/cori-gcc.pkgs index 710920d..7ca11bd 100644 --- a/configs/cori-gcc.pkgs +++ b/configs/cori-gcc.pkgs @@ -62,18 +62,22 @@ h5py # Install healpy healpy # -# Install Pixell -pixell -# # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# # Install suitesparse suitesparse # diff --git a/configs/cori-intel.pkgs b/configs/cori-intel.pkgs index 23e43e4..9f18f84 100644 --- a/configs/cori-intel.pkgs +++ b/configs/cori-intel.pkgs @@ -62,18 +62,22 @@ h5py # Install healpy healpy # -# Install Pixell -pixell -# # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# # Install suitesparse suitesparse # diff --git a/configs/docker-py3.7-debian.pkgs b/configs/docker-py3.7-debian.pkgs index e9a835f..67796f1 100644 --- a/configs/docker-py3.7-debian.pkgs +++ b/configs/docker-py3.7-debian.pkgs @@ -65,12 +65,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# # Install suitesparse #suitesparse # diff --git a/configs/docker-toastdeps-py37.pkgs b/configs/docker-toastdeps-py37.pkgs index d580753..c4c511a 100644 --- a/configs/docker-toastdeps-py37.pkgs +++ b/configs/docker-toastdeps-py37.pkgs @@ -65,12 +65,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# # Install suitesparse #suitesparse # diff --git a/configs/docker-ubuntu_20.04_gcc9_py38.pkgs b/configs/docker-ubuntu_20.04_gcc9_py38.pkgs index 4bbd09e..3140660 100644 --- a/configs/docker-ubuntu_20.04_gcc9_py38.pkgs +++ b/configs/docker-ubuntu_20.04_gcc9_py38.pkgs @@ -65,12 +65,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +#gmp +#mpfr +# # Install suitesparse #suitesparse # diff --git a/configs/linux-conda-nomkl.pkgs b/configs/linux-conda-nomkl.pkgs index 56776e6..a4888c7 100644 --- a/configs/linux-conda-nomkl.pkgs +++ b/configs/linux-conda-nomkl.pkgs @@ -65,12 +65,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# # Install suitesparse suitesparse # diff --git a/configs/linux-conda.pkgs b/configs/linux-conda.pkgs index 074158b..c784661 100644 --- a/configs/linux-conda.pkgs +++ b/configs/linux-conda.pkgs @@ -65,12 +65,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# # Install suitesparse suitesparse # diff --git a/configs/linux-venv.pkgs b/configs/linux-venv.pkgs index aca372f..a93d323 100644 --- a/configs/linux-venv.pkgs +++ b/configs/linux-venv.pkgs @@ -65,12 +65,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# # Install suitesparse suitesparse # diff --git a/configs/osx-homebrew-clang.pkgs b/configs/osx-homebrew-clang.pkgs index 7eb5e00..0b754ad 100644 --- a/configs/osx-homebrew-clang.pkgs +++ b/configs/osx-homebrew-clang.pkgs @@ -65,12 +65,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# # Install suitesparse #suitesparse # diff --git a/configs/osx-macports-gcc.pkgs b/configs/osx-macports-gcc.pkgs index f27980b..d7ee236 100644 --- a/configs/osx-macports-gcc.pkgs +++ b/configs/osx-macports-gcc.pkgs @@ -65,12 +65,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# # Install suitesparse #suitesparse # diff --git a/configs/simons-intel.pkgs b/configs/simons-intel.pkgs index 2c5052e..0805e07 100644 --- a/configs/simons-intel.pkgs +++ b/configs/simons-intel.pkgs @@ -65,12 +65,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# # Install suitesparse suitesparse # diff --git a/configs/ubuntu-18.04-venv.pkgs b/configs/ubuntu-18.04-venv.pkgs index 9f7bb8e..ec9fec6 100644 --- a/configs/ubuntu-18.04-venv.pkgs +++ b/configs/ubuntu-18.04-venv.pkgs @@ -65,12 +65,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +#gmp +#mpfr +# # Install suitesparse #suitesparse # diff --git a/configs/ubuntu-20.04-venv.pkgs b/configs/ubuntu-20.04-venv.pkgs index 3ffcc80..a456896 100644 --- a/configs/ubuntu-20.04-venv.pkgs +++ b/configs/ubuntu-20.04-venv.pkgs @@ -65,12 +65,19 @@ healpy # Install quaternionarray qarray # +# Install Pixell +pixell +# # Install fitsio fitsio # # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +#gmp +#mpfr +# # Install suitesparse #suitesparse # diff --git a/pkgs/gmp.sh b/pkgs/gmp.sh new file mode 100644 index 0000000..f4f82e9 --- /dev/null +++ b/pkgs/gmp.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +pkg="gmp" +pkgopts=$@ +cleanup="" + +version=6.2.0 +pdir=gmp-${version} +pfile=${pdir}.tar.xz +src=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://ftp.gnu.org/gnu/gmp/${pfile} ${pfile}) + +if [ "x${src}" = "x" ]; then + echo "Failed to fetch ${pkg}" >&2 + exit 1 +fi +cleanup="${src}" + +log="../log_${pkg}" + +echo "Building ${pkg}..." >&2 + +rm -rf ${pdir} +tar xf ${src} \ + && cd ${pdir} \ + && cleanup="${cleanup} $(pwd)" \ + && CC="@CC@" CFLAGS="@CFLAGS@" \ + ./configure \ + --enable-static \ + --disable-shared \ + --with-pic \ + --prefix="@AUX_PREFIX@" > ${log} 2>&1 \ + && make -j @MAKEJ@ >> ${log} 2>&1 \ + && make install >> ${log} 2>&1 + +if [ $? -ne 0 ]; then + echo "Failed to build ${pkg}" >&2 + exit 1 +fi + +echo "Finished building ${pkg}" >&2 +echo "${cleanup}" +exit 0 diff --git a/pkgs/mpfr.sh b/pkgs/mpfr.sh new file mode 100644 index 0000000..a025699 --- /dev/null +++ b/pkgs/mpfr.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +pkg="mpfr" +pkgopts=$@ +cleanup="" + +version=4.1.0 +pdir=mpfr-${version} +pfile=${pdir}.tar.xz +src=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://www.mpfr.org/mpfr-current/${pfile} ${pfile}) + +if [ "x${src}" = "x" ]; then + echo "Failed to fetch ${pkg}" >&2 + exit 1 +fi +cleanup="${src}" + +log="../log_${pkg}" + +echo "Building ${pkg}..." >&2 + +rm -rf ${pdir} +tar xf ${src} \ + && cd ${pdir} \ + && cleanup="${cleanup} $(pwd)" \ + && CC="@CC@" CFLAGS="@CFLAGS@" \ + ./configure \ + --enable-static \ + --disable-shared \ + --with-pic \ + --with-gmp="@AUX_PREFIX@" \ + --prefix="@AUX_PREFIX@" > ${log} 2>&1 \ + && make -j @MAKEJ@ >> ${log} 2>&1 \ + && make install >> ${log} 2>&1 + +if [ $? -ne 0 ]; then + echo "Failed to build ${pkg}" >&2 + exit 1 +fi + +echo "Finished building ${pkg}" >&2 +echo "${cleanup}" +exit 0 diff --git a/pkgs/patch_suitesparse b/pkgs/patch_suitesparse new file mode 100644 index 0000000..3723df4 --- /dev/null +++ b/pkgs/patch_suitesparse @@ -0,0 +1,49 @@ +diff -urN SuiteSparse-5.9.0_orig/Makefile SuiteSparse-5.9.0/Makefile +--- SuiteSparse-5.9.0_orig/Makefile 2021-03-03 14:04:33.000000000 -0800 ++++ SuiteSparse-5.9.0/Makefile 2021-05-19 13:22:30.345693531 -0700 +@@ -282,6 +282,9 @@ + # hardcoded below. + include/metis.h: + ifeq (,$(MY_METIS_LIB)) ++ - ( cd metis-5.1.0 && $(MAKE) config prefix=$(SUITESPARSE) cc=$(CC) ) ++ - ( cd metis-5.1.0 && $(MAKE) ) ++ - ( cd metis-5.1.0 && $(MAKE) install ) + - ( cd metis-5.1.0 && $(MAKE) config shared=1 prefix=$(SUITESPARSE) cc=$(CC) ) + - ( cd metis-5.1.0 && $(MAKE) ) + - ( cd metis-5.1.0 && $(MAKE) install ) +diff -urN SuiteSparse-5.9.0_orig/SLIP_LU/Demo/Makefile SuiteSparse-5.9.0/SLIP_LU/Demo/Makefile +--- SuiteSparse-5.9.0_orig/SLIP_LU/Demo/Makefile 2021-03-03 14:04:33.000000000 -0800 ++++ SuiteSparse-5.9.0/SLIP_LU/Demo/Makefile 2021-05-19 13:24:29.964559530 -0700 +@@ -20,7 +20,7 @@ + + # LDFLAGS = -L../../lib + +-LDLIBS += -lm -lgmp -lmpfr -lcolamd -lamd -lsliplu ++LDLIBS += -lsliplu -lcolamd -lamd -lmpfr -lgmp -lm + CS = $(LDLIBS) + + +diff -urN SuiteSparse-5.9.0_orig/SLIP_LU/Lib/Makefile SuiteSparse-5.9.0/SLIP_LU/Lib/Makefile +--- SuiteSparse-5.9.0_orig/SLIP_LU/Lib/Makefile 2021-03-03 14:04:33.000000000 -0800 ++++ SuiteSparse-5.9.0/SLIP_LU/Lib/Makefile 2021-05-19 13:25:29.476018521 -0700 +@@ -20,7 +20,7 @@ + # CFLAGS += -Wall -Wextra -Wpedantic -Werror + + # SLIP_LU depends on SuiteSparse_config, AMD, COLAMD, M, GMP, and MPFR +-LDLIBS += -lsuitesparseconfig -lamd -lcolamd -lm -lgmp -lmpfr ++LDLIBS += -lsuitesparseconfig -lamd -lcolamd -lmpfr -lgmp -lm + + C = $(CC) $(CF) -I../Include -I../../COLAMD/Include -I../../AMD/Include -I../../SuiteSparse_config + +diff -urN SuiteSparse-5.9.0_orig/SLIP_LU/Tcov/Makefile SuiteSparse-5.9.0/SLIP_LU/Tcov/Makefile +--- SuiteSparse-5.9.0_orig/SLIP_LU/Tcov/Makefile 2021-03-03 14:04:33.000000000 -0800 ++++ SuiteSparse-5.9.0/SLIP_LU/Tcov/Makefile 2021-05-19 13:26:23.571538251 -0700 +@@ -21,7 +21,7 @@ + -I../../SuiteSparse_config -I../../COLAMD/Include -I../../AMD/Include \ + -DSLIP_GMP_LIST_INIT=2 -DSLIP_LU_TCOV + +-LDLIBS += -lm -lgmp -lmpfr -lcolamd -lamd -lsuitesparseconfig ++LDLIBS += -lsuitesparseconfig -lcolamd -lamd -lmpfr -lgmp -lm + + # run all statement coverage tests, and then check for 100% coverage + run: runtests diff --git a/pkgs/pixell.sh b/pkgs/pixell.sh index 0adc2e5..6254c73 100644 --- a/pkgs/pixell.sh +++ b/pkgs/pixell.sh @@ -20,7 +20,7 @@ rm -rf ${psrc} tar xzf ${fetched} \ && cd ${psrc} \ && python3 setup.py build > ${log} 2>&1 \ - && python3 setup.py install --prefix "@PREFIX@" >> ${log} 2>&1 + && python3 setup.py install --prefix "@AUX_PREFIX@" >> ${log} 2>&1 if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 diff --git a/pkgs/suitesparse.sh b/pkgs/suitesparse.sh index cdb0c73..b3950f7 100644 --- a/pkgs/suitesparse.sh +++ b/pkgs/suitesparse.sh @@ -22,11 +22,17 @@ rm -rf SuiteSparse-${version} tar xzf ${src} \ && cd SuiteSparse-${version} \ && cleanup="${cleanup} $(pwd)" \ + && patch -p1 < "@TOP_DIR@/pkgs/patch_suitesparse" > ${log} 2>&1 \ && make library JOBS=@MAKEJ@ \ CC="@CC@" CXX="@CXX@" CFLAGS="@CFLAGS@" AUTOCC=no \ GPU_CONFIG="" \ CFOPENMP="@OPENMP_CXXFLAGS@" LAPACK="@LAPACK@" BLAS="@BLAS@" \ > ${log} 2>&1 \ + && make static JOBS=@MAKEJ@ \ + CC="@CC@" CXX="@CXX@" CFLAGS="@CFLAGS@" AUTOCC=no \ + GPU_CONFIG="" \ + CFOPENMP="@OPENMP_CXXFLAGS@" LAPACK="@LAPACK@" BLAS="@BLAS@" \ + > ${log} 2>&1 \ && cp -a ./lib/* "@AUX_PREFIX@/lib/" \ && cp -a ./include/* "@AUX_PREFIX@/include/" \ && find . -name "*.a" -exec cp -a '{}' "@AUX_PREFIX@/lib/" \; diff --git a/templates/packages.txt b/templates/packages.txt index 9c96d3e..a93d323 100644 --- a/templates/packages.txt +++ b/templates/packages.txt @@ -62,6 +62,9 @@ h5py # Install healpy healpy # +# Install quaternionarray +qarray +# # Install Pixell pixell # @@ -71,6 +74,13 @@ fitsio # Install aatm. Needed for some features of atmosphere simulations. aatm # +# GMP and MPFR are needed by SuiteSparse +gmp +mpfr +# +# Install suitesparse +suitesparse +# # Install libconviqt. 4-PI a_lm space beam convolution. conviqt # @@ -80,6 +90,9 @@ libsharp # Install libmadam. Destriping map-maker. madam # +# Install FLAC, needed by spt3g +libflac +# # Install SPT3G. Frame based data format. spt3g #