source: trunk/dports/math/qrupdate/Portfile @ 144149

Last change on this file since 144149 was 144149, checked in by mcalhoun@…, 4 years ago

arpack, qrupdate, SuiteSparse: use vecLibFort instead of Accelerate Framework

  • Octave can crash unless it uses vecLibFort and its dependents do not use Accelerate Framework (run test suite to confirm)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.2 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 144149 2016-01-03 07:17:55Z mcalhoun@macports.org $
3
4PortSystem          1.0
5PortGroup           muniversal 1.0
6PortGroup           compilers 1.0
7
8compilers.choose    fc
9compilers.setup     require_fortran -dragonegg
10
11name                qrupdate
12version             1.1.2
13revision            4
14# upstream follows a weird folder naming policy, we need last two digits of version separated by a dot
15set branch          [join [lrange [split ${version} .] 1 2] .]
16categories          math
17license             GPL-3+
18maintainers         nomaintainer
19description         library for fast updates of QR and Cholesky decompositions
20long_description    a Fortran library for fast updates of QR and Cholesky decompositions
21homepage            http://sourceforge.net/projects/${name}/
22platforms           darwin
23master_sites        sourceforge:project/qrupdate/qrupdate/${branch}
24
25checksums           rmd160  9d23b2d13278c335f6208ebb6775df4b4049785c \
26                    sha256  e2a1c711dc8ebc418e21195833814cb2f84b878b90a2774365f0166402308e08
27
28use_configure       no
29build.target        lib solib
30
31build.args          PREFIX=${prefix}
32destroot.args       PREFIX=${prefix}
33test.args           PREFIX=${prefix}
34
35patchfiles          patch-Makefile.diff
36
37post-patch {
38    # Mac install program does not support -D flag.
39    reinplace "s|install -D|install|"  ${worksrcpath}/src/Makefile
40
41    # Running ranlib on static libraries make universal builds a little more complicated.
42    reinplace "s|ar -cr |libtool -o |"  ${worksrcpath}/src/Makefile
43}
44
45# Fortran compilers can not cross-compile
46if {${os.arch} eq "i386"} {
47    set universal_archs_supported "i386 x86_64"
48} else {
49    set universal_archs_supported "ppc ppc64"
50}
51
52post-configure {
53    if { ! [variant_isset universal] } {
54        if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} {
55            reinplace "s|^FFLAGS=|FFLAGS=-m64 |"  ${worksrcpath}/Makeconf
56        } else {
57            reinplace "s|^FFLAGS=|FFLAGS=-m32 |"  ${worksrcpath}/Makeconf
58        }
59    } else {
60        foreach arch ${universal_archs_to_use} {
61            if {${arch} eq "x86_64" || ${arch} eq "ppc64"} {
62                reinplace "s|^FFLAGS=|FFLAGS=-m64 |"  ${worksrcpath}-${arch}/Makeconf
63            } else {
64                reinplace "s|^FFLAGS=|FFLAGS=-m32 |"  ${worksrcpath}-${arch}/Makeconf
65            }
66        }
67    }
68}
69
70variant atlas conflicts accelerate openblas description {build with atlas instead of Accelerate framework} {
71    depends_lib-append      port:atlas
72    build.args-append       BLAS=-ltatlas LAPACK=-llapack
73    destroot.args-append    BLAS=-ltatlas LAPACK=-llapack
74    test.args-append        BLAS=-ltatlas LAPACK=-llapack
75}
76
77variant accelerate conflicts atlas openblas description {build with Accelerate framework} {
78    depends_lib-append      port:vecLibFort
79    build.args-append       BLAS=-lvecLibFort LAPACK=-lvecLibFort
80    destroot.args-append    BLAS=-lvecLibFort LAPACK=-lvecLibFort
81    test.args-append        BLAS=-lvecLibFort LAPACK=-lvecLibFort
82}
83
84variant openblas conflicts accelerate atlas description {build with Accelerate framework} {
85    PortGroup               active_variants 1.1
86
87    depends_lib-append      path:lib/libopenblas.dylib:OpenBLAS
88    # LAPACK required
89    require_active_variants path:lib/libopenblas.dylib:OpenBLAS lapack
90
91    build.args-append       BLAS=-lopenblas   LAPACK=-lopenblas
92    destroot.args-append    BLAS=-lopenblas   LAPACK=-lopenblas
93    test.args-append        BLAS=-lopenblas   LAPACK=-lopenblas
94}
95
96if {![variant_isset accelerate] && ![variant_isset openblas] && ![variant_isset atlas] } {
97    default_variants-append +accelerate
98}
99
100if {![variant_isset accelerate] && ![variant_isset openblas] && ![variant_isset atlas] } {
101    ui_error "\n\nYou must select either the +accelerate, +atlas, or +openblas variant.\n"
102    return -code error "Invalid variant selection"
103}
104
105if {[variant_isset g95]} {
106    post-patch {
107        reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/Makefile
108        reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/src/Makefile
109    }
110} else {
111    post-patch {
112        reinplace "s|gfortran|${configure.fc}|" ${worksrcpath}/Makeconf
113    }
114}
115
116test.run    yes
Note: See TracBrowser for help on using the repository browser.