hiepacs.scm 51.8 KB
Newer Older
Ludovic Courtès's avatar
Ludovic Courtès committed
1
2
3
;;; 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.
;;;
Ludovic Courtès's avatar
Ludovic Courtès committed
4
;;; Copyright © 2017, 2019, 2021 Inria
Ludovic Courtès's avatar
Ludovic Courtès committed
5
6
7

(define-module (inria hiepacs)
  #:use-module (guix)
Ludovic Courtès's avatar
Ludovic Courtès committed
8
  #:use-module (guix git-download)
MARAIT Gilles's avatar
MARAIT Gilles committed
9
  #:use-module (guix hg-download)
Ludovic Courtès's avatar
Ludovic Courtès committed
10
11
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system cmake)
12
  #:use-module (guix build-system gnu)
Ludovic Courtès's avatar
Ludovic Courtès committed
13
  #:use-module (gnu packages)
Ludovic Courtès's avatar
Ludovic Courtès committed
14
  #:use-module (gnu packages algebra)
15
  #:use-module (gnu packages bison)
16
17
  #:use-module (gnu packages commencement)
  #:use-module (gnu packages databases)
18
  #:use-module (gnu packages flex)
Ludovic Courtès's avatar
Ludovic Courtès committed
19
20
21
22
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages maths)
  #:use-module (gnu packages mpi)
  #:use-module (gnu packages pkg-config)
23
  #:use-module (gnu packages python)
Ludovic Courtès's avatar
Ludovic Courtès committed
24
  #:use-module (gnu packages python-xyz)
25
  #:use-module (gnu packages ssh)
26
27
  #:use-module (gnu packages perl)
  #:use-module (inria mpi)
PRUVOST Florent's avatar
PRUVOST Florent committed
28
  #:use-module (inria storm)
GUILBAUD Adrien's avatar
GUILBAUD Adrien committed
29
  #:use-module (inria tadaam)
30
  #:use-module (inria eztrace)
31
  #:use-module (inria simgrid)
PRUVOST Florent's avatar
PRUVOST Florent committed
32
  #:use-module (guix utils)
33
  #:use-module (srfi srfi-1)
34
35
  ;; To remove when/if python2 packages sympy and mpi4py
  ;; are fixed in official repo
36
  #:use-module (guix build-system python)
37
  )
Ludovic Courtès's avatar
Ludovic Courtès committed
38

39
40
41
(define-public parsec
  (package
    (name "parsec")
42
    (version "6022a61dc96c25f11dd2aeabff2a5b3d7bce867d")
43
44
45
46
47
48
49
50
    (home-page "https://bitbucket.org/mfaverge/parsec.git")
    (synopsis "Runtime system based on dynamic task generation mechanism")
    (description
     "PaRSEC is a generic framework for architecture aware scheduling
and management of micro-tasks on distributed many-core heterogeneous
architectures.")
    (license license:bsd-2)
    (source (origin
51
52
53
54
55
56
57
58
59
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit "6022a61dc96c25f11dd2aeabff2a5b3d7bce867d")
                    (recursive? #t)))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
                "10w6ma0r6fdfav5za8yv6m5qhqvcvka5raiz2x38r42snwj0i4c8"))))
60
61
62
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
63
64
                           "-DPARSEC_GPU_WITH_CUDA=OFF"
                           "-DPARSEC_DIST_WITH_MPI=OFF")
65
66
       #:tests? #f))
    (inputs `(("hwloc" ,hwloc)
67
68
              ("bison" ,bison)
              ("flex" ,flex)))
69
    (native-inputs `(("gfortran" ,gfortran)
70
                     ("python" ,python-2)))))
71
72
73
74
75
76
77

