Ticket #50373: Portfile-harminv.diff

File Portfile-harminv.diff, 4.9 KB (added by dstrubbe (David Strubbe), 9 years ago)
  • Portfile

     
    22# $Id$
    33
    44PortSystem          1.0
     5PortGroup           compilers 1.0
    56
    67license             GPL-2
    78name                harminv
    89categories          science
    9 version             1.3.1
    10 revision            1
     10version             1.4
    1111platforms           darwin
    12 maintainers         saabusa.com:Yogesh.Sharma
    13 description         MIT Eletromagnetic Equation Propagation
    14 long_description    solve the problem of harmonic inversion — given a discrete-time, finite-length signal that consists of a sum of finitely-many sinusoids (possibly exponentially decaying) \
    15                     in a given bandwidth, it determines the frequencies, decay constants, amplitudes, and phases of those sinusoids
    16 homepage            http://ab-initio.mit.edu/harminv
     12maintainers         saabusa.com:Yogesh.Sharma openmaintainer
     13description         MIT Electromagnetic Equation Propagation
     14long_description    Solve the problem of harmonic inversion: given a discrete-time, finite-length signal that consists of a sum of \
     15                    finitely-many sinusoids (possibly exponentially decaying) \
     16                    in a given bandwidth, it determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.
     17homepage            http://ab-initio.mit.edu/wiki/index.php/Harminv
    1718master_sites        http://ab-initio.mit.edu/harminv
    18 checksums           md5     d3f49f1c90856b3b2e8b77dc4a99c37a \
    19                     sha1    ef75161233df92393110b783d2945b5915c8291a \
    20                     rmd160  340de65da54b197f70adec43ecd2907a757d6d35
     19checksums           md5     b95e24a9bc7e07d3d2202d1605e9e86f \
     20                    sha1    521fcca261bf91f45741b607aa2b244c7a1e0aff \
     21                    rmd160  3813c438339bb1fc048d62bb9d012df43535aecb
    2122depends_lib         port:guile
    2223
    23 configure.args      --mandir="${prefix}/share/man"
     24configure.args-append   --mandir="${prefix}/share/man"
    2425
    25 set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
    26 set default_fortran_variant +gcc48
    27 set g95_conflicts {}
     26compilers.choose    f77
     27compilers.setup     require_fortran
    2828
    29 foreach ver ${gcc_versions} {
    30     set ver_no_dot [join [split ${ver} "."] ""]
    31 
    32     set variant_line {variant gcc${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}" conflicts g95}
    33 
    34     foreach over ${gcc_versions} {
    35         if {${ver} == ${over}} {
    36             continue
    37         }
    38 
    39         set over_no_dot [join [split ${over} "."] ""]
    40         append variant_line " conflicts gcc${over_no_dot}"
    41     }
    42     append variant_line { {}}
    43 
    44     eval $variant_line
    45 
    46     append g95_conflicts " conflicts gcc${ver_no_dot}"
    47 
    48     if {[variant_isset gcc${ver_no_dot}]} {
    49         if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
    50             set default_fortran_variant ""
    51         }
    52     }
     29if {![variant_isset accelerate] && ![variant_isset atlas] && ![variant_isset openblas]} {
     30    default_variants-append +accelerate
    5331}
    5432
    55 eval [concat {variant g95 description {build with g95}} $g95_conflicts {{}}]
    56 
    57 if {[variant_isset g95]} {
    58     if {${default_fortran_variant} != "+g95"} {
    59         set default_fortran_variant ""
    60     }
     33# choose one of the following for serial linear algebra
     34variant accelerate conflicts atlas openblas description {Build with linear algebra from built-in Accelerate framework} {
     35    depends_lib-append      port:veclibfort
     36    configure.args-append   --with-blas=-lveclibfort
    6137}
    6238
    63 if {${default_fortran_variant} != ""} {
    64     default_variants-append "${default_fortran_variant}"
     39variant atlas conflicts accelerate openblas description {Build with linear algebra from ATLAS} {
     40    depends_lib-append      port:atlas
     41    configure.args-append   --with-blas=-lsatlas
    6542}
    6643
    67 foreach ver ${gcc_versions} {
    68     set ver_no_dot [join [split ${ver} "."] ""]
    69 
    70     if {[variant_isset gcc${ver_no_dot}]} {
    71         depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
    72         depends_build-append port:gcc${ver_no_dot}
    73 
    74         configure.fc  ${prefix}/bin/gfortran-mp-${ver}
    75         configure.f77 ${prefix}/bin/gfortran-mp-${ver}
    76         configure.f90 ${prefix}/bin/gfortran-mp-${ver}
    77     }
     44variant openblas conflicts accelerate atlas description {Build with linear algebra from OpenBLAS} {
     45    # allow OpenBLAS-devel too
     46    depends_lib-append      path:lib/libopenblas.dylib:OpenBLAS
     47    require_active_variants path:lib/libopenblas.dylib:OpenBLAS lapack
     48    configure.args-append   --with-blas=-lopenblas
    7849}
    7950
    80 if {[variant_isset g95]} {
    81     depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
    82     depends_build-append port:g95
     51test.run            yes
     52test.target         check
    8353
    84     configure.fc ${prefix}/bin/g95
    85     configure.f77 ${prefix}/bin/g95
    86     configure.f90 ${prefix}/bin/g95
    87 }
     54livecheck.type      regex
     55livecheck.url       ${homepage}
     56livecheck.regex     The latest version is Harminv (\[0-9.\]+)