Ticket #43121: abinit-7.4.3-Portfile-rev0-rev1.diff

File abinit-7.4.3-Portfile-rev0-rev1.diff, 10.8 KB (added by cram5431@…, 10 years ago)

Portfile rev0 vs rev1: this time in unidiff version

  • (a) Portfile_0 vs. (b) Portfile_1

    a b  
    33
    44PortSystem          1.0
    55PortGroup           active_variants 1.1
     6PortGroup           mpi 1.0
    67
    78name                abinit
    89version             7.4.3
     10revision            1
    911categories          science
    1012platforms           darwin
    1113license             GPL-3
     
    3436checksums           rmd160  6e3629a94721440f8afacbcaf2b046b5c6e9b23d \
    3537                    sha256  3593dc96c124c0e1ad29a5ec13e9e8f8dc391b328cf06ed461e34f5a9298b246
    3638
     39#Restrict to gcc/clang because of dependencies
     40compilers.choose    fc cc cxx cpp
     41compilers.setup     -clang -dragonegg -llvm
     42mpi.setup
     43
    3744depends_lib         port:atlas
    3845
    3946configure.args      --with-linalg-flavor="atlas" --enable-gw-dpc
     
    4451use_parallel_build  no
    4552
    4653default_variants +etsf_io +libxc +wannier90
    47 if { ![variant_isset gcc46] && ![variant_isset gcc47] && ![variant_isset gcc48] } {
    48     if { ![variant_isset openmpi] } {
    49         default_variants    +mpich
    50     } elseif { ![variant_isset mpich] } {
    51         default_variants    +openmpi
    52     } else {
    53         default_variants    +gcc48
    54     }
    55 }
    56 
    57 pre-fetch {
    58     set fortran unknown
    59     set fortrans { gcc42 gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 gcc49 g95 }
    6054
    61     foreach fc_name ${fortrans} {
    62         if { [variant_isset ${fc_name}] } {
    63             set fortran ${fc_name}
    64         } elseif { [variant_isset openmpi] } {
    65             if { [_portnameactive openmpi-default] } {
    66                 if { [active_variants openmpi-default ${fc_name}] } { set fortran ${fc_name} }
    67             } elseif { [_portnameactive openmpi-devel-default] } {
    68                 if { [active_variants openmpi-devel-default ${fc_name}] } { set fortran ${fc_name} }
    69             }
    70         } elseif { [variant_isset mpich] } {
    71             if { [_portnameactive mpich-default] } {
    72                 if { [active_variants mpich-default ${fc_name}] } { set fortran ${fc_name} }
    73             } elseif { [_portnameactive mpich-devel-default] } {
    74                 if { [active_variants mpich-devel-default ${fc_name}] } { set fortran ${fc_name} }
    75             }
     55#Select mpi/gcc default
     56set current_mpi "none"
     57if { ![variant_isset no_mpi] } {
     58    if { [mpi_variant_isset] } {
     59        set current_mpi [mpi_variant_name]
     60    } else {
     61        if {![catch {set current_mpi [file link ${prefix}/etc/select/mpi/current]}]} {
     62            if { ${current_mpi} eq "base" } { set current_mpi "none" }
    7663        }
    77     }
    78 
    79     if { ${fortran} eq "unknown" } {
    80         if { [variant_isset openmpi] } {
    81             ui_error "Variant +openmpi requires openmpi to have been built with Fortran support."
    82             return -code error "Variant +openmpi requires openmpi to have been built with Fortran support."
    83         } elseif { [variant_isset mpich] } {
    84             ui_error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support."
    85             return -code error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support."
    86         } else {
    87             ui_error "Internal error: cannot determine Fortran compiler."
    88             return -code error "Internal error: cannot determine Fortran compiler."
     64        if { ${current_mpi} eq "none"} {
     65            default_variants-append +mpich
    8966        }
    9067    }
     68} else {
     69    default_variants-append +gcc48
     70}
    9171
     72pre-fetch {
    9273    if { [variant_isset libxc] } {
    93         if { ![active_variants libxc ${fortran}] } {
    94             ui_error "libxc must have been built with +${fortran}."
    95             return -code error "libxc must have been built with +${fortran}."
     74        if { ![active_variants libxc [c_variant_name]] } {
     75            ui_error "\nlibxc must have been built with +[c_variant_name]\n"
     76            return -code error "libxc must have been built with +[c_variant_name]"
    9677        }
    9778    }
    98 
    9979    if { [variant_isset netcdf] } {
    100         if {![active_variants netcdf-fortran ${fortran}] } {
    101             ui_error "netcdf-fortran must have been built with +${fortran}."
    102             return -code error "netcdf-fortran must have been built with +${fortran}."
     80        if {![active_variants netcdf-fortran [c_variant_name]] } {
     81            ui_error "\nnetcdf-fortran must have been built with +[c_variant_name]\n"
     82            return -code error "netcdf-fortran must have been built with +[c_variant_name]"
    10383        }
    10484    }
    105 
    10685    if { [variant_isset etsf_io] } {
    107         if {![active_variants etsf_io ${fortran}] } {
    108             ui_error "etsf_io must have been built with +${fortran}."
    109             return -code error "etsf_io must have been built with +${fortran}."
     86        if {![active_variants etsf_io [fortran_variant_name]] } {
     87            ui_error "\netsf_io must have been built with +[fortran_variant_name]\n"
     88            return -code error "etsf_io must have been built with +[fortran_variant_name]"
     89        }
     90    }
     91    if { [variant_isset fftw3] } {
     92        if {![active_variants fftw-3 gfortran] || \
     93            ![active_variants fftw-3-single gfortran]} {
     94            ui_error "\nfftw-3 and nfftw-3-single must have been built with +gfortran:"
     95            ui_error "This can be achieved by : sudo port -f install fftw-3-single +gfortran\n"
     96            return -code error "fftw-3/fftw-3-single must have been built with +gfortran"
    11097        }
    11198    }
    112 
    113 #   No need to check compiler for wannier90
    114 #   No need to check compiler for fftw-3
    11599}
    116100
    117101pre-configure {
     
    122106        } else {
    123107            configure.args-append  --with-trio-flavor="none"
    124108    }
    125 
    126     set dft-flavor "none" 
     109    set dft-flavor "none"
    127110    if { [variant_isset libxc] } {
    128         if { ${dft-flavor} eq "none" } { 
     111        if { ${dft-flavor} eq "none" } {
    129112            set dft-flavor "libxc"
    130113        } else {
    131             set dft-flavor ${dft-flavor}"+libxc" 
     114            set dft-flavor ${dft-flavor}"+libxc"
    132115        }
    133116    }
    134117    if { [variant_isset wannier90] } {
    135         if { ${dft-flavor} eq "none" } { 
     118        if { ${dft-flavor} eq "none" } {
    136119            set dft-flavor "wannier90"
    137120        } else {
    138             set dft-flavor ${dft-flavor}"+wannier90" 
     121            set dft-flavor ${dft-flavor}"+wannier90"
    139122        }
    140123    }
    141124    if { [variant_isset bigdft] } {
    142         if { ${dft-flavor} eq "none" } { 
     125        if { ${dft-flavor} eq "none" } {
    143126            set dft-flavor "bigdft"
    144127        } else {
    145             set dft-flavor ${dft-flavor}"+bigdft" 
     128            set dft-flavor ${dft-flavor}"+bigdft"
    146129        }
    147130    }
    148131    if { [variant_isset atompaw] } {
    149         if { ${dft-flavor} eq "none" } { 
     132        if { ${dft-flavor} eq "none" } {
    150133            set dft-flavor "atompaw"
    151134        } else {
    152             set dft-flavor ${dft-flavor}"+atompaw" 
     135            set dft-flavor ${dft-flavor}"+atompaw"
    153136        }
    154137    }
    155138    configure.args-append  --with-dft-flavor="${dft-flavor}"
     139
     140    configure.args-append  FCCPP="${configure.cpp} -ansi"
     141
     142    if { ${current_mpi} ne "none"} {
     143        configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes"
     144        if {[string match *openmpi* ${current_mpi}]} {
     145            configure.args-append   --with-mpi-level="1"
     146        }
     147        if { ![mpi_variant_isset] } {
     148            configure.fc     ${mpi.fc}
     149            configure.cc     ${mpi.cc}
     150            configure.cxx    ${mpi.cxx}
     151        }
     152        if { ${mpi.exec} ne "" } {
     153            configure.args-append  MPI_RUNNER=${mpi.exec}
     154            test.env-append        MPIEXEC=${mpi.exec}
     155        }
     156    } else {
     157        configure.args-append  --enable-mpi="no" --enable-mpi-io="no"
     158    }
    156159}
    157160
    158161destroot {
     
    173176test.run            yes
    174177test.target         check-full
    175178
    176 
    177 variant gcc46 conflicts gcc47 gcc48 openmpi mpich description {Build with GCC 4.6} {
    178     configure.compiler  macports-gcc-4.6
    179     configure.args-append  FCCPP="${configure.cpp} -ansi"
    180 }
    181 
    182 variant gcc47 conflicts gcc46 gcc48 openmpi mpich description {Build with GCC 4.7} {
    183     configure.compiler  macports-gcc-4.7
    184     configure.args-append  FCCPP="${configure.cpp} -ansi"
    185 }
    186 
    187 variant gcc48 conflicts gcc46 gcc47 openmpi mpich description {Build with GCC 4.8} {
    188     configure.compiler  macports-gcc-4.8
    189     configure.args-append  FCCPP="${configure.cpp} -ansi"
    190 }
    191 
    192 variant openmpi conflicts gcc46 gcc47 gcc48 mpich description {Build parallel version with OpenMPI} {
    193     depends_lib-append     path:bin/mpif90-openmpi-mp:openmpi-default
    194     configure.fc           mpif90-openmpi-mp
    195     configure.cc           mpicc-openmpi-mp
    196     configure.cxx          mpicxx-openmpi-mp
    197     configure.args-append  FCCPP="${configure.cc} -E -ansi"
    198     configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes" --with-mpi-level="1"
    199     configure.args-append  MPI_RUNNER=${prefix}/bin/mpiexec-openmpi-mp
    200     test.env-append        MPIEXEC=${prefix}/bin/mpiexec-openmpi-mp
    201 }
    202 
    203 variant mpich conflicts gcc46 gcc47 gcc48 openmpi description {Build parallel version with MPICH} {
    204     depends_lib-append     path:bin/mpif90-mpich-mp:mpich-default
    205     configure.fc           mpif90-mpich-mp
    206     configure.cc           mpicc-mpich-mp
    207     configure.cxx          mpicxx-mpich-mp
    208     configure.args-append  FCCPP="${configure.cc} -E -ansi"
    209     configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes"
    210     configure.args-append  MPI_RUNNER=${prefix}/bin/mpiexec-mpich-mp
    211     test.env-append        MPIEXEC=${prefix}/bin/mpiexec-mpich-mp
    212 }
    213 
    214 variant fftw-3 description {Build with support for fftw-3 FFT library} {
     179variant fftw3 description {Build with support for fftw-3 FFT library} {
    215180    depends_lib-append      port:fftw-3
     181    depends_lib-append      port:fftw-3-single
     182#   require_active_variants fftw-3 gfortran
     183#   require_active_variants fftw-3-single gfortran
    216184    if { [variant_isset threads] } {
    217185        configure.args-append   --with-fft-flavor="fftw3-threads"
    218         configure.args-append   --with-fft-libs="-lfftw3_threads -lfftw3"
     186        configure.args-append   --with-fft-libs="-lfftw3_threads -lfftw3 -lfftw3f"
    219187    } else {
    220188        configure.args-append   --with-fft-flavor="fftw3"
    221         configure.args-append   --with-fft-libs="-lfftw3"
     189        configure.args-append   --with-fft-libs="-lfftw3 -lfftw3f"
    222190    }
    223191}
    224192
     
    252220}
    253221
    254222variant bigdft description {Build with support for the wavelet BigDFT library} {
    255 #   Patch bigdft-abi-1.0.4 (missing config.Sub and config.guess)
     223#   Patch bigdft-abi-1.0.4 (missing config.sub and config.guess)
    256224    patchfiles-append       patch-bigdft-config.diff
    257225}
    258226
    259227variant atompaw description {Build including AtomPAW atomic dataset generator} {
    260228}
    261  
     229
     230variant no_mpi conflicts mpich mpich_devel openmpi openmpi_devel description {Build without MPI support} {
     231}
     232
    262233livecheck.type      regex
    263234livecheck.url       ${homepage}/downloads/source-packages/abinit-1/releases/index.html
    264235livecheck.regex     ABINIT (\[0-9.\]+)