From 9731c412e9ef2fad66181460e768b01cb3c600da Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Tue, 8 Aug 2017 00:21:20 -0500 Subject: gnu: petsc, slepc: Use 'parallel-job-count'. * gnu/packages/maths.scm (petsc, slepc)[arguments]: Set #:make-flags to override default unlimited '-j'. (petsc)[arguments]: Scrub build machine cores from installed files in 'clean-local-references' phase. --- gnu/packages/maths.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gnu/packages/maths.scm') diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 54db44b3df..cc9a9a40a8 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -1247,6 +1247,10 @@ (define-public petsc (assoc-ref %build-inputs "superlu") "/include") ,(string-append "--with-superlu-lib=" (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a")) + #:make-flags + ;; Honor (parallel-job-count) for build. Do not use --with-make-np, + ;; whose value is dumped to $out/lib/petsc/conf/petscvariables. + (list (format #f "MAKE_NP=~a" (parallel-job-count))) #:phases (modify-phases %standard-phases (replace 'configure @@ -1261,13 +1265,17 @@ (define-public petsc (format #t "configure flags: ~s~%" flags) (zero? (apply system* "./configure" flags))))) (add-after 'configure 'clean-local-references - (lambda* (#:key inputs outputs #:allow-other-keys) + (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (substitute* (find-files "." "^petsc(conf|machineinfo).h$") ;; Prevent build directory from leaking into compiled code (((getcwd)) out) ;; Scrub timestamp for reproducibility ((".*Libraries compiled on.*") "")) + (substitute* (find-files "." "petscvariables") + ;; Do not expose build machine characteristics, set to defaults. + (("MAKE_NP = [:digit:]+") "MAKE_NP = 2") + (("NPMAX = [:digit:]+") "NPMAX = 2")) #t))) (add-after 'install 'clean-install ;; Try to keep installed files from leaking build directory names. @@ -1364,6 +1372,8 @@ (define-public slepc #:configure-flags `(,(string-append "--with-arpack-dir=" (assoc-ref %build-inputs "arpack") "/lib")) + #:make-flags ;honor (parallel-job-count) + `(,(format #f "MAKE_NP=~a" (parallel-job-count))) #:phases (modify-phases %standard-phases (replace 'configure -- cgit v1.2.3