(define-public parsec+mpi
  (package
    (inherit parsec)
    (name "parsec-mpi")
    (arguments
     (substitute-keyword-arguments (package-arguments parsec)
78
79
                                   ((#:configure-flags flags '())
                                    `(cons "-DPARSEC_DIST_WITH_MPI=ON" (delete "-DPARSEC_DIST_WITH_MPI=OFF" ,flags)))))
80
    (propagated-inputs `(("mpi" ,openmpi)
81
                         ,@(package-inputs parsec)))))
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98

(define-public quark
  (package
    (name "quark")
    (version "db4aef9a66a00487d849cf8591927dcebe18ef2f")
    (home-page "https://github.com/ecrc/quark")
    (synopsis "QUeuing And Runtime for Kernels")
    (description
     "QUARK (QUeuing And Runtime for Kernels) provides a library that
enables the dynamic execution of tasks with data dependencies in a
multi-core, multi-socket, shared-memory environment.  QUARK infers
data dependencies and precedence constraints between tasks from the
way that the data is used, and then executes the tasks in an
asynchronous, dynamic fashion in order to achieve a high utilization
of the available resources.")
    (license license:bsd-2)
    (source (origin
99
100
101
102
103
104
105
106
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit "db4aef9a66a00487d849cf8591927dcebe18ef2f")))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
                "1bwh8247d70lmbr13h5cb8fpr6m0k9vcaim4bq7j8mynfclb6r77"))))
107
108
109
110
111
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
       #:phases
       (modify-phases %standard-phases
112
113
114
115
116
        (add-after 'unpack 'patch-makefile
                    (lambda _
                      (substitute* "CMakeLists.txt"
                        (("DESTINATION quark")  "DESTINATION include"))
                      #t)))
117
118
       ;; No target for tests
       #:tests? #f))
119
    (propagated-inputs `(("hwloc" ,hwloc "lib")))
120
121
    (native-inputs `(("gfortran" ,gfortran)))))

Ludovic Courtès's avatar
Ludovic Courtès committed
122
123
124
(define-public chameleon
  (package
    (name "chameleon")
125
    (version "1.1.0")
126
    (home-page "https://gitlab.inria.fr/solverstack/chameleon")
PRUVOST Florent's avatar
PRUVOST Florent committed
127
128
129
130
131
132
133
134
135
136
    (synopsis "Dense linear algebra solver")
    (description
     "Chameleon is a dense linear algebra solver relying on sequential
task-based algorithms where sub-tasks of the overall algorithms are submitted
to a run-time system.  Such a system is a layer between the application and
the hardware which handles the scheduling and the effective execution of
tasks on the processing units.  A run-time system such as StarPU is able to
manage automatically data transfers between not shared memory
area (CPUs-GPUs, distributed nodes).")
    (license license:cecill-c)
Ludovic Courtès's avatar
Ludovic Courtès committed
137
    (source (origin
138
139
140
141
142
143
144
145
146
147
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit "4db899ca30d29927018d83964b9b6d517269abe1")
                    ;; We need the submodule in 'CMakeModules/morse_cmake'.
                    (recursive? #t)))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
                "0mpnacmkn1287c003a6n3c4r0n395l6fnjilzi7z53lb34s8kaap"))))
Ludovic Courtès's avatar
Ludovic Courtès committed
148
    (build-system cmake-build-system)
149
    (outputs '("debug" "out"))
Ludovic Courtès's avatar
Ludovic Courtès committed
150
    (arguments
151
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
152
                           "-DCHAMELEON_USE_MPI=ON")
Ludovic Courtès's avatar
Ludovic Courtès committed
153

154
       ;; FIXME: MPI tests too long for gitlab-runner CI
155
156
       #:tests? #f

Ludovic Courtès's avatar
Ludovic Courtès committed
157
       #:phases  (modify-phases %standard-phases
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
                                ;; Without this variable, pkg-config removes paths in already in CFLAGS
                                ;; However, gfortran does not check CPATH to find fortran modules
                                ;; and and the module fabulous_mod cannot be found
                                (add-before 'configure 'fix-pkg-config-env
                                            (lambda _ (setenv "PKG_CONFIG_ALLOW_SYSTEM_CFLAGS" "1") #t))
                                ;; Allow tests with more MPI processes than available CPU cores,
                                ;; which is not allowed by default by OpenMPI
                                (add-before 'check 'prepare-test-environment
                                            (lambda _
                                              (setenv "OMPI_MCA_rmaps_base_oversubscribe" "1") #t))
                                ;; Some of the tests use StarPU, which expects $HOME
                                ;; to be writable.
                                (add-before 'check 'set-home
                                            (lambda _
                                              (setenv "HOME" (getcwd))
                                              #t)))))
174
175
    (inputs `(("lapack" ,openblas)))
    (propagated-inputs `(("starpu" ,starpu)
176
                         ("mpi" ,openmpi)))
Ludovic Courtès's avatar
Ludovic Courtès committed
177
    (native-inputs `(("pkg-config" ,pkg-config)
178
179
180
                     ("gfortran" ,gfortran)
                     ("python" ,python)
                     ("openssh" ,openssh)))))
181
182
183
184
185
186
187

(define-public chameleon+simgrid
  (package
   (inherit chameleon)
   (name "chameleon-simgrid")
   (arguments
    (substitute-keyword-arguments (package-arguments chameleon)
188
189
                                  ((#:configure-flags flags '())
                                   `(cons "-DCHAMELEON_SIMULATION=ON" (cons "-DCHAMELEON_USE_CUDA=ON" (delete "-DCHAMELEON_USE_MPI=ON" ,flags))))))
190
   (inputs `(("simgrid" ,simgrid)
191
             ,@(package-inputs chameleon)))
192
   (propagated-inputs `(("starpu" ,starpu+simgrid+fxt)
193
194
                        ,@(delete `("starpu" ,starpu) (package-inputs chameleon))
                        ,@(delete `("mpi" ,openmpi) (package-inputs chameleon))))))
195

196
197
198
199
200
201
(define-public chameleon+openmp
  (package
   (inherit chameleon)
   (name "chameleon-openmp")
   (arguments
    (substitute-keyword-arguments (package-arguments chameleon)
202
203
                                  ((#:configure-flags flags '())
                                   `(cons "-DCHAMELEON_SCHED=OPENMP" (delete "-DCHAMELEON_USE_MPI=ON" ,flags)))))
204
   (propagated-inputs `(,@(delete `("starpu" ,starpu) (package-inputs chameleon))
205
                        ,@(delete `("mpi" ,openmpi) (package-inputs chameleon))))))
206
207
208
209
210
211
212

(define-public chameleon+quark
  (package
   (inherit chameleon)
   (name "chameleon-quark")
   (arguments
    (substitute-keyword-arguments (package-arguments chameleon)
213
214
                                  ((#:configure-flags flags '())
                                   `(cons "-DCHAMELEON_SCHED=QUARK" (delete "-DCHAMELEON_USE_MPI=ON" ,flags)))))
215
   (propagated-inputs `(("quark" ,quark)
216
217
             ,@(delete `("starpu" ,starpu) (package-inputs chameleon))
             ,@(delete `("mpi" ,openmpi) (package-inputs chameleon))))))
218
219
220
221
222
223
224

(define-public chameleon+parsec
  (package
   (inherit chameleon)
   (name "chameleon-parsec")
   (arguments
    (substitute-keyword-arguments (package-arguments chameleon)
225
226
                                  ((#:configure-flags flags '())
                                   `(cons "-DCHAMELEON_SCHED=PARSEC" (delete "-DCHAMELEON_USE_MPI=ON" ,flags)))))
227
   (propagated-inputs `(("parsec" ,parsec)
228
229
             ,@(delete `("starpu" ,starpu) (package-inputs chameleon))
             ,@(delete `("mpi" ,openmpi) (package-inputs chameleon))))))
230

Ludovic Courtès's avatar
Ludovic Courtès committed
231
232
233
(define-public maphys
  (package
    (name "maphys")
MARAIT Gilles's avatar
MARAIT Gilles committed
234
    (version "1.0.0")
235
    (home-page "https://gitlab.inria.fr/solverstack/maphys/maphys")
Ludovic Courtès's avatar
Ludovic Courtès committed
236
    (source (origin
237
238
239
240
241
242
243
244
245
246
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit version)
                    ;; We need the submodule in 'cmake_modules/morse'.
                    (recursive? #t)))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
                "0pcwfac2x574f6ggfdmahhx9v2hfswyd3nkf3bmc3cd3173312h3"))))
Ludovic Courtès's avatar
Ludovic Courtès committed
247
248
    (build-system cmake-build-system)
    (arguments
249

MARAIT Gilles's avatar
MARAIT Gilles committed
250
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
251
252
253
254
255
256
257
258
                           "-DMAPHYS_BUILD_TESTS=ON"
                           "-DMAPHYS_SDS_MUMPS=ON"
                           "-DMAPHYS_SDS_PASTIX=ON"
                           "-DCMAKE_EXE_LINKER_FLAGS=-lstdc++"
                           "-DMAPHYS_ITE_FABULOUS=ON"
                           "-DMAPHYS_ORDERING_PADDLE=ON"
                           "-DMAPHYS_BLASMT=ON"
                           )
259
260

       #:phases (modify-phases %standard-phases
261
262
263
264
265
266
267
268
269
270
                               ;; Without this variable, pkg-config removes paths in already in CFLAGS
                               ;; However, gfortran does not check CPATH to find fortran modules
                               ;; and and the module fabulous_mod cannot be found
                               (add-before 'configure 'fix-pkg-config-env
                                           (lambda _ (setenv "PKG_CONFIG_ALLOW_SYSTEM_CFLAGS" "1") #t))
                               ;; Allow tests with more MPI processes than available CPU cores,
                               ;; which is not allowed by default by OpenMPI
                               (add-before 'check 'prepare-test-environment
                                           (lambda _
                                             (setenv "OMPI_MCA_rmaps_base_oversubscribe" "1") #t)))))
271

272
    (inputs `(("hwloc" ,hwloc "lib")
273
274
275
276
277
278
279
280
281
282
283
              ("openmpi" ,openmpi)
              ("ssh" ,openssh)
              ("scalapack" ,scalapack)
              ("openblas" ,openblas)
              ;; ("lapack" ,lapack)
              ("scotch" ,pt-scotch)
              ("mumps" ,mumps-openmpi)
              ("pastix" ,pastix-6.0.3)
              ("fabulous" ,fabulous)
              ("paddle", paddle)
              ("metis" ,metis)))
284
    (native-inputs `(("gfortran" ,gfortran)
285
                     ("pkg-config" ,pkg-config)))
286
    (synopsis "Sparse matrix hybrid solver")
Ludovic Courtès's avatar
Ludovic Courtès committed
287
288
    (description
     "MaPHyS (Massively Parallel Hybrid Solver) is a parallel linear solver
289
that couples direct and iterative approaches. The underlying idea is to
Ludovic Courtès's avatar
Ludovic Courtès committed
290
apply to general unstructured linear systems domain decomposition ideas
291
developed for the solution of linear systems arising from PDEs. The
Ludovic Courtès's avatar
Ludovic Courtès committed
292
293
interface problem, associated with the so called Schur complement system, is
solved using a block preconditioner with overlap between the blocks that is
294
referred to as Algebraic Additive Schwarz.To cope with the possible lack of
Ludovic Courtès's avatar
Ludovic Courtès committed
295
296
297
298
299
coarse grid mechanism that enables one to keep constant the number of
iterations when the number of blocks is increased, the solver exploits two
levels of parallelism (between the blocks and within the treatment of the
blocks).  This enables it to exploit a large number of processors with a
moderate number of blocks which ensures a reasonable convergence behavior.")
MARAIT Gilles's avatar
MARAIT Gilles committed
300
    (license license:cecill-c)))
Ludovic Courtès's avatar
Ludovic Courtès committed
301

302
303
304
(define-public paddle
  (package
    (name "paddle")
305
    (version "0.3.4")
306
307
    (home-page "https://gitlab.inria.fr/solverstack/paddle")
    (source (origin
308
309
310
311
312
313
314
315
316
317
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit version)
                    ;; We need the submodule in 'cmake_modules/morse'.
                    (recursive? #t)))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
                "0znb88zi739z4lr2w116810gblw1hzd6pimsrmwivjvr94a0655i"))))
318
319
320
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
321
322
                           "-DPADDLE_BUILD_TESTS=ON"
                           "-DPADDLE_ORDERING_PARMETIS=OFF")
323
       #:phases (modify-phases %standard-phases
324
325
326
327
328
329
330
                                (add-before 'configure 'change-directory
                                            (lambda _ (chdir "src") #t))
                                (add-before 'check 'prepare-test-environment
                                            (lambda _
                                              ;; Allow tests with more MPI processes than available CPU cores,
                                              ;; which is not allowed by default by OpenMPI
                                              (setenv "OMPI_MCA_rmaps_base_oversubscribe" "1") #t)))))
331
    (inputs `(("openmpi" ,openmpi)
332
333
              ("ssh" ,openssh)
              ("scotch" ,pt-scotch)))
334
    (native-inputs `(("gfortran" ,gfortran)
335
                     ("pkg-config" ,pkg-config)))
336
337
338
339
340
341
342
343
    (synopsis "Parallel Algebraic Domain Decomposition for Linear systEms")
    (description
     "This  software’s goal is  to propose  a parallel
  algebraic strategy to decompose a  sparse linear system Ax=b, enabling
  its resolution by a domain decomposition solver.  Up to now, Paddle is
  implemented for the MaPHyS linear solver.")
    (license license:cecill-c)))

344

345
346
347
(define-public fabulous
  (package
    (name "fabulous")
348
    (version "1.1.1")
349
350
    (home-page "https://gitlab.inria.fr/solverstack/fabulous")
    (source (origin
351
352
353
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
354
355
		    ;; release-1.1.1 branch
                    (commit "17259f383801cf414f579f1c9d48d4a6a8377c79")
356
357
358
359
360
                    ;; We need the submodule in 'cmake_modules/morse'.
                    (recursive? #t)))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
361
                "0p7flf8c236cw34if1zg3fzrxf2k4bpjbyn03f06s53r14zz3q5h"))))
362
363
364
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DFABULOUS_BUILD_C_API=ON"
365
366
367
368
369
370
371
372
                           "-DFABULOUS_BUILD_Fortran_API=ON"
                           "-DCMAKE_EXE_LINKER_FLAGS=-lstdc++"
                           "-DFABULOUS_LAPACKE_NANCHECK=OFF"
                           "-DFABULOUS_USE_CHAMELEON=OFF"
                           "-DBUILD_SHARED_LIBS=ON"
                           "-DFABULOUS_BUILD_EXAMPLES=ON"
                           "-DFABULOUS_BUILD_TESTS=OFF")
                         #:tests? #f))
373
     (inputs `(("openblas" ,openblas)
374
               ("lapack" ,lapack)))
375
     (native-inputs `(("gfortran" ,gfortran)
376
                      ("pkg-config" ,pkg-config)))
377
378
379
     (synopsis "Fast Accurate Block Linear krylOv Solver")
     (description
      "Library implementing Block-GMres with Inexact Breakdown and Deflated Restarting,
380
381
Breakdown Free Block Conjudate Gradiant, Block General Conjugate Residual and
Block General Conjugate Residual with Inner Orthogonalization and with inexact breakdown
382
383
384
385
386
387
and deflated restarting")
     (license license:cecill-c)))


(define-public fabulous-1.0.1
  (package
388
    (inherit fabulous)
389
    (name "fabulous-1.0.1")
390
    (version "1.0.1")
391
    (source (origin
392
393
394
395
396
397
              (method git-fetch)
              (uri (git-reference
                    (url (package-home-page fabulous))
                    (commit "96b3922b981ccc1de4c13bc5341f380f1a72e900")
                    ;; We need the submodule in 'cmake_modules/morse'.
                    (recursive? #t)))
398
              (file-name (string-append name "-checkout"))
399
400
401
              (sha256
               (base32
                "1nmhr50vhgj8jj4xsd1iswydl4yz1xm4kmyhkbdqvam2nfdjp1y2"))))
402
     (description
403
      "Library implementing Block-GMres with Inexact Breakdown and Deflated Restarting,
404
Breakdown Free Block Conjudate Gradiant, Block General Conjugate Residual.")))
405

MARAIT Gilles's avatar
MARAIT Gilles committed
406
407
408
(define-public maphys++
  (package
   (name "maphys++")
MARAIT Gilles's avatar
MARAIT Gilles committed
409
   (version "1.0")
MARAIT Gilles's avatar
MARAIT Gilles committed
410
   (home-page "https://gitlab.inria.fr/solverstack/maphys/maphyspp.git")
411
   (synopsis "Sparse matrix hybrid solver")
MARAIT Gilles's avatar
MARAIT Gilles committed
412
   (description
MARAIT Gilles's avatar
MARAIT Gilles committed
413
414
415
416
417
418
    "MAPHYS++ is a parallel linear solver for large sparse linear systems. It
implements a modern C++ interface (C++17/20), giving the user a wide range of
solving methods : efficient direct solver (wrapping MUMPS, Pastix...), iterative
solver (CG, GMRES...) and also allowing for a combination of those (hybrid solve
using the Schur complement, with adapted preconditioners). Parallelism is based
on domain decomposition methods and is implemented in MPI.")
MARAIT Gilles's avatar
MARAIT Gilles committed
419
420
   (license license:cecill-c)
   (source (origin
421
422
423
            (method git-fetch)
            (uri (git-reference
                  (url home-page)
MARAIT Gilles's avatar
MARAIT Gilles committed
424
                  (commit "d5bd6640416b4df117715b38b5686ec9e1ea9887")
425
426
427
428
429
430
                  ;; We need the submodule in 'cmake_modules/morse_cmake'.
                  (recursive? #t)))
            (file-name (string-append name "-" version "-checkout"))
            (sha256
             (base32
              "03sjykh24ms4h2vzylkxcc6v7nshl3w0dhyyrv9grzckmxvmvzij"))))
MARAIT Gilles's avatar
MARAIT Gilles committed
431
   (arguments
MARAIT Gilles's avatar
MARAIT Gilles committed
432
433
434
    '(#:configure-flags '("-DMAPHYSPP_COMPILE_EXAMPLES=ON"
                          "-DMAPHYSPP_COMPILE_TESTS=ON"
                          "-DMAPHYSPP_USE_EIGEN=OFF")
435
436
437
438
439
440
441
                        #:phases (modify-phases %standard-phases
                                                (add-before 'check 'prepare-test-environment
                                                            (lambda _
                                                              ;; Allow tests with more MPI processes than available CPU cores,
                                                              ;; which is not allowed by default by OpenMPI
                                                              (setenv "OMPI_MCA_rmaps_base_oversubscribe" "1") #t)))
                        ))
MARAIT Gilles's avatar
MARAIT Gilles committed
442
   (build-system cmake-build-system)
MARAIT Gilles's avatar
MARAIT Gilles committed
443
   (inputs `(("blaspp" ,blaspp)
444
445
446
             ("lapackpp" ,lapackpp)
             ("pastix" ,pastix)
             ("mumps" ,mumps-openmpi)
MARAIT Gilles's avatar
MARAIT Gilles committed
447
             ("arpack", arpack-ng-3.8)
448
449
             ("scalapack" ,scalapack) ;; should be inherited from mumps?
             ))
450
   (propagated-inputs `(("mpi" ,openmpi)
451
                        ("ssh" ,openssh)))
452
   (native-inputs `(("gfortran" ,gfortran)
453
                    ("pkg-config" ,pkg-config)))
454
   ))
MARAIT Gilles's avatar
MARAIT Gilles committed
455
456
457
458

(define-public blaspp
  (package
    (name "blaspp")
MARAIT Gilles's avatar
MARAIT Gilles committed
459
    (version "2020.08.00")
MARAIT Gilles's avatar
MARAIT Gilles committed
460
    (home-page "https://bitbucket.org/icl/blaspp")
MARAIT Gilles's avatar
MARAIT Gilles committed
461
462
    (synopsis "C++ API for the Basic Linear Algebra Subroutines")
    (description
MARAIT Gilles's avatar
MARAIT Gilles committed
463
464
465
466
467
468
469
     "The Basic Linear Algebra Subprograms (BLAS) have been around for many
decades and serve as the de facto standard for performance-portable and
numerically robust implementation of essential linear algebra functionality.The
objective of BLAS++ is to provide a convenient, performance oriented API for
development in the C++ language, that, for the most part, preserves established
conventions, while, at the same time, takes advantages of modern C++ features,
such as: namespaces, templates, exceptions, etc.")
MARAIT Gilles's avatar
MARAIT Gilles committed
470
    (source (origin
471
472
473
474
475
476
477
478
479
             (method git-fetch)
             (uri (git-reference
                   (url home-page)
                   (commit "049c515c1fafee62b4c1d2870621d6819698f71a")))
             (file-name (string-append name "-" version "-checkout"))
             ;;(patches (search-patches "inria/patches/blaspp-installation-directories.patch"))
             (sha256
              (base32
               "1p3a7sgmy5m2j28m1qnj70fzzmqn2qdrk1bsv4yzpk2a55hfrlqb"))))
MARAIT Gilles's avatar
MARAIT Gilles committed
480
    (arguments
MARAIT Gilles's avatar
MARAIT Gilles committed
481
     '(#:configure-flags '("-DBLASPP_BUILD_TESTS=OFF")
482
                         #:tests? #f))
MARAIT Gilles's avatar
MARAIT Gilles committed
483
484
    ;; tests would need testsweeper https://bitbucket.org/icl/testsweeper
    ;;'(#:configure-flags '("-DBLASPP_BUILD_TESTS=ON")))
MARAIT Gilles's avatar
MARAIT Gilles committed
485
    (build-system cmake-build-system)
MARAIT Gilles's avatar
MARAIT Gilles committed
486
    (propagated-inputs `(("openblas" ,openblas))) ;; technically only blas
Ludovic Courtès's avatar
Ludovic Courtès committed
487
    (license license:bsd-3)))
MARAIT Gilles's avatar
MARAIT Gilles committed
488
489
490

(define-public lapackpp
  (package
MARAIT Gilles's avatar
MARAIT Gilles committed
491
492
493
494
495
496
   (name "lapackpp")
   (version "0.1")
   (home-page "https://bitbucket.org/icl/lapackpp")
   (synopsis "C++ API for the Linear Algebra PACKage")
   (description
    "The Linear Algebra PACKage (LAPACK) is a standard software library for
MARAIT Gilles's avatar
MARAIT Gilles committed
497
498
499
500
501
numerical linear algebra. The objective of LAPACK++ is to provide a convenient,
performance oriented API for development in the C++ language, that, for the most
part, preserves established conventions, while, at the same time, takes
advantages of modern C++ features, such as: namespaces, templates, exceptions,
etc.")
MARAIT Gilles's avatar
MARAIT Gilles committed
502
   (source (origin
503
504
505
506
507
508
509
510
            (method git-fetch)
            (uri (git-reference
                  (url home-page)
                  (commit "e3052eb11b9bab7a7adfe246a53abe8a31c52b3b")))
            (file-name (string-append name "-" version "-checkout"))
            (sha256
             (base32
              "039lyh829xvjc7jgmv39bgy87ap94pqffh52457d0x16mp64qbhn"))))
MARAIT Gilles's avatar
MARAIT Gilles committed
511
512
   (arguments
    '(#:configure-flags '("-DBUILD_LAPACKPP_TESTS=OFF"
513
514
                          "-DBUILD_SHARED_LIBS=ON")
                        #:tests? #f))
MARAIT Gilles's avatar
MARAIT Gilles committed
515
    ;; tests would need testsweeper https://bitbucket.org/icl/testsweeper
MARAIT Gilles's avatar
MARAIT Gilles committed
516
    (build-system cmake-build-system)
MARAIT Gilles's avatar
MARAIT Gilles committed
517
    (inputs `(("blaspp" ,blaspp)))
Ludovic Courtès's avatar
Ludovic Courtès committed
518
    (license license:bsd-3)))
MARAIT Gilles's avatar
MARAIT Gilles committed
519

520
(define-public pastix-6
521
522
  (package
    (name "pastix")
Tony Delarue's avatar
Tony Delarue committed
523
    (version "6.2.1")
524
525
    (home-page "https://gitlab.inria.fr/solverstack/pastix")
    (source (origin
526
527
528
529
530
531
532
533
534
535
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit (string-append "v" version))

                    ;; We need the submodule in 'cmake_modules/morse'.
                    (recursive? #t)))
              (file-name (git-file-name name version))
              (sha256
               (base32
Tony Delarue's avatar
Tony Delarue committed
536
                "1gckmvwk366lb3hdlnc7lcbiqjmg87j74vf4wljcmd48f5gm01zv"))))
537
538
539
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
540
541
542
543
544
                           "-DPASTIX_WITH_MPI=ON"
                           "-DPASTIX_WITH_PARSEC=ON"
                           "-DPASTIX_WITH_STARPU=ON"
                           "-DPASTIX_ORDERING_METIS=OFF"
                           "-DPASTIX_ORDERING_SCOTCH=ON")
545
546

       #:phases (modify-phases %standard-phases
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
                  (add-before 'check 'prepare-test-environment
                    (lambda _
                      ;; StarPU expects $HOME to be writable.
                      (setenv "HOME" (getcwd))

                      ;; The Python-driven tests want to dlopen PaSTiX
                      ;; libraries (via ctypes) so we need to help them.
                      (let* ((libraries   (find-files "." "\\.so$"))
                             (directories (map (compose canonicalize-path
                                                        dirname)
                                               libraries)))
                        (setenv "LD_LIBRARY_PATH"
                                (string-join directories ":"))

                        ;; 'ctypes.util.find_library' tries to link with
                        ;; -lpastix.
                        (setenv "LIBRARY_PATH"
                                (string-append (getenv "LIBRARY_PATH") ":"
                                               (getenv "LD_LIBRARY_PATH")))

                        ;; Allow the 'python_simple' test to find spm.py.
                        (setenv "PYTHONPATH"
                                (string-append (getcwd) "/../source"
                                               "/spm/wrappers/python/spm:"
                                               (getenv "PYTHONPATH")))
                        #t))))
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591

       ;; XXX: The 'python_simple' test fails with:
       ;;   ValueError: Attempted relative import in non-package
       #:tests? #f))
    (native-inputs
     `(("pkg-config" ,pkg-config)
       ("gfortran" ,gfortran)))
    (inputs
     `(("gfortran:lib" ,gfortran "lib")           ;for 'gcc … -lgfortran'
       ("openblas" ,openblas)
       ;; ("lapack" ,lapack)         ;must be built with '-DLAPACKE_WITH_TMG=ON'

       ;; Python bindings and Python tests. Python3
       ("python" ,python)

       ("python-numpy" ,python-numpy)
       ;;("python-scipy" ,python-scipy)
       ))
    (propagated-inputs `(("hwloc" ,hwloc "lib")
MARAIT Gilles's avatar
MARAIT Gilles committed
592
593
594
595
596
597
598
599
                         ("scotch" ,scotch)
                         ;; The following are optional dependencies.

                         ;;GM: somehow these two are needed in propagated-inputs
                         ;;in order to compile maphys++ (otherwise cmake fails
                         ;;to find them)
                         ("parsec" ,parsec+mpi)
                         ("starpu" ,starpu)))
600
601
602
603
604
605
606
607
608
609
610
611
    (synopsis "Sparse matrix direct solver")
    (description
     "PaStiX (Parallel Sparse matriX package) is a scientific library that
provides a high performance parallel solver for very large sparse linear
systems based on direct methods.  Numerical algorithms are implemented in
single or double precision (real or complex) using LLt, LDLt and LU with
static pivoting (for non symmetric matrices having a symmetric pattern).
This solver also provides some low-rank compression methods to reduce the
memory footprint and/or the time-to-solution.")
    (license license:cecill)))

(define-public pastix-6.0.3
612
613
  (package
    (name "pastix")
RAMET Pierre's avatar
RAMET Pierre committed
614
    (version "6.0.3")
615
616
    (home-page "https://gitlab.inria.fr/solverstack/pastix")
    (source (origin
617
618
619
620
621
622
623
624
625
626
627
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit (string-append "v" version))

                    ;; We need the submodule in 'cmake_modules/morse'.
                    (recursive? #t)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1ccj5p1zm50x3qd6yr7j5ajh2dlpmm95lhzrbyv9rbnxrk66azid"))))
628
629
630
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
631
632
633
634
635
                           "-DPASTIX_WITH_MPI=ON"
                           "-DPASTIX_WITH_PARSEC=ON"
                           "-DPASTIX_WITH_STARPU=ON"
                           "-DPASTIX_ORDERING_METIS=OFF"
                           "-DPASTIX_ORDERING_SCOTCH=ON")
636
637

       #:phases (modify-phases %standard-phases
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
                  (add-before 'check 'prepare-test-environment
                    (lambda _
                      ;; StarPU expects $HOME to be writable.
                      (setenv "HOME" (getcwd))

                      ;; The Python-driven tests want to dlopen PaSTiX
                      ;; libraries (via ctypes) so we need to help them.
                      (let* ((libraries   (find-files "." "\\.so$"))
                             (directories (map (compose canonicalize-path
                                                        dirname)
                                               libraries)))
                        (setenv "LD_LIBRARY_PATH"
                                (string-join directories ":"))

                        ;; 'ctypes.util.find_library' tries to link with
                        ;; -lpastix.
                        (setenv "LIBRARY_PATH"
                                (string-append (getenv "LIBRARY_PATH") ":"
                                               (getenv "LD_LIBRARY_PATH")))

                        ;; Allow the 'python_simple' test to find spm.py.
                        (setenv "PYTHONPATH"
                                (string-append (getcwd) "/../source"
                                               "/spm/wrappers/python/spm:"
                                               (getenv "PYTHONPATH")))
                        #t))))
664
665
666
667
668
669
670
671
672
673

       ;; XXX: The 'python_simple' test fails with:
       ;;   ValueError: Attempted relative import in non-package
       #:tests? #f))
    (native-inputs
     `(("pkg-config" ,pkg-config)
       ("gfortran" ,gfortran)))
    (inputs
     `(("gfortran:lib" ,gfortran "lib")           ;for 'gcc … -lgfortran'
       ("openblas" ,openblas)
674
       ;; ("lapack" ,lapack)         ;must be built with '-DLAPACKE_WITH_TMG=ON'
675
676

       ;; The following are optional dependencies.
677
       ("parsec" ,parsec+mpi)
678
       ("starpu" ,starpu)
679

680
681
       ;; Python bindings and Python tests. Python3
       ("python" ,python)
682

683
684
       ("python-numpy" ,python-numpy)
       ;;("python-scipy" ,python-scipy)
685
       ))
MARAIT Gilles's avatar
MARAIT Gilles committed
686
    (propagated-inputs `(("hwloc" ,hwloc "lib")
687
                         ("scotch" ,scotch)))
688
689
690
    (synopsis "Sparse matrix direct solver")
    (description
     "PaStiX (Parallel Sparse matriX package) is a scientific library that
Ludovic Courtès's avatar
Ludovic Courtès committed
691
692
693
694
695
696
provides a high performance parallel solver for very large sparse linear
systems based on direct methods.  Numerical algorithms are implemented in
single or double precision (real or complex) using LLt, LDLt and LU with
static pivoting (for non symmetric matrices having a symmetric pattern).
This solver also provides some low-rank compression methods to reduce the
memory footprint and/or the time-to-solution.")
697
    (license license:cecill)))
698

699
700
701
702
703
704
(define-public pastix-nompi
  (package
   (inherit pastix-6)
   (name "pastix-nompi")
   (arguments
    (substitute-keyword-arguments (package-arguments pastix-6)
705
706
                                  ((#:configure-flags flags '())
                                   `(delete "-DPASTIX_WITH_MPI=ON" ,flags))))
707
   (inputs `(,@(delete `("parsec" ,parsec+mpi) (package-inputs pastix-6))
708
709
             ("parsec" ,parsec)
             ,@(package-inputs pastix-6)))))
710

711
712
(define-public pastix-5
  (package
713
  (name "pastix-5")
714
  (version "5.2.3")
715
  (home-page "https://gitlab.inria.fr/solverstack/pastix")
716
717
718
719
720
721
722
723
  (source
   (origin
    (method url-fetch)
    (uri
     "https://gforge.inria.fr/frs/download.php/file/36212/pastix_5.2.3.tar.bz2")
    (sha256
     (base32
      "0iqyxr5lzjpavmxzrjj4kwayq62nip3ssjcm80d20zk0n3k7h6b4"))))
724
725
726
727
728
  (build-system gnu-build-system)
  (arguments
   '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
     #:phases
     (modify-phases %standard-phases
729
730
731
732
733
734
735
736
                    (add-after 'unpack 'goto-src-dir
                             (lambda _
                               (chdir "src") #t))
                    (replace 'configure
                             (lambda* (#:key inputs #:allow-other-keys)
                               (call-with-output-file "config.in"
                                 (lambda (port)
                                   (format port "
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
HOSTARCH    = i686_pc_linux
VERSIONBIT  = _32bit
EXEEXT      =
OBJEXT      = .o
LIBEXT      = .a
CCPROG      = gcc -Wall
CFPROG      = gfortran
CF90PROG    = gfortran -ffree-form
CXXPROG     = g++

MCFPROG     = mpif90
CF90CCPOPT  = -ffree-form -x f95-cpp-input
# Compilation options for optimization (make expor)
CCFOPT      = -O3
# Compilation options for debug (make | make debug)
CCFDEB      = -g3
CXXOPT      = -O3
NVCCOPT     = -O3

LKFOPT      =
MKPROG      = make
MPCCPROG    = mpicc -Wall
MPCXXPROG   = mpic++ -Wall
CPP         = cpp
ARFLAGS     = ruv
ARPROG      = ar
EXTRALIB    = -lgfortran -lm -lrt
CTAGSPROG   = ctags

VERSIONMPI  = _mpi
VERSIONSMP  = _smp
VERSIONSCH  = _static
VERSIONINT  = _int
VERSIONPRC  = _simple
VERSIONFLT  = _real
VERSIONORD  = _scotch

###################################################################
#                  SETTING INSTALL DIRECTORIES                    #
###################################################################
# ROOT          = /path/to/install/directory
# INCLUDEDIR    = ${ROOT}/include
# LIBDIR        = ${ROOT}/lib
# BINDIR        = ${ROOT}/bin
# PYTHON_PREFIX = ${ROOT}

###################################################################
#                  SHARED LIBRARY GENERATION                      #
###################################################################
786
787
788
789
790
791
SHARED=1
SOEXT=.so
SHARED_FLAGS =  -shared -Wl,-soname,__SO_NAME__
CCFDEB       := ${CCFDEB} -fPIC
CCFOPT       := ${CCFOPT} -fPIC
CFPROG       := ${CFPROG} -fPIC
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844

###################################################################
#                          INTEGER TYPE                           #
###################################################################
# Uncomment the following lines for integer type support (Only 1)

#VERSIONINT  = _long
#CCTYPES     = -DFORCE_LONG -DINTSIZELONG
#---------------------------
VERSIONINT  = _int32
CCTYPES     = -DINTSIZE32
#---------------------------
#VERSIONINT  = _int64
#CCTYPES     = -DINTSSIZE64

###################################################################
#                           FLOAT TYPE                            #
###################################################################
CCTYPESFLT  =
# Uncomment the following lines for double precision support
VERSIONPRC  = _double
CCTYPESFLT := $(CCTYPESFLT) -DPREC_DOUBLE

# Uncomment the following lines for float=complex support
VERSIONFLT  = _complex
CCTYPESFLT := $(CCTYPESFLT) -DTYPE_COMPLEX

###################################################################
#                          FORTRAN MANGLING                       #
###################################################################
#CCTYPES    := $(CCTYPES) -DPASTIX_FM_NOCHANGE

###################################################################
#                          MPI/THREADS                            #
###################################################################

# Uncomment the following lines for sequential (NOMPI) version
#VERSIONMPI  = _nompi
#CCTYPES    := $(CCTYPES) -DFORCE_NOMPI
#MPCCPROG    = $(CCPROG)
#MCFPROG     = $(CFPROG)
#MPCXXPROG   = $(CXXPROG)

# Uncomment the following lines for non-threaded (NOSMP) version
#VERSIONSMP  = _nosmp
#CCTYPES    := $(CCTYPES) -DFORCE_NOSMP

# Uncomment the following line to enable a progression thread,
#  then use IPARM_THREAD_COMM_MODE
#CCPASTIX   := $(CCPASTIX) -DPASTIX_THREAD_COMM

# Uncomment the following line if your MPI doesn't support MPI_THREAD_MULTIPLE,
# level then use IPARM_THREAD_COMM_MODE
845
#CCPASTIX   := $(CCPASTIX) -DPASTIX_FUNNELED
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877

# Uncomment the following line if your MPI doesn't support MPI_Datatype
# correctly
#CCPASTIX   := $(CCPASTIX) -DNO_MPI_TYPE

# Uncomment the following line if you want to use semaphore barrier
# instead of MPI barrier (with IPARM_AUTOSPLIT_COMM)
#CCPASTIX    := $(CCPASTIX) -DWITH_SEM_BARRIER

# Uncomment the following lines to enable StarPU.
#CCPASTIX   := $(CCPASTIX) `pkg-config libstarpu --cflags` -DWITH_STARPU
#EXTRALIB   := $(EXTRALIB) `pkg-config libstarpu --libs`
# Uncomment the correct 2 lines
#CCPASTIX   := $(CCPASTIX) -DCUDA_SM_VERSION=11
#NVCCOPT    := $(NVCCOPT) -maxrregcount 32 -arch sm_11
#CCPASTIX   := $(CCPASTIX) -DCUDA_SM_VERSION=13
#NVCCOPT    := $(NVCCOPT) -maxrregcount 32 -arch sm_13
CCPASTIX   := $(CCPASTIX) -DCUDA_SM_VERSION=20
NVCCOPT    := $(NVCCOPT) -arch sm_20

# Uncomment the following line to enable StarPU profiling
# ( IPARM_VERBOSE > API_VERBOSE_NO ).
#CCPASTIX   := $(CCPASTIX) -DSTARPU_PROFILING

# Uncomment the following line to enable CUDA (StarPU)
#CCPASTIX   := $(CCPASTIX) -DWITH_CUDA

###################################################################
#                          Options                                #
###################################################################

# Show memory usage statistics
878
CCPASTIX   := $(CCPASTIX) -DMEMORY_USAGE
879
880

# Show memory usage statistics in solver
881
#CCPASTIX   := $(CCPASTIX) -DSTATS_SOPALIN
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899

# Uncomment following line for dynamic thread scheduling support
#CCPASTIX   := $(CCPASTIX) -DPASTIX_DYNSCHED

# Uncomment the following lines for Out-of-core
#CCPASTIX   := $(CCPASTIX) -DOOC -DOOC_NOCOEFINIT -DOOC_DETECT_DEADLOCKS

###################################################################
#                      GRAPH PARTITIONING                         #
###################################################################

# Uncomment the following lines for using metis ordering
#VERSIONORD  = _metis
#METIS_HOME  = ${HOME}/metis-4.0
#CCPASTIX   := $(CCPASTIX) -DMETIS -I$(METIS_HOME)/Lib
#EXTRALIB   := $(EXTRALIB) -L$(METIS_HOME) -lmetis

# Scotch always needed to compile
900
901
902
SCOTCH_HOME  = ~a
SCOTCH_INC  ?= $(SCOTCH_HOME)/include
SCOTCH_LIB  ?= $(SCOTCH_HOME)/lib
903
904
# Uncomment on of this blocks
#scotch
905
906
CCPASTIX   := $(CCPASTIX) -I$(SCOTCH_INC) -DWITH_SCOTCH
EXTRALIB   := $(EXTRALIB) -L$(SCOTCH_LIB) -lscotch -lscotcherrexit
907
#ptscotch
908
#CCPASTIX   := $(CCPASTIX) -I$(SCOTCH_INC) -DDISTRIBUTED -DWITH_SCOTCH
909
#if scotch >= 6.0
910
#EXTRALIB   := $(EXTRALIB) -L$(SCOTCH_LIB) -lptscotch -lscotch -lptscotcherrexit
911
912
913
914
915
916
917
918
#else
#EXTRALIB   := $(EXTRALIB) -L$(SCOTCH_LIB) -lptscotch -lptscotcherrexit

###################################################################
#                Portable Hardware Locality                       #
###################################################################
# By default PaStiX uses hwloc to bind threads,
# comment this lines if you don't want it (not recommended)
919
HWLOC_HOME  = ~a
920
921
922
923
924
925
926
927
928
929
930
HWLOC_INC  ?= $(HWLOC_HOME)/include
HWLOC_LIB  ?= $(HWLOC_HOME)/lib
CCPASTIX   := $(CCPASTIX) -I$(HWLOC_INC) -DWITH_HWLOC
EXTRALIB   := $(EXTRALIB) -L$(HWLOC_LIB) -lhwloc

###################################################################
#                             MARCEL                              #
###################################################################

# Uncomment following lines for marcel thread support
#VERSIONSMP := $(VERSIONSMP)_marcel
931
932
#CCPASTIX   := $(CCPASTIX) `pm2-config --cflags`
#CCPASTIX   := -I${PM2_ROOT}/marcel/include/pthread
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
#EXTRALIB   := $(EXTRALIB) `pm2-config --libs`
# ---- Thread Posix ------
EXTRALIB   := $(EXTRALIB) -lpthread

# Uncomment following line for bubblesched framework support
# (need marcel support)
#VERSIONSCH  = _dyn
#CCPASTIX   := $(CCPASTIX) -DPASTIX_BUBBLESCHED

###################################################################
#                              BLAS                               #
###################################################################

# Choose Blas library (Only 1)
# Do not forget to set BLAS_HOME if it is not in your environnement
# BLAS_HOME=/path/to/blas
#----  Blas    ----
Marek Felšöci's avatar
Marek Felšöci committed
950
BLASLIB  = -lopenblas
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
#---- Gotoblas ----
#BLASLIB  = -L${BLAS_HOME} -lgoto
#----  MKL     ----
#Uncomment the correct line
#BLASLIB  = -L$(BLAS_HOME) -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
#BLASLIB  = -L$(BLAS_HOME) -lmkl_intel -lmkl_sequential -lmkl_core
#----  Acml    ----
#BLASLIB  = -L$(BLAS_HOME) -lacml

###################################################################
#                             MURGE                               #
###################################################################
# Uncomment if you need MURGE interface to be thread safe
# CCPASTIX   := $(CCPASTIX) -DMURGE_THREADSAFE
# Uncomment this to have more timings inside MURGE
# CCPASTIX   := $(CCPASTIX) -DMURGE_TIME

###################################################################
#                          DO NOT TOUCH                           #
###################################################################

FOPT      := $(CCFOPT)
FDEB      := $(CCFDEB)
CCHEAD    := $(CCPROG) $(CCTYPES) $(CCFOPT)
CCFOPT    := $(CCFOPT) $(CCTYPES) $(CCPASTIX)
CCFDEB    := $(CCFDEB) $(CCTYPES) $(CCPASTIX)
NVCCOPT   := $(NVCCOPT) $(CCTYPES) $(CCPASTIX)

###################################################################
#                        MURGE COMPATIBILITY                      #
###################################################################

MAKE     = $(MKPROG)
CC       = $(MPCCPROG)
CFLAGS   = $(CCFOPT) $(CCTYPESFLT)
FC       = $(MCFPROG)
FFLAGS   = $(CCFOPT)
LDFLAGS  = $(EXTRALIB) $(BLASLIB)
CTAGS    = $(CTAGSPROG)
"
991
992
993
994
995
996
997
                                           (assoc-ref inputs "scotch32")
                                           (assoc-ref inputs "hwloc")
                                   ))) #t))
                    (replace 'check
                             (lambda _
                               (invoke "make" "examples")
                               (invoke "./example/bin/simple" "-lap" "100"))))))
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
  (inputs
   `(("gfortran:lib" ,gfortran "lib")
     ("openblas" ,openblas)))
  (native-inputs
   `(("pkg-config" ,pkg-config)
     ("gfortran" ,gfortran)
     ("perl" ,perl)))
  (propagated-inputs
   `(("openmpi" ,openmpi-with-mpi1-compat)
     ("hwloc" ,hwloc-1 "lib")
     ("openssh" ,openssh)
     ("scotch32" ,scotch32)))
  (outputs '( "out" "debug" ))
  (synopsis "Sparse matrix direct solver (version 5)")
  (description
   "PaStiX (Parallel Sparse matriX package, version 5) is a scientific library
that provides a high performance parallel solver for very large sparse linear
systems based on direct methods.  Numerical algorithms are implemented in single
or double precision (real or complex) using LLt, LDLt and LU with static
pivoting (for non symmetric matrices having a symmetric pattern). This solver
also provides some low-rank compression methods to reduce the memory footprint
and/or the time-to-solution.")
  (license license:cecill)))
1021
1022

(define-public pastix pastix-6)
AGULLO Emmanuel's avatar
AGULLO Emmanuel committed
1023
1024
1025
1026
1027
1028
1029

(define-public pastix-nopython-notest
  (package
   (inherit pastix)
   (name "pastix-nopython-notest")
   (arguments
    (substitute-keyword-arguments (package-arguments chameleon)
1030
1031
                                  ((#:configure-flags flags '())
                                   `(cons "-DPASTIX_BUILD_TESTING=OFF" ,flags))))
AGULLO Emmanuel's avatar
AGULLO Emmanuel committed
1032
   (inputs `(
1033
1034
1035
1036
             ,@(delete `("python2" ,python-2) (package-inputs pastix))
             ,@(delete `("python-numpy" ,python2-numpy) (package-inputs pastix))
             ;; ,@(delete `("python-scipy" ,python2-scipy) (package-inputs pastix))
             ))))
MARAIT Gilles's avatar
MARAIT Gilles committed
1037

1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
(define-public pmtool
  (package
    (name "pmtool")
    (version "1.0.0")
    (home-page "https://gitlab.inria.fr/eyrauddu/pmtool")
    (synopsis "pmtool: Post-Mortem Tool")
    (description
     "pmtool aims at performing post-mortem analyses of the behavior
of StarPU applications. Provide lower bounds on makespan. Study the
performance of different schedulers in a simple context. Limitations:
ignore communications for the moment; branch comms attempts to remove
this limitation.")
    (license license:gpl3+)
    (source (origin
1052
1053
1054
1055
1056
1057
1058
1059
1060
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit "e11dc2996ab976275ac678c2686db2afcf480137")
                    (recursive? #f)))
              (file-name (string-append name "-" version "-checkout"))
              (sha256
               (base32
                "18dad0w21av8jps8mfzj99mb237lrr27mmgbh3s16g94lfpnffd9"))))
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
    (build-system cmake-build-system)
    (outputs '("debug" "out"))
    (arguments
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=OFF")

       ;; FIXME: no make test available for now in pmtool
       #:tests? #f))

    (inputs `(("recutils" ,recutils)))
    (native-inputs `(("gcc-toolchain" ,gcc-toolchain)))))

MARAIT Gilles's avatar
MARAIT Gilles committed
1072
1073
1074
1075
(define-public scalable-python
  (package
   (inherit python-2.7)
   (name "scalable-python")
1076
   (version "2.7.13")
MARAIT Gilles's avatar
MARAIT Gilles committed
1077
1078
   (home-page "https://github.com/CSCfi/scalable-python.git")
   (source (origin
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
            (method git-fetch)
            (uri (git-reference
                  (url home-page)
                  (commit "b0b9d3f29298b719f9e4f684deae713c0a224b0e")
                  ))
            (patches (search-patches
                      "inria/patches/scalable-python.patch"
                      "python-2.7-search-paths.patch"
                      "python-2-deterministic-build-info.patch"
                      "python-2.7-site-prefixes.patch"
                      ))
            (sha256
             (base32
              "0ivxsf17x7vjxr5h4g20rb5i3k705vgd502ma024z95fnyzd0bqi"))))
MARAIT Gilles's avatar
MARAIT Gilles committed
1093
1094
   (arguments
    (substitute-keyword-arguments (package-arguments python-2.7)
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
                                  ((#:phases phases)
                                   `(modify-phases ,phases
                                                   (add-before 'configure 'permissions_gramfiles
                                                               (lambda _
                                                                 (chmod "Python/graminit.c" #o764)
                                                                 (chmod "Include/graminit.h" #o764) #t))
                                                   (add-before 'build 'fix_makefile
                                                               (lambda _
                                                                 (chmod "Python/graminit.c" #o764)
                                                                 (chmod "Include/graminit.h" #o764) #t))
                                                   (replace 'move-tk-inter (lambda _ #t)) ;; Not sure what this is anyway
                                                   ))
                                  ((#:configure-flags flags '())
                                   `(cons "--enable-mpi" (cons "--without-ensurepip" (delete "--with-ensurepip=install",flags))))
                                  ((#:make-flags makeflags '())
                                   `(cons "mpi" (cons "install" (cons "install-mpi",makeflags))))
                                  ((#:tests? runtests '())
                                   #f)
                                  ))
MARAIT Gilles's avatar
MARAIT Gilles committed
1114
1115
1116
1117
1118
1119
   (description
    "Modified python 2.7.13. Scalable Python performs the I/O operations used
e.g. by import statements in a single process and uses MPI to transmit data
to/from all other processes.")
   (propagated-inputs `(("openmpi" ,openmpi)))
   ))
1120

1121
;; Fix python2-sympy
1122
1123
1124
1125
1126
1127
(define-public fixed-python2-sympy
  (package
   (inherit (package-with-python2 python-sympy))
   (name "fixed-python2-sympy")
   (arguments
    `(#:python ,python-2
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
               #:phases
               (modify-phases %standard-phases
                              ;; Run the core tests after installation.  By default it would run
                              ;; *all* tests, which take a very long time to complete and are known
                              ;; to be flaky.
                              (delete 'check)
                              (add-after 'install 'check
                                         (lambda* (#:key outputs #:allow-other-keys)
                                                  (invoke "python" "-c" "import sympy; sympy.test(\"/core\")")
                                                  #t)))))))
1138
1139
1140
;; Add mpi4py with python2
(define-public python2-mpi4py
  (package-with-python2 python-mpi4py))
1141
1142
1143
1144
1145
1146
1147

(define-public arpack-ng-3.8
  (package
   (name "arpack-ng-3.8")
   (version "3.8.0")
   (home-page "https://github.com/opencollab/arpack-ng")
   (source (origin
1148
1149
1150
1151
1152
1153
            (method git-fetch)
            (uri (git-reference (url home-page) (commit version)))
            (file-name (git-file-name name version))
            (sha256
             (base32
              "0l7as5z6xvbxly8alam9s4kws70952qq35a6vkljzayi4b9gbklx"))))
1154
1155
1156
   (build-system cmake-build-system)
   (arguments
    '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
1157
                          "-DICB=ON")))
1158
1159
1160
1161
1162
1163
1164
1165
   (inputs
    `(("lapack" ,lapack)
      ("fortran" ,gfortran)))
   (synopsis "Fortran subroutines for solving eigenvalue problems")
   (description
    "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
large scale eigenvalue problems.")
   (license (license:non-copyleft "file://COPYING"
1166
                                  "See COPYING in the distribution."))))
MARAIT Gilles's avatar
MARAIT Gilles committed
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194

;; Technically this is just jube version 2.4.1
;; supporting yaml (in addition of xml) for bench files from version 2.4.0
(define-public jube-with-yaml
  (package
    ;; This is a command-line tool, so no "python-" prefix.
   (name "jube-with-yaml")
    (version "2.4.1")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "http://apps.fz-juelich.de/jsc/jube/jube2/download.php?version="
                    version))
              (sha256
               (base32
                "05lhpq3mxm3z9k35bxvvbi2r5r5r0n39jdi839rcvirrsczs7m6m"))
              (file-name (string-append "jube-" version ".tar.gz"))))
    (build-system python-build-system)
    (home-page "https://apps.fz-juelich.de/jsc/jube/jube2/docu/index.html")
    (synopsis "Benchmarking environment")
    (description
     "JUBE helps perform and analyze benchmarks in a systematic way.  For each
benchmarked application, benchmark data is stored in a format that allows JUBE
to deduct the desired information.  This data can be parsed by automatic pre-
and post-processing scripts that draw information and store it more densely
for manual interpretation.")
    (propagated-inputs `(("python-pyyaml" ,python-pyyaml)))
    (license license:gpl3+)))
ESTERIE Pierre's avatar
ESTERIE Pierre committed
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239

(define-public scalfmm
  (package
   (name "scalfmm")
   (version "3.0")
   (home-page "https://gitlab.inria.fr/solverstack/ScalFMM.git")
   (synopsis "Fast Multipole Methos Framework")
   (description
    "ScalFMM is a C++ library that implements a kernel independent Fast Multipole Method.")
   (license license:cecill-c)
   (source (origin
            (method git-fetch)
            (uri (git-reference
                  (url home-page)
                  (commit "33ea9ae3f0c39b31fa9fb631653e34340d8100dd")
                  ;; We need the submodule in 'cmake_modules/morse_cmake'.
                  (recursive? #t)))
            (file-name (string-append name "-" version))
            (sha256
             (base32
              "05n7isr54zynw6gf6mgc973qdg8nm06f434y3l3qvwz2ijjvb43f"))))
   (arguments
    '(#:configure-flags '("-Dscalfmm_BUILD_EXAMPLES=ON"
                          "-Dscalfmm_BUILD_TOOLS=ON"
                          "-Dscalfmm_BUILD_UNITS=ON")
                        #:tests? #f
                        #:phases (modify-phases %standard-phases
                                    (add-after 'unpack 'goto-src-dir
                                        (lambda _
                                            (chdir "experimental") #t))
                                    (add-before 'check 'prepare-test-environment
                                        (lambda _
                                          ;; Allow tests with more MPI processes than available CPU cores,
                                          ;; which is not allowed by default by OpenMPI
                                          (setenv "OMPI_MCA_rmaps_base_oversubscribe" "1") #t)))
                        ))
   (build-system cmake-build-system)
   (inputs `(("openblas" ,openblas)
             ("fftw" ,fftw)
             ("fftwf" ,fftwf)
             ))
   (propagated-inputs `(("mpi" ,openmpi)
                        ("ssh" ,openssh)))
   (native-inputs `(("pkg-config" ,pkg-config)))
   ))