source: trunk/dports/math/mumps/Portfile

Last change on this file was 149006, checked in by dstrubbe@…, 16 months ago

mumps: Use linear_algebra port group, thus offering atlas and openblas as options for BLAS. Add test phase: this required undoing the patch in the examples directory which seemed confused about which libraries were being built shared.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 149006 2016-05-24 21:56:20Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           mpi 1.0
6PortGroup           linear_algebra 1.0
7
8name                mumps
9version             5.0.1
10categories          math
11license             public-domain
12platforms           darwin
13maintainers         sean openmaintainer
14description         MUltifrontal Massively Parallel sparse direct Solver
15long_description    MUMPS: a parallel sparse direct solver
16supported_archs     noarch
17
18depends_lib         port:scalapack port:parmetis
19
20homepage            http://mumps.enseeiht.fr/
21master_sites        ${homepage}
22
23distname            MUMPS_${version}
24
25checksums           rmd160  f5a99de1a9ee7e28c6f9fddac0a4852ec660109e \
26                    sha256  50355b2e67873e2239b4998a46f2bbf83f70cdad6517730ab287ae3aae9340a0
27
28mpi.setup           require require_fortran
29
30mpi.enforce_variant scalapack
31
32linalg.setup        blas_only
33
34patch.pre_args      -p1
35patchfiles-append   patch-shared.diff
36
37use_parallel_build  no
38use_configure       no
39
40build.target        alllib
41build.args          SHAREDFLAGS="-dynamiclib" PREFIX="${prefix}" SHAREDLIBEXT=".dylib"
42
43configure.cflags    -fPIC -O3 -mtune=native
44configure.fflags    -fPIC -O3 -mtune=native
45configure.f90flags  -fPIC -O3 -mtune=native
46
47post-extract {
48    file copy ${worksrcpath}/Make.inc/Makefile.inc.generic ${worksrcpath}/Makefile.inc
49    reinplace "s|^\#LMETISDIR.*$|LMETISDIR = ${prefix}/lib|" ${worksrcpath}/Makefile.inc
50    reinplace "s|^\#IMETIS.*$|IMETIS = -I${prefix}/include|" ${worksrcpath}/Makefile.inc
51    reinplace "s|^\#LMETIS.*$|LMETIS = ${prefix}/lib/libparmetis.dylib ${prefix}/lib/libmetis.dylib|" ${worksrcpath}/Makefile.inc
52    reinplace "s|^ORDERINGSF.*$|ORDERINGSF = -Dpord -Dparmetis|" ${worksrcpath}/Makefile.inc
53    reinplace "s|^CC .*$|CC = ${configure.cc}|" ${worksrcpath}/Makefile.inc
54    reinplace "s|^FC .*$|FC = ${configure.f90}|" ${worksrcpath}/Makefile.inc
55    reinplace "s|^FL .*$|FL = ${configure.f90}|" ${worksrcpath}/Makefile.inc
56    reinplace "s|^OPTC .*$|OPTC = ${configure.cflags}|" ${worksrcpath}/Makefile.inc
57    reinplace "s|^OPTL .*$|OPTL = ${configure.cflags}|" ${worksrcpath}/Makefile.inc
58    reinplace "s|^OPTF .*$|OPTF = ${configure.f90flags}|" ${worksrcpath}/Makefile.inc
59    reinplace "s|^AR.*$|AR = ar cr |" ${worksrcpath}/Makefile.inc
60    reinplace "s|^RANLIB.*$|RANLIB = ranlib -c|" ${worksrcpath}/Makefile.inc
61    reinplace "s|^SCALAP.*$|SCALAP = ${prefix}/lib/libscalapack.dylib|" ${worksrcpath}/Makefile.inc
62    reinplace "s|^INCPAR.*$|INCPAR = -I\$(topdir)/include|" ${worksrcpath}/Makefile.inc
63    reinplace "s|^LIBPAR.*$|LIBPAR = \$(SCALAP)|" ${worksrcpath}/Makefile.inc
64    reinplace "s|^LIBBLAS.*$|LIBBLAS = ${linalglib}|" ${worksrcpath}/Makefile.inc
65}
66
67destroot {
68  eval xinstall -m 644 [glob ${worksrcpath}/include/*.h] ${destroot}${prefix}/include
69  eval xinstall -m 644 [glob ${worksrcpath}/lib/*.a] ${destroot}${prefix}/lib
70  eval xinstall -m 644 [glob ${worksrcpath}/lib/*.dylib] ${destroot}${prefix}/lib
71}
72
73livecheck.type      none
74
75test.run            yes
76test.target         all
77test.args-append    PREFIX="${prefix}" LPORD=../lib/libpord.a
78
79post-test {
80    if {![catch {sysctl hw.ncpu} result]} {
81        set njobs $result
82    } else {
83        set njobs 1
84    }
85    set runcmd "${mpi.exec} -np ${njobs}"
86
87    system -W ${worksrcpath}/examples "${runcmd} ./ssimpletest < input_simpletest_real"
88    system -W ${worksrcpath}/examples "${runcmd} ./dsimpletest < input_simpletest_real"
89    system -W ${worksrcpath}/examples "${runcmd} ./csimpletest < input_simpletest_cmplx"
90    system -W ${worksrcpath}/examples "${runcmd} ./zsimpletest < input_simpletest_cmplx"
91    system -W ${worksrcpath}/examples "${runcmd} ./c_example"
92}
Note: See TracBrowser for help on using the repository browser.