Commit 78e41777 authored by FELŠÖCI Marek's avatar FELŠÖCI Marek
Browse files

hacky: add mumps using MKL instead of OpenBLAS (sequential MKL for now)

parent 2a2e4d5a
;;; This module extends GNU Guix and is licensed under the same terms, those
;;; of the GNU GPL version 3 or (at your option) any later version.
;;;
;;; Copyright © 2020 Inria
(define-module (hacky mumps-mkl)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (gnu packages maths)
#:use-module (srfi srfi-1)
#:use-module (non-free mkl))
(define-public mumps-mkl
(package
(inherit mumps)
(name "mumps-mkl")
(inputs
`(("blas" ,mkl)
,@(alist-delete "openblas" (package-inputs mumps))))
(arguments
(substitute-keyword-arguments (package-arguments mumps)
((#:phases phases)
`(modify-phases ,phases
(replace 'configure
(lambda* (#:key inputs #:allow-other-keys)
(call-with-output-file "Makefile.inc"
(lambda (port)
(format port "
PLAT =
LIBEXT = .a
OUTC = -o
OUTF = -o
RM = rm -f~:[
CC = gcc
FC = gfortran
FL = gfortran
INCSEQ = -I$(topdir)/libseq
LIBSEQ = $(topdir)/libseq/libmpiseq.a
LIBSEQNEEDED = libseqneeded~;
CC = mpicc
FC = mpifort
FL = mpifort~]
AR = ar vr # rules require trailing space, ugh...
RANLIB = ranlib
BLASDIR = ~a
LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl~@[
SCALAPDIR = ~a
SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
LIBOTHERS = -pthread
CDEFS = -DAdd_
PIC = -fPIC
OPTF = -O2 -DALLOW_NON_INIT $(PIC)
OPTL = -O2 $(PIC)
OPTC = -O2 $(PIC)
INCS = $(INCSEQ)
LIBS = $(SCALAP) $(LIBSEQ)
LPORDDIR = $(topdir)/PORD/lib
IPORD = -I$(topdir)/PORD/include
LPORD = $(LPORDDIR)/libpord.a
ORDERINGSF = -Dpord~@[
METISDIR = ~a
IMETIS = -I$(METISDIR)/include
LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
ORDERINGSF += -Dmetis~]~@[~:{
SCOTCHDIR = ~a
ISCOTCH = -I$(SCOTCHDIR)/include
LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
ORDERINGSF += ~a~}~]
ORDERINGSC = $(ORDERINGSF)
LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
IORDERINGSF = $(ISCOTCH)
IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
(assoc-ref inputs "mpi")
(assoc-ref inputs "blas")
(assoc-ref inputs "scalapack")
(assoc-ref inputs "metis")
(match (list (assoc-ref inputs "pt-scotch")
(assoc-ref inputs "scotch"))
((#f #f)
#f)
((#f scotch)
`((,scotch "" "-Dscotch")))
((ptscotch _)
`((,ptscotch
"-lptesmumps -lptscotch -lptscotcherr "
"-Dptscotch")))))))))))))
(synopsis "Multifrontal sparse direct solver (using MKL instead of
OpenBLAS)")))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment