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

Last change on this file since 71118 was 71118, checked in by michaelld@…, 10 years ago

Added variant 'gcc45'.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.9 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 71118 2010-09-01 19:41:14Z michaelld@macports.org $
3
4PortSystem                      1.0
5PortGroup           muniversal 1.0
6
7name                qrupdate
8version             1.1.1
9revision            3
10categories          math
11maintainers         nomaintainer
12description         library for fast updates of QR and Cholesky decompositions
13long_description \
14    a Fortran library for fast updates of QR and Cholesky decompositions
15homepage            http://sourceforge.net/projects/${name}/
16platforms           darwin
17master_sites        sourceforge
18
19checksums           md5     7782c7ee6c234e56a72d6b86c1856fa0 \
20                    sha1    8fbaba202b0d4bf80852b2dc6c8d1d4b90b816d4 \
21                    rmd160  fd63306abe91adcd5d47e408d9cd4af3e1b32b0c
22
23depends_lib         port:atlas
24
25use_configure       no
26build.target        lib solib
27
28build.args          PREFIX=${prefix} BLAS="-L${prefix}/lib" LAPACK="-L${prefix}/lib -llapack"
29destroot.args       PREFIX=${prefix} BLAS="-L${prefix}/lib" LAPACK="-L${prefix}/lib -llapack"
30test.args           PREFIX=${prefix} BLAS="-L${prefix}/lib" LAPACK="-L${prefix}/lib -llapack"
31
32patchfiles          patch-Makefile.diff
33
34post-patch {
35    # Mac install program does not support -D flag.
36    reinplace "s|install -D|install|"  ${worksrcpath}/src/Makefile
37
38    # Running ranlib on static libraries make universal builds a little more complicated.
39    reinplace "s|ar -cr |libtool -o |"  ${worksrcpath}/src/Makefile
40}
41
42# Fortran compilers can not cross-compile
43if { ${os.arch}=="i386" } {
44    set universal_archs_supported "i386 x86_64"
45} else {
46    set universal_archs_supported "ppc ppc64"
47}
48
49post-configure {
50    if { ! [variant_isset universal] } {
51        if { ${build_arch} == "x86_64" || ${build_arch} == "ppc64" } {
52            reinplace "s|^FFLAGS=|FFLAGS=-m64 |"  ${worksrcpath}/Makeconf
53        } else {
54            reinplace "s|^FFLAGS=|FFLAGS=-m32 |"  ${worksrcpath}/Makeconf
55        }
56    } else {
57        foreach arch ${universal_archs_to_use} {
58            if { ${arch}=="x86_64" || ${arch}=="ppc64" } {
59                reinplace "s|^FFLAGS=|FFLAGS=-m64 |"  ${worksrcpath}-${arch}/Makeconf
60            } else {
61                reinplace "s|^FFLAGS=|FFLAGS=-m32 |"  ${worksrcpath}-${arch}/Makeconf
62            }
63        }
64    }
65}
66
67variant no_atlas description {build with Accelerate framework instead of atlas} {
68    depends_lib-delete      port:atlas
69    build.args          PREFIX=${prefix} BLAS="-framework Accelerate" LAPACK="-framework Accelerate"
70    destroot.args       PREFIX=${prefix} BLAS="-framework Accelerate" LAPACK="-framework Accelerate"
71    test.args           PREFIX=${prefix} BLAS="-framework Accelerate" LAPACK="-framework Accelerate"
72}
73
74variant accelerate requires no_atlas description {compatibility variant} {}
75
76variant g95 conflicts gcc43 gcc44 gcc45 universal description {build with g95} {
77    depends_build-append    port:g95
78    post-patch {
79        reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/Makefile
80        reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/src/Makefile
81    }
82}
83
84variant gcc43 conflicts g95 gcc44 gcc45 universal description {build with gcc43 fortran} {
85    depends_lib-append    port:gcc43
86    post-patch {
87        reinplace "s|gfortran|gfortran-mp-4.3|" ${worksrcpath}/Makeconf
88    }
89}
90
91variant gcc44 conflicts g95 gcc43 gcc45 description {build with gcc44 fortran} {
92    depends_lib-append    port:gcc44
93    post-patch {
94        reinplace "s|gfortran|gfortran-mp-4.4|" ${worksrcpath}/Makeconf
95    }
96}
97
98variant gcc45 conflicts g95 gcc43 gcc44 description {build with gcc45 fortran} {
99    depends_lib-append    port:gcc45
100    post-patch {
101        reinplace "s|gfortran|gfortran-mp-4.5|" ${worksrcpath}/Makeconf
102    }
103}
104
105if {![variant_isset gcc43] && ![variant_isset gcc44] && \
106        ![variant_isset gcc45] && ![variant_isset g95]} {
107    default_variants +gcc44
108}
109
110if {[variant_isset g95]} {
111    default_variants +accelerate
112}
113
114test.run yes
Note: See TracBrowser for help on using the repository browser.