From 36769be5fcfbd5461b6a477d6c9e4af09efff54c Mon Sep 17 00:00:00 2001 From: Dorival Pedroso Date: Fri, 4 Dec 2020 17:52:00 +1000 Subject: [PATCH] Remove direct installation of MUMPS --- Dockerfile | 29 +++------ README.md | 7 +-- zscripts/install-mumps-local.bash | 34 ----------- zscripts/mumps/install-mumps.bash | 33 ---------- zscripts/mumps/patch/Makefile.inc | 68 --------------------- zscripts/mumps/patch/PORD/lib/Makefile.diff | 27 -------- zscripts/mumps/patch/src/Makefile.diff | 33 ---------- 7 files changed, 10 insertions(+), 221 deletions(-) delete mode 100644 zscripts/install-mumps-local.bash delete mode 100644 zscripts/mumps/install-mumps.bash delete mode 100644 zscripts/mumps/patch/Makefile.inc delete mode 100644 zscripts/mumps/patch/PORD/lib/Makefile.diff delete mode 100644 zscripts/mumps/patch/src/Makefile.diff diff --git a/Dockerfile b/Dockerfile index 248bc69b..bb22d3ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:sid +FROM ubuntu:20.04 # disable tzdata questions ENV DEBIAN_FRONTEND=noninteractive @@ -24,38 +24,27 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \ # required compilers and libraries for gosl RUN apt-get update -y && apt-get install -y --no-install-recommends \ - build-essential \ gcc \ gfortran \ libopenmpi-dev \ liblapacke-dev \ libopenblas-dev \ libmetis-dev \ - libparmetis-dev \ - libscotch-dev \ - libptscotch-dev \ - libatlas-base-dev \ - libscalapack-mpi-dev \ libsuitesparse-dev \ + libmumps-dev \ libfftw3-dev \ libfftw3-mpi-dev \ - intel-mkl-full \ && apt-get clean && rm -rf /var/lib/apt/lists/* -# copy scripts and patches -COPY zscripts /tmp/zscripts - -# download the source code of MUMPS and compile it -RUN bash /tmp/zscripts/mumps/install-mumps.bash - # configure basic system ARG INSTALL_ZSH="true" ARG USERNAME="vscode" ARG USER_UID="1000" ARG USER_GID=$USER_UID ARG UPGRADE_PACKAGES="true" -RUN bash /tmp/zscripts/microsoft/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \ - && apt-get clean -y && rm -rf /var/lib/apt/lists/* +COPY zscripts/microsoft/common-debian.sh /tmp/ +RUN bash /tmp/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/* && rm /tmp/common-debian.sh # install Go tools ARG GO_VERSION="latest" @@ -64,8 +53,6 @@ ARG GOPATH="/go" ARG UPDATE_RC="true" ARG INSTALL_GO_TOOLS="true" ENV GO111MODULE=auto -RUN bash /tmp/zscripts/microsoft/go-debian.sh "${GO_VERSION}" "${GOROOT}" "${GOPATH}" "${USERNAME}" "${UPDATE_RC}" "${INSTALL_GO_TOOLS}" \ - && apt-get clean -y - -# clean up -RUN rm -rf /tmp/zscripts +COPY zscripts/microsoft/go-debian.sh /tmp/ +RUN bash /tmp/go-debian.sh "${GO_VERSION}" "${GOROOT}" "${GOPATH}" "${USERNAME}" "${UPDATE_RC}" "${INSTALL_GO_TOOLS}" \ + && apt-get clean -y && rm /tmp/go-debian.sh diff --git a/README.md b/README.md index 5be14e69..da36378e 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,10 @@ sudo apt-get install -y --no-install-recommends \ liblapacke-dev \ libopenblas-dev \ libmetis-dev \ - libparmetis-dev \ - libscotch-dev \ - libptscotch-dev \ libsuitesparse-dev \ - libmumps-ptscotch-dev \ + libmumps-dev \ libfftw3-dev \ - libfftw3-mpi-dev + libfftw3-mpi-dev ``` **Download Gosl** diff --git a/zscripts/install-mumps-local.bash b/zscripts/install-mumps-local.bash deleted file mode 100644 index 0a27d15c..00000000 --- a/zscripts/install-mumps-local.bash +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -set -e - -# copy scripts -cp -r ./zscripts /tmp/ - -# constants -MUMPS_VERSION="5.3.5" -MUMPS_GZ=mumps_${MUMPS_VERSION}.orig.tar.gz -MUMPS_TMP=/tmp/MUMPS_${MUMPS_VERSION} -PDIR=/tmp/zscripts/mumps/patch - -# download and exctract the source code -curl http://deb.debian.org/debian/pool/main/m/mumps/${MUMPS_GZ} -o /tmp/${MUMPS_GZ} -cd /tmp && tar xzf ${MUMPS_GZ} - -# patch and compile -cd ${MUMPS_TMP} -patch -u PORD/lib/Makefile ${PDIR}/PORD/lib/Makefile.diff -patch -u src/Makefile ${PDIR}/src/Makefile.diff -cp ${PDIR}/Makefile.inc . -make d -make z -chmod -x lib/* - -# copy include and lib files to the right places -sudo mkdir -p /usr/include/mumps -sudo cp -av include/*.h /usr/include/mumps/ -sudo cp -av lib/libpord.so /usr/lib/ -sudo cp -av lib/libdmumps.so /usr/lib/ -sudo cp -av lib/libzmumps.so /usr/lib/ -sudo cp -av lib/libmumps_common.so /usr/lib/ -sudo ldconfig diff --git a/zscripts/mumps/install-mumps.bash b/zscripts/mumps/install-mumps.bash deleted file mode 100644 index fb265fcb..00000000 --- a/zscripts/mumps/install-mumps.bash +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -set -e - -# constants -MUMPS_VERSION="5.3.5" -MUMPS_GZ=mumps_${MUMPS_VERSION}.orig.tar.gz -MUMPS_TMP=/tmp/MUMPS_${MUMPS_VERSION} -PDIR=/tmp/zscripts/mumps/patch - -# download and exctract the source code -curl http://deb.debian.org/debian/pool/main/m/mumps/${MUMPS_GZ} -o /tmp/${MUMPS_GZ} -cd /tmp && tar xzf ${MUMPS_GZ} && rm ${MUMPS_GZ} - -# patch and compile -cd ${MUMPS_TMP} -patch -u PORD/lib/Makefile ${PDIR}/PORD/lib/Makefile.diff -patch -u src/Makefile ${PDIR}/src/Makefile.diff -cp ${PDIR}/Makefile.inc . -make d -make z -chmod -x lib/* - -# copy include and lib files to the right places -mkdir -p /usr/include/mumps -cp -av include/*.h /usr/include/mumps/ -cp -av lib/libpord.so /usr/lib/ -cp -av lib/libdmumps.so /usr/lib/ -cp -av lib/libzmumps.so /usr/lib/ -cp -av lib/libmumps_common.so /usr/lib/ - -# clean up -rm -rf ${MUMPS_TMP} diff --git a/zscripts/mumps/patch/Makefile.inc b/zscripts/mumps/patch/Makefile.inc deleted file mode 100644 index 8bf09c6e..00000000 --- a/zscripts/mumps/patch/Makefile.inc +++ /dev/null @@ -1,68 +0,0 @@ -# -# This file is part of MUMPS 5.3.5, released -# on Thu Oct 22 09:29:08 UTC 2020 -# -# These settings for a PC under Debian/linux with standard packages : -# metis (parmetis), scotch (ptscotch), openmpi, gfortran - -# packages installation: -# apt-get install libmetis-dev libparmetis-dev libscotch-dev libptscotch-dev libatlas-base-dev openmpi-bin libopenmpi-dev liblapack-dev - -# Begin orderings -LSCOTCHDIR = /usr/lib -ISCOTCH = -I/usr/include/scotch -LSCOTCH = -L$(LSCOTCHDIR) -lptesmumps -lptscotch -lptscotcherr - -LPORDDIR = $(topdir)/PORD/lib/ -IPORD = -I$(topdir)/PORD/include/ -LPORD = -L$(LPORDDIR) -lpord - -LMETISDIR = /usr/lib -IMETIS = -I/usr/include/parmetis -LMETIS = -L$(LMETISDIR) -lparmetis -lmetis - -# Corresponding variables reused later -ORDERINGSF = -Dmetis -Dpord -Dparmetis -Dscotch -Dptscotch -ORDERINGSC = $(ORDERINGSF) - -LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH) -IORDERINGSF = $(ISCOTCH) -IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH) -# End orderings -################################################################################ - -PLAT = -LIBEXT = .so -OUTC = -o -OUTF = -o -RM = /bin/rm -f -CC = mpicc -O2 -FC = mpif90 -fallow-argument-mismatch -O2 -w -FL = mpif90 -fallow-argument-mismatch -O2 -w -AR = ar vr -RANLIB = ranlib -LAPACK = -llapack -SCALAP = -lscalapack-openmpi - -INCPAR = # not needed with mpif90/mpicc: -I/usr/include/openmpi - -LIBPAR = $(SCALAP) $(LAPACK) # not needed with mpif90/mpicc: -lmpi_mpifh -lmpi - -INCSEQ = -I$(topdir)/libseq -LIBSEQ = $(LAPACK) -L$(topdir)/libseq -lmpiseq - -LIBBLAS = -lblas -LIBOTHERS = -lpthread - -#Preprocessor defs for calling Fortran from C (-DAdd_ or -DAdd__ or -DUPPER) -CDEFS = -DAdd_ - -#Begin Optimized options -OPTF = -O2 -fopenmp -OPTL = -O2 -fopenmp -OPTC = -O2 -fopenmp -#End Optimized options - -INCS = $(INCPAR) -LIBS = $(LIBPAR) -LIBSEQNEEDED = diff --git a/zscripts/mumps/patch/PORD/lib/Makefile.diff b/zscripts/mumps/patch/PORD/lib/Makefile.diff deleted file mode 100644 index fc132945..00000000 --- a/zscripts/mumps/patch/PORD/lib/Makefile.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- Makefile.orig 2020-12-03 22:00:52.044100099 +1000 -+++ Makefile 2020-12-03 22:02:10.041983422 +1000 -@@ -9,7 +9,7 @@ - - INCLUDES = -I../include - --COPTIONS = $(INCLUDES) $(CFLAGS) $(OPTFLAGS) -+COPTIONS = $(INCLUDES) $(CFLAGS) $(OPTFLAGS) -fPIC - - OBJS = graph.o gbipart.o gbisect.o ddcreate.o ddbisect.o nestdiss.o \ - multisector.o gelim.o bucket.o tree.o \ -@@ -24,12 +24,11 @@ - .c.o: - $(CC) $(COPTIONS) -c $*.c $(OUTC)$*.o - --libpord$(LIBEXT):$(OBJS) -- $(AR)$@ $(OBJS) -- $(RANLIB) $@ -+libpord$(PLAT).so: $(OBJS) -+ $(CC) -shared $(OBJS) -Wl,-soname,libpord$(PLAT).so -o libpord$(PLAT).so -Wl,-z,defs - - clean: - rm -f *.o - - realclean: -- rm -f *.o libpord.a -+ rm -f *.o *.so diff --git a/zscripts/mumps/patch/src/Makefile.diff b/zscripts/mumps/patch/src/Makefile.diff deleted file mode 100644 index 58b20775..00000000 --- a/zscripts/mumps/patch/src/Makefile.diff +++ /dev/null @@ -1,33 +0,0 @@ ---- Makefile.orig 2020-12-03 22:06:41.284556732 +1000 -+++ Makefile 2020-12-03 22:05:06.334252138 +1000 -@@ -188,13 +188,11 @@ - $(ARITH)tools.o\ - $(ARITH)type3_root.o - --$(libdir)/libmumps_common$(PLAT)$(LIBEXT): $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER) -- $(AR)$@ $? -- $(RANLIB) $@ -- --$(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT): $(OBJS_MOD) $(OBJS_OTHER) -- $(AR)$@ $? -- $(RANLIB) $@ -+$(libdir)/libmumps_common$(PLAT).so: $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER) -+ $(FC) $(OPTL) -shared $^ -Wl,-soname,libmumps_common$(PLAT).so -L$(libdir) $(LORDERINGS) -lpthread $(MPIFLIB) $(MPICLIB) -o $(libdir)/libmumps_common$(PLAT).so -Wl,-z,defs -+ -+$(libdir)/lib$(ARITH)mumps$(PLAT).so: $(OBJS_MOD) $(OBJS_OTHER) -+ $(FC) $(OPTL) -shared $^ -Wl,-soname,lib$(ARITH)mumps$(PLAT).so -L$(libdir) -lmumps_common$(PLAT) $(LORDERINGS) $(MPIFLIB) -lblas $(SCALAP) $(LAPACK) -o $(libdir)/lib$(ARITH)mumps$(PLAT).so -Wl,-z,defs - - # Dependencies between modules: - # i) arithmetic-dependent modules: -@@ -405,9 +403,9 @@ - - .SUFFIXES: .c .F .o - .F.o: -- $(FC) $(OPTF) -I. -I../include $(INCS) $(IORDERINGSF) $(ORDERINGSF) -c $*.F $(OUTF)$*.o -+ $(FC) $(OPTF) -I. -I../include $(INCS) $(IORDERINGSF) $(ORDERINGSF) -fPIC -c $*.F $(OUTF)$*.o - .c.o: -- $(CC) $(OPTC) -I../include $(INCS) $(CDEFS) $(IORDERINGSC) $(ORDERINGSC) -c $*.c $(OUTC)$*.o -+ $(CC) $(OPTC) -I../include $(INCS) $(CDEFS) $(IORDERINGSC) $(ORDERINGSC) -fPIC -c $*.c $(OUTC)$*.o - - $(ARITH)mumps_c.o: mumps_c.c - $(CC) $(OPTC) -I../include $(INCS) $(CDEFS) -DMUMPS_ARITH=MUMPS_ARITH_$(ARITH) \