New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 82161


Ignore:
Timestamp:
08/08/11 23:58:23 (4 years ago)
Author:
vince@…
Message:

Update to version 3.9.46

Location:
trunk/dports/math/atlas
Files:
15 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/math/atlas/Portfile

    r80831 r82161  
    11# $Id$ 
    22 
    3 PortSystem          1.0 
    4 PortGroup           muniversal 1.0 
    5  
    6 categories          math 
    7 license             BSD 
    8 name                atlas 
    9 version             3.9.37 
    10 #revision            4 
     3PortSystem                      1.0 
     4PortGroup                       muniversal 1.0 
     5 
     6categories                      math 
     7license                         BSD 
     8name                            atlas 
     9version                         3.9.46 
    1110 
    1211# additional versions 
    13 set lapackversion   3.3.0 
    14 set lapackname      lapack 
    15 set atlasdist       ${name}${version}.tar.bz2 
    16 set lapackdist      ${lapackname}-${lapackversion}.tgz 
    17  
    18 maintainers         jameskyle 
    19 platforms           darwin 
    20  
    21 description         Portable optimal linear algebra software 
    22 long_description    The current version provides a complete BLAS and LAPACK API.\ 
    23                     For many operations, ATLAS achieves performance on par with\ 
    24                     machine-specific tuned libraries. 
    25  
    26 homepage            http://math-atlas.sourceforge.net/ 
    27  
    28 master_sites        sourceforge:math-atlas:atlas \ 
    29                     http://www.netlib.org/lapack:lapack 
    30  
    31 distfiles           ${atlasdist}:atlas \ 
    32                     ${lapackdist}:lapack 
    33  
    34 patchfiles          patch-SpewMakeInc.c.diff \ 
    35                                         patch-emit_mm_c.diff \ 
    36                                         patch-archinfo_freebsd_c.diff 
    37  
    38 checksums           atlas${version}.tar.bz2 \ 
    39                     sha1    71dd254dad1fc9ad3dec123a561706c9a1a5d7d1 \ 
    40                     rmd160  87bb689e7a956df74ea4091552ac3cfd30430093 \ 
    41                         lapack-${lapackversion}.tgz \ 
    42                     md5     84213fca70936cc5f1b59a7b1bf71697 \ 
    43                     sha1    4f0b103da52110e7f60d1d7676727103aca9785e \ 
    44                         rmd160  cc72e7c93ab13464fd892d684b00b910cbbd3b3e 
    45  
    46  
    47 use_parallel_build  no 
    48 build.target        build 
    49 build.dir           ${workpath}/${name}-${version}/build 
    50  
    51 variant gcc45 conflicts gcc42 gcc43 gcc44 description {build using macports-gcc-4.5} {} 
    52 variant gcc44 conflicts gcc42 gcc43 description {build using macports-gcc-4.4} {} 
    53 variant gcc43 conflicts gcc42 gcc44 conflicts universal description {build using macports-gcc-4.3} {} 
    54 variant gcc42 conflicts gcc43 gcc44 conflicts universal description {build using macports-gcc-4.2} {} 
    55  
    56 if { [variant_isset gcc42] } { 
    57   set gccversion    4.2 
    58 } elseif { [variant_isset gcc43] } { 
    59   set gccversion    4.3 
    60 } elseif { [variant_isset gcc45 ] } { 
    61   set gccversion    4.5 
     12set lapackversion       3.3.1 
     13set lapackname          lapack 
     14set atlasdist           ${name}${version}.tar.bz2 
     15set lapackdist          ${lapackname}-${lapackversion}.tgz 
     16 
     17maintainers                     jameskyle 
     18platforms                       darwin 
     19 
     20description                     Portable optimal linear algebra software 
     21long_description        The current version provides a complete BLAS and LAPACK API.\ 
     22                                        For many operations, ATLAS achieves performance on par with\ 
     23                                        machine-specific tuned libraries. 
     24 
     25homepage                        http://math-atlas.sourceforge.net/ 
     26 
     27master_sites            sourceforge:math-atlas:atlas \ 
     28                                        http://www.netlib.org/lapack:lapack 
     29 
     30distfiles                       ${atlasdist}:atlas \ 
     31                                        ${lapackdist}:lapack 
     32 
     33patchfiles                      patch-SpewMakeInc_c.diff \ 
     34                                        patch-archinfo_freebsd_c.diff \ 
     35                                        patch-ATL_goparallel_prank_c.diff \ 
     36                                        patch-ATL_go_parallel_c.diff \ 
     37                                        patch-atlcomp_txt.diff \ 
     38                                        patch-atlas_l2g_base.diff 
     39 
     40 
     41checksums                       atlas${version}.tar.bz2 \ 
     42                                        sha1    aef8b696bc1bc50b304db953e2f20a653b783317 \ 
     43                                        rmd160  1fbe0f403fc8a35b2b355edabc756c65c19befa2 \ 
     44                                        lapack-${lapackversion}.tgz \ 
     45                                        md5             d0d533ec9a5b74933c2a1e84eedc58b4 \ 
     46                                        sha1    3ce437e05f0e9a3c8148ec41922f6efeef0ebdac \ 
     47                                        rmd160  5e9d90122110045e07351f3ab30dc4e2b43d52db 
     48 
     49 
     50use_parallel_build      no 
     51build.target            build 
     52build.dir                       ${workpath}/${name}-${version}/build 
     53 
     54variant gcc46 conflicts gcc42 gcc43 gcc44 gcc45 description {build using macports-gcc-4.6} {} 
     55variant gcc45 conflicts gcc42 gcc43 gcc44 gcc46 description {build using macports-gcc-4.5} {} 
     56variant gcc44 conflicts gcc42 gcc43 gcc45 gcc46 description {build using macports-gcc-4.4} {} 
     57variant gcc43 conflicts gcc42 gcc44 gcc45 gcc46 conflicts universal description {build using macports-gcc-4.3} {} 
     58variant gcc42 conflicts gcc43 gcc44 gcc45 gcc46 conflicts universal description {build using macports-gcc-4.2} { 
     59        ui_warn 'Use of gcc42 is deprecated. Please upgrade if possible'} 
     60 
     61if { ${os.major} < 11 || ![variant_isset dragonegg45] } { 
     62        if { [variant_isset gcc42] } { 
     63                set gccversion  4.2 
     64        } elseif { [variant_isset gcc43] } { 
     65                set gccversion  4.3 
     66        } elseif { [variant_isset gcc44] } { 
     67                set gccversion  4.4 
     68        } elseif { [variant_isset gcc45 ] } { 
     69                set gccversion  4.5 
     70        } elseif { [variant_isset gcc46] } { 
     71                set gccversion  4.6 
     72        } else { 
     73        default_variants        +gcc44 
     74        set gccversion          4.4 
     75        } 
    6276} else { 
    63   default_variants +gcc44 
    64   set gccversion    4.4 
    65 } 
    66  
    67 set gccnumber       [join [split ${gccversion} .] ""] 
    68  
    69 destroot.dir        ${build.dir} 
    70 destroot.destdir    DESTDIR=${destroot}${prefix} 
    71 depends_lib         port:gcc${gccnumber} \ 
    72                     port:bzip2 \ 
    73                     port:gzip 
    74  
    75 if {[info exists depends_skip_archcheck]} { 
    76     depends_skip_archcheck gcc${gccnumber} 
    77 } 
    78  
    79 configure.compiler  macports-gcc-${gccversion} 
    80  
    81 if { ${os.arch}=="i386" } { 
    82     set universal_archs_supported { i386 x86_64 } 
     77        # On Lion, we can also select clang and llvm-gcc42 since these compilers 
     78        # give performance at least as good as gcc. 
     79        # Fortran compiler remains gcc (dragonegg to come?) 
     80        if { [variant_isset gcc42] } { 
     81                set gccversion  4.2 
     82        } elseif { [variant_isset gcc43] } { 
     83                set gccversion  4.3 
     84        } elseif { [variant_isset gcc44] } { 
     85                set gccversion  4.4 
     86        } elseif { [variant_isset gcc45 ] } { 
     87                set gccversion  4.5 
     88        } elseif { [variant_isset gcc46] } { 
     89                return -code error "GCC/GFortran 4.6 is not yet available" 
     90        } elseif { [variant_isset dragonegg45] } { 
     91                configure.compiler      clang 
     92                configure.f77           ${prefix}/bin/gfortran-mp-4.5 
     93        } else { 
     94                return -code error "GCC/GFortran 4.6 is not yet available" 
     95        } 
     96} 
     97 
     98destroot.dir                    ${build.dir} 
     99destroot.destdir                DESTDIR=${destroot}${prefix} 
     100depends_lib                             port:bzip2 \ 
     101                                                port:gzip 
     102 
     103if { [info exists gccversion] } { 
     104        set gccnumber           [join [split ${gccversion} .] ""] 
     105        configure.compiler      macports-gcc-${gccversion} 
     106        depends_lib-append      port:gcc${gccnumber} 
     107} 
     108 
     109if {[info exists depends_skip_archcheck] && [info exists gccversion]} { 
     110        depends_skip_archcheck gcc${gccnumber} 
     111} 
     112 
     113# No cross-compilation possible 
     114if { ${os.arch} == "i386" } { 
     115        set universal_archs_supported { i386 x86_64 } 
    83116} else { 
    84     set universal_archs_supported { ppc  ppc64 } 
     117        set universal_archs_supported { ppc  ppc64 } 
    85118} 
    86119 
    87120if {${build_arch} == "x86_64" || ${build_arch} == "ppc64" } { 
    88   set my_arch 64 
     121        set my_arch 64 
    89122} else { 
    90   set my_arch 32 
    91 } 
    92  
    93 configure.args      -C xc ${configure.cc} \ 
    94                     -C gc ${configure.cc} \ 
    95                     -C if ${configure.f77} \ 
    96                     -C ic ${configure.cc} \ 
    97                     -C dm ${configure.cc} \ 
    98                     -C sm ${configure.cc} \ 
    99                     -C dk ${configure.cc} \ 
    100                     -C sk ${configure.cc} \ 
    101                     --cc=${configure.cc} \ 
    102                     --with-netlib-lapack-tarfile=${distpath}/${lapackdist} \ 
    103                     -O 12 \ 
    104                     -b ${my_arch} \ 
    105                     -Fa alg -fPIC 
    106                      
     123        set my_arch 32 
     124} 
     125 
     126configure.args          -C xc ${configure.cc} \ 
     127                                        -C gc ${configure.cc} \ 
     128                                        -C if ${configure.f77} \ 
     129                                        -C ic ${configure.cc} \ 
     130                                        -C dm ${configure.cc} \ 
     131                                        -C sm ${configure.cc} \ 
     132                                        -C dk ${configure.cc} \ 
     133                                        -C sk ${configure.cc} \ 
     134                                        --cc=${configure.cc} \ 
     135                                        --with-netlib-lapack-tarfile=${distpath}/${lapackdist} \ 
     136                                        -O 12 \ 
     137                                        -b ${my_arch} \ 
     138                                        -Fa alg -fPIC 
     139 
     140# Dragonegg 
     141if { [variant_isset dragonegg45] } { 
     142        configure.args-append -Fa if -fplugin=${prefix}/lib/dragonegg.so 
     143} 
     144 
    107145# At this point, no threading for ppc/ppc64 
    108146 
     
    115153 
    116154if {${build_arch} == "ppc" && ! [variant_isset universal]} { 
    117     configure.args-delete       --cc=${configure.cc} \ 
    118                                                 -Fa alg -fPIC 
     155        configure.args-delete   --cc=${configure.cc} \ 
     156                                                        -Fa alg -fPIC 
    119157 
    120158        configure.args-append   --cc='${configure.cc} -m32' \ 
    121159                                                        -A 4 \ 
    122                                                 -Fa alg '-fPIC -m32' 
    123      
    124     # On Leopard, we may warn the user that ppc is not as efficient as ppc64 
    125     if {${os.major} == 9} { 
    126         if {[exec sysctl -n hw.cpu64bit_capable] == 1} { 
    127                 ui_msg  "--- Compiling for G4 arch (ppc) on a G5 (ppc64) machine." 
    128                 ui_msg  "--- This will lead to inferior performance." 
    129         } 
    130     } 
     160                                                        -Fa alg '-fPIC -m32' 
     161         
     162        # On Leopard, we may warn the user that ppc is not as efficient as ppc64 
     163        if {${os.major} == 9} { 
     164                if {[exec sysctl -n hw.cpu64bit_capable] == 1} { 
     165                        ui_msg "--- Compiling for G4 arch (ppc) on a G5 (ppc64) machine." 
     166                        ui_msg "--- This will lead to inferior performance." 
     167                } 
     168        } 
     169                 
     170} 
     171 
     172if { ${os.major} == 11 && \ 
     173        [exec sysctl -n hw.optional.avx1_0] == 1 } { 
     174        # Corei2 is not supported yet because gcc4.5 does not 
     175        # support AVX instructions and gcc4.6 does not compile yet. 
     176        # Set CPU to Corei1 instead 
     177        configure.args-append -A 18 
    131178} 
    132179 
    133180if { [variant_isset universal] } { 
    134     configure.universal_args-delete --disable-dependency-tracking 
    135     configure.args-delete       --cc=${configure.cc} \ 
    136                                                 -b ${my_arch} \ 
    137                                                 -Fa alg -fPIC 
    138                      
    139     lappend merger_configure_args(ppc)          --cc='${configure.cc} -m32' \ 
    140                                                                                 -b 32 \ 
    141                                                                                 -A 4 \ 
     181        configure.universal_args-delete                 --disable-dependency-tracking 
     182        configure.args-delete                                   --cc=${configure.cc} \ 
     183                                                                                        -b ${my_arch} \ 
     184                                                                                        -Fa alg -fPIC 
     185                                         
     186        lappend merger_configure_args(ppc)              --cc='${configure.cc} -m32' \ 
     187                                                                                        -b 32 \ 
     188                                                                                        -A 4 \ 
    142189                                                                                        -t 0 \ 
    143                                                                                 -s gas_ppc \ 
    144                                                                                 -Fa alg '-fPIC -m32' 
    145     lappend merger_configure_args(ppc64)        --cc='${configure.cc} -m64' \ 
    146                                                                                 -b 64 \ 
    147                                                                                 -A 5 \ 
     190                                                                                        -s gas_ppc \ 
     191                                                                                        -Fa alg '-fPIC -m32' 
     192        lappend merger_configure_args(ppc64)    --cc='${configure.cc} -m64' \ 
     193                                                                                        -b 64 \ 
     194                                                                                        -A 5 \ 
    148195                                                                                        -t 0 \ 
    149                                                                                 -s gas_ppc \ 
    150                                                                                 -Fa alg '-fPIC -m64' 
    151     lappend merger_configure_args(i386)         --cc='${configure.cc} -m32' \ 
    152                                                                                 -b 32 \ 
    153                                                                                 -s gas_x86_32 \ 
    154                                                                                 -Fa alg '-fPIC -m32' 
    155     lappend merger_configure_args(x86_64)       --cc='${configure.cc} -m64' \ 
    156                                                                                 -b 64 \ 
    157                                                                                 -s gas_x86_64 \ 
    158                                                                                 -Fa alg '-fPIC -m64' 
     196                                                                                        -s gas_ppc \ 
     197                                                                                        -Fa alg '-fPIC -m64' 
     198        lappend merger_configure_args(i386)     --cc='${configure.cc} -m32' \ 
     199                                                                                        -b 32 \ 
     200                                                                                        -s gas_x86_32 \ 
     201                                                                                        -Fa alg '-fPIC -m32' 
     202        lappend merger_configure_args(x86_64)   --cc='${configure.cc} -m64' \ 
     203                                                                                        -b 64 \ 
     204                                                                                        -s gas_x86_64 \ 
     205                                                                                        -Fa alg '-fPIC -m64' 
    159206} else { 
    160     lappend merger_configure_args(ppc) 
    161     lappend merger_configure_args(ppc64) 
    162     lappend merger_configure_args(i386) 
    163     lappend merger_configure_args(x86_64) 
    164 } 
    165  
    166 build.env-append    "CC=${configure.cc} CXX=${configure.cxx}" 
     207        lappend merger_configure_args(ppc) 
     208        lappend merger_configure_args(ppc64) 
     209        lappend merger_configure_args(i386) 
     210        lappend merger_configure_args(x86_64) 
     211} 
     212 
     213build.env-append        "CC=${configure.cc} CXX=${configure.cxx}" 
    167214 
    168215# we are configuring from the build directory 
    169 configure.dir       ${workpath}/${name}-${version}/build 
    170 configure.cmd       ../configure 
     216configure.dir                   ${workpath}/${name}-${version}/build 
     217configure.cmd                   ../configure 
    171218 
    172219 
    173220# change the default compilers to those of gcc and make into shared library 
    174221extract { 
    175     # extract atlas and move to a consistent working directory name 
    176     system "cd ${workpath} && bunzip2 -dc ${distpath}/${atlasdist} | \ 
    177         gnutar --no-same-owner -xf -" 
    178     system "mv ${workpath}/ATLAS ${workpath}/${name}-${version}" 
     222        # extract atlas and move to a consistent working directory name 
     223        system  "cd ${workpath} && bunzip2 -dc ${distpath}/${atlasdist} | \ 
     224                        gnutar --no-same-owner -xf -" 
     225        system  "mv ${workpath}/ATLAS ${workpath}/${name}-${version}" 
    179226} 
    180227 
    181228post-patch { 
    182         reinplace "s|__MACPORTS_GCC__|${configure.cc}|g" \ 
    183                 ${workpath}/${name}-${version}/CONFIG/src/SpewMakeInc.c 
    184 } 
    185  
    186 # Bug in 3.9.37 
    187 proc bug3_9_37 {arch path} { 
    188     switch ${arch} { 
    189          
    190         x86_64 { 
    191                 reinplace -E \ 
    192                         "s|ATL_thread_exit.o ATL_thread_join.o|\ 
    193                         ATL_thread_exit.o ATL_thread_join.o\ 
    194                         ATL_DecAtomicCount_amd64.o|" ${path} 
    195         } 
    196                  
    197         i386 { 
    198                 reinplace -E \ 
    199                         "s|ATL_thread_exit.o ATL_thread_join.o|\ 
    200                                 ATL_thread_exit.o ATL_thread_join.o\ 
    201                                 ATL_DecAtomicCount_ia32.o|" ${path} 
    202         } 
    203  
    204         ppc64 { 
    205                 reinplace -E \ 
    206                         "s|ATL_thread_exit.o ATL_thread_join.o|\ 
    207                         ATL_thread_exit.o ATL_thread_join.o\ 
    208                         ATL_DecAtomicCount_ppc.o|" ${path} 
    209         } 
    210  
    211         ppc { 
    212                 reinplace -E \ 
    213                         "s|ATL_thread_exit.o ATL_thread_join.o|\ 
    214                         ATL_thread_exit.o ATL_thread_join.o\ 
    215                         ATL_DecAtomicCount_ppc.o|" ${path} 
    216         } 
    217         } 
     229        reinplace       "s|__MACPORTS_GCC__|${configure.cc}|g" \ 
     230                                 ${workpath}/${name}-${version}/CONFIG/src/SpewMakeInc.c 
     231         
     232        # ar -r / ranlib / libtool seems to be buggy, so we have to supply a 
     233        # workaround to link properly. 
     234        reinplace       "s|XXXXX|${filespath}/ar2|" \ 
     235                                ${workpath}/${name}-${version}/CONFIG/src/SpewMakeInc.c 
    218236} 
    219237 
    220238pre-configure { 
    221     if { [variant_isset universal] } { 
    222         foreach arch ${universal_archs_to_use} { 
    223             copy ${workpath}/${name}-${version} ${workpath}/${name}-${version}-${arch} 
    224         } 
    225     } 
    226  
    227     reinplace "s|cc=gcc|cc=${configure.cc}|g" ${worksrcpath}/configure 
    228     reinplace "s|-no-cpp-precomp||g" ${workpath}/${name}-${version}/CONFIG/src/atlcomp.txt 
    229  
    230     # Get some system specific variables for maximum optimization 
    231     set cpufreq [expr {[exec sysctl -n hw.cpufrequency]/1000000}] 
    232     ui_debug "Setting CPU Frequency for: ${cpufreq}" 
    233  
    234     if {[string equal "${os.arch}" "powerpc"]} { 
    235       configure.args-append -D c -DWALL 
    236     } else { 
    237       configure.args-append -D c -DPentiumCPS=${cpufreq} 
    238     } 
    239  
    240     if { [variant_isset universal] } { 
    241         set archs ${universal_archs_to_use} 
    242     } else { 
    243         set archs ${build_arch} 
    244     } 
    245  
    246     foreach arch ${archs} { 
    247  
    248         if { ! [variant_isset universal] } { 
    249         set atlas_path  ${workpath}/${name}-${version} 
    250         } else { 
    251         set atlas_path ${workpath}/${name}-${version}-${arch} 
    252         } 
    253          
    254         file mkdir ${atlas_path}/build 
    255          
    256         # Correct a bug in 3.9.37 
    257         set mkt ${atlas_path}/makes/Make.thr 
    258         bug3_9_37 ${arch} ${mkt} 
     239 
     240        # i386 builds must be patch otherwise threading does not work. 
     241        if { [variant_isset universal] } { 
     242                foreach arch ${universal_archs_to_use} { 
     243                        copy ${workpath}/${name}-${version} \ 
     244                         ${workpath}/${name}-${version}-${arch} 
     245                        if { ${arch} == "i386" } { 
     246                                ui_msg  "Patching Make.ttune for i386 universal build" 
     247                                system  "cd ${workpath}/${name}-${version}-i386/makes && \ 
     248                                                 patch < ${filespath}/patch-Make_ttune-i386.diff" 
     249                        } 
     250                } 
     251        } 
     252         
     253        if { ${build_arch} == "i386" && ! [variant_isset universal] } { 
     254                ui_msg  "Patching Make.ttune for i386 build" 
     255                system  "cd ${workpath}/${name}-${version}/makes && \ 
     256                                 patch < ${filespath}/patch-Make_ttune-i386.diff" 
     257        } 
     258 
     259        reinplace       "s|cc=gcc|cc=${configure.cc}|g" ${worksrcpath}/configure 
     260        reinplace       "s|-no-cpp-precomp||g" \ 
     261                                 ${workpath}/${name}-${version}/CONFIG/src/atlcomp.txt 
     262 
     263        # Get some system specific variables for maximum optimization 
     264        set                     cpufreq [expr {[exec sysctl -n hw.cpufrequency]/1000000}] 
     265        ui_debug        "Setting CPU Frequency for: ${cpufreq}" 
     266 
     267        if { ${os.arch} == "powerpc" } { 
     268                configure.args-append   -D c -DWALL 
     269        } else { 
     270                configure.args-append   -D c -DPentiumCPS=${cpufreq} 
     271        } 
     272 
     273        if { [variant_isset universal] } { 
     274                set     archs ${universal_archs_to_use} 
     275        } else { 
     276                set     archs ${build_arch} 
     277        } 
     278 
     279        foreach arch ${archs} { 
     280                if { ! [variant_isset universal] } { 
     281                        set     atlas_path ${workpath}/${name}-${version} 
     282                } else { 
     283                        set     atlas_path ${workpath}/${name}-${version}-${arch} 
     284                } 
     285 
     286                file mkdir ${atlas_path}/build 
    259287        } 
    260288} 
    261289 
    262290post-configure { 
    263     if { [variant_isset universal] } { 
    264         set archs ${universal_archs_to_use} 
    265     } else { 
    266         set archs ${build_arch} 
    267     } 
    268  
    269     foreach arch ${archs} { 
    270         if { ! [variant_isset universal] } { 
    271             set atlas_path  ${workpath}/${name}-${version} 
    272         } else { 
    273             set atlas_path ${workpath}/${name}-${version}-${arch} 
    274         } 
    275  
    276     # recursively remove directories 
    277     ui_debug "reinplace for make to recursively remove directories on clean" 
    278     reinplace "s|rm -f|rm -rf|g" ${atlas_path}/build/Makefile 
    279     } 
     291        if { [variant_isset universal] } { 
     292                set     archs ${universal_archs_to_use} 
     293        } else { 
     294                set     archs ${build_arch} 
     295        } 
     296 
     297        foreach arch ${archs} { 
     298                if { ! [variant_isset universal] } { 
     299                        set     atlas_path ${workpath}/${name}-${version} 
     300                } else { 
     301                        set     atlas_path ${workpath}/${name}-${version}-${arch} 
     302                } 
     303 
     304                # recursively remove directories 
     305                ui_debug        "patch to recursively remove directories on clean" 
     306                reinplace       "s|rm -f|rm -rf|g" ${atlas_path}/build/Makefile 
     307 
     308                #Second patch for i386 
     309                if { ${arch} == "i386" } { 
     310                        system  "cd ${atlas_path}/build/src/threads && \ 
     311                                         patch < ${filespath}/patch-threads-i386.diff" 
     312                        system  "cd ${atlas_path}/build/src/pthreads/misc && \ 
     313                                         patch < ${filespath}/patch-Makefile_pthreads_misc.diff" 
     314                } 
     315        } 
    280316} 
    281317 
    282318proc make_dylib { lib lib_dir arch libs } { 
    283     global destroot prefix gccnumber 
    284     system "cd ${lib_dir} && \ 
    285             ( test ! -e ${lib}.a || \ 
    286               /usr/bin/ld -arch ${arch} -dynamic -dylib -single_module -dead_strip \ 
    287               -x -all_load -L. -L${prefix}/lib/gcc${gccnumber}/${arch} \ -L${prefix}/lib/gcc${gccnumber} -ldylib1.o \ 
    288               -dylib_install_name ${prefix}/lib/${lib}.dylib \ 
    289               ${lib}.a -o ${lib}.dylib ${libs} )" 
     319        global destroot prefix gccnumber 
     320        system "cd ${lib_dir} && \ 
     321                        ( test ! -e ${lib}.a || \ 
     322                          /usr/bin/ld -arch ${arch} -dynamic -dylib -single_module -dead_strip \ 
     323                          -x -all_load -L. -L${prefix}/lib/gcc${gccnumber}/${arch} \ -L${prefix}/lib/gcc${gccnumber} -ldylib1.o \ 
     324                          -dylib_install_name ${prefix}/lib/${lib}.dylib \ 
     325                          ${lib}.a -o ${lib}.dylib ${libs} )" 
    290326} 
    291327 
     
    295331  set ncpu [exec sysctl -n hw.ncpu] 
    296332 
    297     if { [variant_isset universal] } { 
    298         set archs ${universal_archs_to_use} 
    299     } else { 
    300         set archs ${build_arch} 
    301     } 
    302  
    303     foreach arch ${archs} { 
    304         if { ! [variant_isset universal] } { 
    305             set atlas_path  ${workpath}/${name}-${version} 
    306         } else { 
    307             set atlas_path ${workpath}/${name}-${version}-${arch} 
    308         } 
    309         set lib_dir ${atlas_path}/build/lib 
    310  
    311   make_dylib libatlas ${lib_dir} ${arch} { -lSystem } 
    312  
    313   if {${ncpu} == "1" } { 
    314     # there are no threaded libraries (libpt*) on single-core machines 
    315     make_dylib libcblas   ${lib_dir} ${arch} { -latlas -lSystem } 
    316     make_dylib libf77blas ${lib_dir} ${arch} { -lgfortran -latlas -lSystem } 
    317   } else { 
    318     make_dylib libptcblas   ${lib_dir} ${arch} { -latlas -lSystem } 
    319     make_dylib libptf77blas ${lib_dir} ${arch} { -lgfortran -latlas -lSystem } 
    320   } 
    321  
    322   make_dylib liblapack ${lib_dir} ${arch} { -lf77blas -lcblas -latlas -lgfortran -lgcc_s.1 -lSystem } 
    323 } 
     333        if { [variant_isset universal] } { 
     334                set     archs ${universal_archs_to_use} 
     335        } else { 
     336                set     archs ${build_arch} 
     337        } 
     338 
     339        foreach arch ${archs} { 
     340                if { ! [variant_isset universal] } { 
     341                        set     atlas_path  ${workpath}/${name}-${version} 
     342                } else { 
     343                        set     atlas_path ${workpath}/${name}-${version}-${arch} 
     344                } 
     345 
     346                set                     lib_dir ${atlas_path}/build/lib 
     347                make_dylib      libatlas ${lib_dir} ${arch} { -lSystem } 
     348 
     349                if { ${ncpu} == "1" } { 
     350        # there are no threaded libraries (libpt*) on single-core machines 
     351                        make_dylib      libcblas   ${lib_dir} ${arch} { -latlas -lSystem } 
     352                        make_dylib      libf77blas ${lib_dir} ${arch} { -lgfortran -latlas -lSystem } 
     353                } else { 
     354                        make_dylib      libptcblas   ${lib_dir} ${arch} { -latlas -lSystem } 
     355                        make_dylib      libptf77blas ${lib_dir} ${arch} { -lgfortran -latlas -lSystem } 
     356                } 
     357 
     358                make_dylib      liblapack ${lib_dir} ${arch} { -lf77blas -lcblas -latlas -lgfortran -lgcc_s.1 -lSystem } 
     359        } 
    324360} 
    325361 
    326362pre-destroot { 
    327    if { [variant_isset universal] } { 
    328         set archs ${universal_archs_to_use} 
    329     } else { 
    330         set archs ${build_arch} 
    331     } 
    332  
    333     foreach arch ${archs} { 
    334         if { ! [variant_isset universal] } { 
    335             set atlas_path  ${workpath}/${name}-${version} 
    336             set dest_path   ${destroot}${prefix}/lib/ 
    337         } else { 
    338             set atlas_path ${workpath}/${name}-${version}-${arch} 
    339             set dest_path  ${destroot}-${arch}${prefix}/lib/ 
    340         } 
    341         set lib_dir ${atlas_path}/build/lib 
    342  
    343         file mkdir ${dest_path} 
    344         eval xinstall -m 755 [glob ${lib_dir}/*.dylib] ${dest_path} 
    345     } 
     363        if { [variant_isset universal] } { 
     364                set     archs ${universal_archs_to_use} 
     365        } else { 
     366                set     archs ${build_arch} 
     367        } 
     368 
     369        foreach arch ${archs} { 
     370                if { ! [variant_isset universal] } { 
     371                        set     atlas_path  ${workpath}/${name}-${version} 
     372                        set     dest_path   ${destroot}${prefix}/lib/ 
     373                } else { 
     374                        set     atlas_path ${workpath}/${name}-${version}-${arch} 
     375                        set     dest_path  ${destroot}-${arch}${prefix}/lib/ 
     376                } 
     377 
     378                set             lib_dir ${atlas_path}/build/lib 
     379                file    mkdir ${dest_path} 
     380                eval    xinstall -m 755 [glob ${lib_dir}/*.dylib] ${dest_path} 
     381        } 
    346382} 
    347383 
    348384post-destroot { 
    349     if { ![file exists ${destroot}${prefix}/lib/libcblas.dylib] && [file exists ${destroot}${prefix}/lib/libptcblas.dylib]} { 
    350         ln -s libptcblas.dylib ${destroot}${prefix}/lib/libcblas.dylib 
    351     } 
    352     if { ![file exists ${destroot}${prefix}/lib/libf77blas.dylib] && [file exists ${destroot}${prefix}/lib/libptf77blas.dylib]} { 
    353         ln -s libptf77blas.dylib ${destroot}${prefix}/lib/libf77blas.dylib 
    354     } 
    355 } 
    356  
    357 livecheck.name      math-atlas 
    358 livecheck.distname  Stable 
     385        if { ![file exists ${destroot}${prefix}/lib/libcblas.dylib] && [file exists ${destroot}${prefix}/lib/libptcblas.dylib]} { 
     386                ln -s libptcblas.dylib ${destroot}${prefix}/lib/libcblas.dylib 
     387        } 
     388        if { ![file exists ${destroot}${prefix}/lib/libf77blas.dylib] && [file exists ${destroot}${prefix}/lib/libptf77blas.dylib]} { 
     389                ln -s libptf77blas.dylib ${destroot}${prefix}/lib/libf77blas.dylib 
     390        } 
     391} 
     392 
     393livecheck.name          math-atlas 
     394livecheck.distname      Stable 
Note: See TracChangeset for help on using the changeset viewer.