Ticket #39365: Portfile-arpack.2.diff

File Portfile-arpack.2.diff, 9.3 KB (added by dstrubbe (David Strubbe), 11 years ago)
  • Portfile

    old new  
    55PortGroup  active_variants 1.1
    66
    77name          arpack
    8 version       3.1.2
    9 revision      1
     8version       3.1.3
    109categories    math
    1110license       BSD
    1211platforms     darwin
    1312maintainers             mmoll
    14 description             Package for solving large scale eigenvalue problems
     13description             Package for solving large-scale eigenvalue problems
    1514long_description  \
    1615    ARPACK is a collection of Fortran77 subroutines designed to solve large \
    1716    scale eigenvalue problems. Parallel ARPACK (PARPACK) is included if built with an MPI variant.
    1817homepage            http://forge.scilab.org/index.php/p/arpack-ng
    19 master_sites        ${homepage}/downloads/497
    20 distfiles           get
    21 dist_subdir         ${name}/${version}
    22 checksums           md5     7644e234f219ec1a29849b6d7811a6b1 \
    23                     sha1    f5453e2d576f131890ca023e1d853e18920f9c3c \
    24                     rmd160  2c55eca384cc0a1aebacdef527f88426932bf57b
    25 worksrcdir          ${name}-ng_${version}
     18master_sites        ${homepage}/downloads/get
     19distfiles           arpack-ng-${version}.tar.gz
     20checksums           md5     90ba42eae70b517ebdb72921cb4186df \
     21                    sha1    c1ac96663916a4e11618e9557636ba1bd1a7b556 \
     22                    rmd160  30a3b8a707417afeb3f8a794ee3aa0160fa3e745
     23worksrcdir          ${name}-ng-${version}
    2624
    2725configure.args-append home=${worksrcpath} --disable-mpi
    28 # LDFLAGS needs to be defined here to avoid it having also a "-arch" option, considered illegal by gfortran
    2926if { ${build_arch}=="x86_64" || ${build_arch}=="ppc64" } {
    30     configure.args-append FFLAGS='-O2 -m64' LDFLAGS='-L${prefix}/lib'
     27    configure.args-append FFLAGS='-O2 -m64'
    3128} else {
    32     configure.args-append FFLAGS='-O2 -m32' LDFLAGS='-L${prefix}/lib'
     29    configure.args-append FFLAGS='-O2 -m32'
    3330}
     31# LDFLAGS needs to be cleared to avoid it having a "-arch" option, considered illegal by gfortran
     32# also, if it has ${prefix}/lib it will prevent +accelerate from working if atlas is present.
     33configure.args-append LDFLAGS=''
    3434
    3535pre-fetch {
    36         if {"darwin" == ${os.platform} && ${os.major} < 9} {
    37                 ui_error "${name} ${version} requires Mac OS X 10.5 or greater"
    38                 return -code error "incompatible Mac OS X version"
    39         }
     36   if {"darwin" == ${os.platform} && ${os.major} < 9} {
     37        ui_error "${name} ${version} requires Mac OS X 10.5 or greater"
     38        return -code error "incompatible Mac OS X version"
     39   }
     40
     41   if {[variant_isset openmpi]} {
     42      if { ![active_variants openmpi gcc43] && ![active_variants openmpi gcc44] && \
     43           ![active_variants openmpi gcc45] && ![active_variants openmpi gcc46] && \
     44           ![active_variants openmpi gcc47] && ![active_variants openmpi gcc48] } {
     45        ui_error "${name} with +openmpi requires that openmpi was built with a Fortran variant (g95 won't work)"
     46        return -code error "openmpi needs Fortran variant"
     47      }
     48   }
     49
     50   if {[variant_isset mpich]} {
     51      # mpich has a path dependency on mpif77, which could be satisfied by mpich-devel instead
     52      # Fortunately, if mpif77 is present, this check is not needed.
     53      if { [_portnameactive mpich] } {
     54         if { ![active_variants mpich gcc43] && ![active_variants mpich gcc44] && \
     55           ![active_variants mpich gcc45] && ![active_variants mpich gcc46] && \
     56           ![active_variants mpich gcc47] && ![active_variants mpich gcc48] } {
     57          ui_error "${name} with +mpich requires that mpich was built with a Fortran variant"
     58          return -code error "mpich needs Fortran variant"
     59        }
     60      }
     61    }
     62
    4063}
    4164
    4265# Fortran compilers can not cross-compile
     
    4770}
    4871
    4972variant openmpi description {build PARPACK, with OpenMPI} conflicts mpich universal {
    50     depends_lib-append    port:openmpi
    51     configure.args-delete --disable-mpi
    52     configure.args-append --enable-mpi
    53     configure.env-append  MPIF77=${prefix}/bin/openmpif77
     73    depends_lib-append     port:openmpi
     74    configure.args-delete  --disable-mpi
     75    configure.args-append  --enable-mpi
     76    configure.env-append   F77=${prefix}/bin/openmpif77
    5477}
    5578
    5679variant mpich description {build PARPACK, with MPICH} conflicts openmpi {
    57     depends_lib-append    path:bin/mpif77:mpich
    58     configure.args-delete --disable-mpi
    59     configure.args-append --enable-mpi
    60     configure.env-append  MPIF77=${prefix}/bin/mpif77
     80    depends_lib-append     path:bin/mpif77:mpich
     81    # unfortunately, by default mpich builds without Fortran support, which won't work here. ticket #39428
     82    configure.args-delete  --disable-mpi
     83    configure.args-append  --enable-mpi
     84    configure.env-append   F77=${prefix}/bin/mpif77
    6185}
    6286
    63 if {![variant_isset mpich]} {
    64     default_variants +openmpi
     87if { ![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] \
     88   && ![variant_isset gcc47] && ![variant_isset mpich]} {
     89        default_variants +openmpi
    6590}
    6691
    6792
    68 variant gcc43 description {build with gfortran-mp-4.3} conflicts gcc44 gcc45 gcc46 gcc47 g95 universal {
     93variant gcc43 description {build with gfortran-mp-4.3} conflicts gcc44 gcc45 gcc46 gcc47 universal openmpi mpich {
    6994        depends_build-append    port:gcc43
    70         configure.env-append F77=${prefix}/bin/gfortran-mp-4.3
    71         if {[variant_isset mpich]}   { require_active_variants mpich   gcc43 }
    72         if {[variant_isset openmpi]} { require_active_variants openmpi gcc43 }
     95        configure.compiler      macports-gcc-4.3
    7396}
    7497
    75 variant gcc44 description {build with gfortran-mp-4.4} conflicts gcc43 gcc45 gcc46 gcc47 g95 {
     98variant gcc44 description {build with gfortran-mp-4.4} conflicts gcc43 gcc45 gcc46 gcc47 openmpi mpich {
    7699        depends_build-append    port:gcc44
    77         configure.env-append F77=${prefix}/bin/gfortran-mp-4.4
    78         if {[variant_isset mpich]}   { require_active_variants mpich   gcc44 }
    79         if {[variant_isset openmpi]} { require_active_variants openmpi gcc44 }
     100        configure.compiler      macports-gcc-4.4
    80101}
    81102
    82 variant gcc45 description {build with gfortran-mp-4.5} conflicts gcc43 gcc44 gcc46 gcc47 g95 {
     103variant gcc45 description {build with gfortran-mp-4.5} conflicts gcc43 gcc44 gcc46 gcc47 openmpi mpich {
    83104        depends_build-append    port:gcc45
    84         configure.env-append F77=${prefix}/bin/gfortran-mp-4.5
    85         if {[variant_isset mpich]}   { require_active_variants mpich   gcc45 }
    86         if {[variant_isset openmpi]} { require_active_variants openmpi gcc45 }
     105        configure.compiler      macports-gcc-4.5
    87106}
    88107
    89 variant gcc46 description {build with gfortran-mp-4.6} conflicts gcc43 gcc44 gcc45 gcc47 g95 {
     108variant gcc46 description {build with gfortran-mp-4.6} conflicts gcc43 gcc44 gcc45 gcc47 openmpi mpich {
    90109        depends_build-append    port:gcc46
    91         configure.env-append F77=${prefix}/bin/gfortran-mp-4.6
    92         if {[variant_isset mpich]}   { require_active_variants mpich   gcc46 }
    93         if {[variant_isset openmpi]} { require_active_variants openmpi gcc46 }
     110        configure.compiler      macports-gcc-4.6
    94111}
    95112
    96 variant gcc47 description {build with gfortran-mp-4.7} conflicts gcc43 gcc44 gcc45 gcc46 g95 {
     113variant gcc47 description {build with gfortran-mp-4.7} conflicts gcc43 gcc44 gcc45 gcc46 openmpi mpich {
    97114        depends_build-append    port:gcc47
    98         configure.env-append F77=${prefix}/bin/gfortran-mp-4.7
    99         if {[variant_isset mpich]}   { require_active_variants mpich   gcc47 }
    100         if {[variant_isset openmpi]} { require_active_variants openmpi gcc47 }
    101 }
    102 variant g95 description {build with g95} conflicts gcc43 gcc44 gcc45 gcc46 gcc47 universal {
    103         depends_build-append    port:g95
    104         configure.env-append F77=${prefix}/bin/g95
    105         if {[variant_isset mpich]}   { require_active_variants mpich   g95 }
    106         if {[variant_isset openmpi]} { require_active_variants openmpi g95 }
     115        configure.compiler      macports-gcc-4.7
    107116}
    108117
    109 if { ![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset g95] } {
     118# does not work, will not accept -force_load in linking stage
     119#variant g95 description {build with g95} conflicts gcc43 gcc44 gcc45 gcc46 gcc47 universal openmpi mpich {
     120#        depends_build-append    port:g95
     121#        configure.env-append    F77=${prefix}/bin/g95
     122#}
     123
     124if { ![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] \
     125   && ![variant_isset openmpi] && ![variant_isset mpich]} {
    110126        default_variants      +gcc47
    111127}
    112128
    113129variant accelerate conflicts atlas description {build with Accelerate framework} {
    114     configure.args-append --with-blas=/usr/lib/libblas.dylib --with-lapack=/usr/lib/liblapack.dylib
    115     patchfiles-append patch-ARPACK-cdot-and-zdot.diff
     130    # the change of LDFLAGS is required to avoid linking against the ATLAS ones if they are present;
     131    # if we specify /usr/lib/libblas.dylib directly, the linking fails. http://forge.scilab.org/index.php/p/arpack-ng/issues/1220/
     132    configure.args-delete  LDFLAGS=''
     133    configure.args-append  LDFLAGS='/usr/lib/libblas.dylib /usr/lib/liblapack.dylib' --with-blas="-lblas -llapack"
     134    patchfiles-append      patch-ARPACK-cdot-and-zdot.diff
    116135    if {[variant_isset openmpi] || [variant_isset mpich]} {
    117136        patchfiles-append patch-PARPACK-cdot-and-zdot.diff
    118137    }
     
    120139
    121140variant atlas description {build with atlas} {
    122141    depends_lib-append port:atlas
    123     configure.args-append --with-blas=${prefix}/lib/libsatlas.dylib
     142    configure.args-append --with-blas="-L${prefix}/lib -lsatlas"
    124143}
    125144
    126145if {![variant_isset atlas]} {