Ticket #42926: abinit-7.6.2-Portfile.diff

File abinit-7.6.2-Portfile.diff, 9.4 KB (added by cram5431@…, 10 years ago)
  • (a) Portfile_0 vs. (b) Portfile_0_new

    a b  
    33
    44PortSystem          1.0
    55PortGroup           active_variants 1.1
     6PortGroup           mpi 1.0
    67
    78name                abinit
    89version             7.6.2
     
    3435checksums           rmd160  07fd2c968a251635d03d57b244516409845637bc \
    3536                    sha256  79645461f7611aaf007bcddb662d21a042c64ac4085d14057387f036f9dae2c5
    3637
     38#Restrict to gcc/clang because of dependencies
     39compilers.choose    fc cc cxx cpp
     40compilers.setup     -clang -dragonegg -llvm
     41mpi.setup
     42
    3743depends_lib         port:atlas
    3844
    3945configure.args      --with-linalg-flavor="atlas" --enable-gw-dpc
     
    4753use_parallel_build  no
    4854
    4955default_variants +etsf_io +libxc +wannier90
    50 if { ![variant_isset gcc46] && ![variant_isset gcc47] && ![variant_isset gcc48] } {
    51     if { ![variant_isset openmpi] } {
    52         default_variants    +mpich
    53     } elseif { ![variant_isset mpich] } {
    54         default_variants    +openmpi
    55     } else {
    56         default_variants    +gcc48
    57     }
    58 }
    59 
    60 pre-fetch {
    61     set fortran unknown
    62     set fortrans { gcc44 gcc45 gcc46 gcc47 gcc48 gcc49 g95 }
    6356
    64     foreach fc_name ${fortrans} {
    65         if { [variant_isset ${fc_name}] } {
    66             set fortran ${fc_name}
    67         } elseif { [variant_isset openmpi] } {
    68             if { [_portnameactive openmpi-default] } {
    69                 if { [active_variants openmpi-default ${fc_name}] } { set fortran ${fc_name} }
    70             } elseif { [_portnameactive openmpi-devel-default] } {
    71                 if { [active_variants openmpi-devel-default ${fc_name}] } { set fortran ${fc_name} }
    72             }
    73         } elseif { [variant_isset mpich] } {
    74             if { [_portnameactive mpich-default] } {
    75                 if { [active_variants mpich-default ${fc_name}] } { set fortran ${fc_name} }
    76             } elseif { [_portnameactive mpich-devel-default] } {
    77                 if { [active_variants mpich-devel-default ${fc_name}] } { set fortran ${fc_name} }
    78             }
     57#Select mpi/gcc default
     58set current_mpi "none"
     59if { ![variant_isset no_mpi] } {
     60    if { [mpi_variant_isset] } {
     61        set current_mpi [mpi_variant_name]
     62    } else {
     63        if {![catch {set current_mpi [file link ${prefix}/etc/select/mpi/current]}]} {
     64            if { ${current_mpi} eq "base" } { set current_mpi "none" }
    7965        }
    80     }
    81 
    82     if { ${fortran} eq "unknown" } {
    83         if { [variant_isset openmpi] } {
    84             ui_error "Variant +openmpi requires openmpi to have been built with Fortran support."
    85             return -code error "Variant +openmpi requires openmpi to have been built with Fortran support."
    86         } elseif { [variant_isset mpich] } {
    87             ui_error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support."
    88             return -code error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support."
    89         } else {
    90             ui_error "Internal error: cannot determine Fortran compiler."
    91             return -code error "Internal error: cannot determine Fortran compiler."
     66        if { ${current_mpi} eq "none"} {
     67            default_variants-append +mpich
    9268        }
    9369    }
     70} else {
     71    default_variants-append +gcc48
     72}
    9473
     74pre-fetch {
    9575    if { [variant_isset libxc] } {
    96         if { ![active_variants libxc ${fortran}] } {
    97             ui_error "libxc must have been built with +${fortran}."
    98             return -code error "libxc must have been built with +${fortran}."
     76        if { ![active_variants libxc [c_variant_name]] } {
     77            ui_error "\nlibxc must have been built with +[c_variant_name]\n"
     78            return -code error "libxc must have been built with +[c_variant_name]"
    9979        }
    10080    }
    101 
    10281    if { [variant_isset netcdf] } {
    103         if {![active_variants netcdf-fortran ${fortran}] } {
    104             ui_error "netcdf-fortran must have been built with +${fortran}."
    105             return -code error "netcdf-fortran must have been built with +${fortran}."
     82        if {![active_variants netcdf-fortran [c_variant_name]] } {
     83            ui_error "\nnetcdf-fortran must have been built with +[c_variant_name]\n"
     84            return -code error "netcdf-fortran must have been built with +[c_variant_name]"
    10685        }
    10786    }
    108 
    10987    if { [variant_isset etsf_io] } {
    110         if {![active_variants etsf_io ${fortran}] } {
    111             ui_error "etsf_io must have been built with +${fortran}."
    112             return -code error "etsf_io must have been built with +${fortran}."
     88        if {![active_variants etsf_io [fortran_variant_name]] } {
     89            ui_error "\netsf_io must have been built with +[fortran_variant_name]\n"
     90            return -code error "etsf_io must have been built with +[fortran_variant_name]"
     91        }
     92    }
     93    if { [variant_isset fftw3] } {
     94        if {![active_variants fftw-3 gfortran] || \
     95            ![active_variants fftw-3-single gfortran]} {
     96            ui_error "\nfftw-3 and nfftw-3-single must have been built with +gfortran:"
     97            ui_error "This can be achieved by : sudo port -f install fftw-3-single +gfortran\n"
     98            return -code error "fftw-3/fftw-3-single must have been built with +gfortran"
    11399        }
    114100    }
    115 
    116 #   No need to check compiler for wannier90
    117 #   No need to check compiler for fftw-3
    118101}
    119102
    120103pre-configure {
     
    156139        }
    157140    }
    158141    configure.args-append  --with-dft-flavor="${dft-flavor}"
     142
     143    configure.args-append  FCCPP="${configure.cpp} -ansi"
     144
     145    if { ${current_mpi} ne "none"} {
     146        configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes"
     147        if {[string match *openmpi* ${current_mpi}]} {
     148            configure.args-append   --with-mpi-level="1"
     149        }
     150        if { ![mpi_variant_isset] } {
     151            configure.fc     ${mpi.fc}
     152            configure.cc     ${mpi.cc}
     153            configure.cxx    ${mpi.cxx}
     154        }
     155        if { ${mpi.exec} ne "" } {
     156            configure.args-append  MPI_RUNNER=${mpi.exec}
     157            test.env-append        MPIEXEC=${mpi.exec}
     158        }
     159    } else {
     160        configure.args-append  --enable-mpi="no" --enable-mpi-io="no"
     161    }
    159162}
    160163
    161164destroot {
     
    176179test.run            yes
    177180test.target         check-full
    178181
    179 
    180 variant gcc46 conflicts gcc47 gcc48 openmpi mpich description {Build with GCC 4.6} {
    181     configure.compiler  macports-gcc-4.6
    182     configure.args-append  FCCPP="${configure.cpp} -ansi"
    183 }
    184 
    185 variant gcc47 conflicts gcc46 gcc48 openmpi mpich description {Build with GCC 4.7} {
    186     configure.compiler  macports-gcc-4.7
    187     configure.args-append  FCCPP="${configure.cpp} -ansi"
    188 }
    189 
    190 variant gcc48 conflicts gcc46 gcc47 openmpi mpich description {Build with GCC 4.8} {
    191     configure.compiler  macports-gcc-4.8
    192     configure.args-append  FCCPP="${configure.cpp} -ansi"
    193 }
    194 
    195 variant openmpi conflicts gcc46 gcc47 gcc48 mpich description {Build parallel version with OpenMPI} {
    196     depends_lib-append     path:bin/mpif90-openmpi-mp:openmpi-default
    197     configure.fc           mpif90-openmpi-mp
    198     configure.cc           mpicc-openmpi-mp
    199     configure.cxx          mpicxx-openmpi-mp
    200     configure.args-append  FCCPP="${configure.cc} -E -ansi"
    201     configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes" --with-mpi-level="1"
    202     configure.args-append  MPI_RUNNER=${prefix}/bin/mpiexec-openmpi-mp
    203     test.env-append        MPIEXEC=${prefix}/bin/mpiexec-openmpi-mp
    204 }
    205 
    206 variant mpich conflicts gcc46 gcc47 gcc48 openmpi description {Build parallel version with MPICH} {
    207     depends_lib-append     path:bin/mpif90-mpich-mp:mpich-default
    208     configure.fc           mpif90-mpich-mp
    209     configure.cc           mpicc-mpich-mp
    210     configure.cxx          mpicxx-mpich-mp
    211     configure.args-append  FCCPP="${configure.cc} -E -ansi"
    212     configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes"
    213     configure.args-append  MPI_RUNNER=${prefix}/bin/mpiexec-mpich-mp
    214     test.env-append        MPIEXEC=${prefix}/bin/mpiexec-mpich-mp
    215 }
    216 
    217 variant fftw-3 description {Build with support for fftw-3 FFT library} {
     182variant fftw3 description {Build with support for fftw-3 FFT library} {
    218183    depends_lib-append      port:fftw-3
     184    depends_lib-append      port:fftw-3-single
     185#   require_active_variants fftw-3 gfortran
     186#   require_active_variants fftw-3-single gfortran
    219187    if { [variant_isset threads] } {
    220188        configure.args-append   --with-fft-flavor="fftw3-threads"
    221         configure.args-append   --with-fft-libs="-lfftw3_threads -lfftw3"
     189        configure.args-append   --with-fft-libs="-lfftw3_threads -lfftw3 -lfftw3f"
    222190    } else {
    223191        configure.args-append   --with-fft-flavor="fftw3"
    224         configure.args-append   --with-fft-libs="-lfftw3"
     192        configure.args-append   --with-fft-libs="-lfftw3 -lfftw3f"
    225193    }
    226194}
    227195
     
    255223}
    256224
    257225variant bigdft description {Build with support for the wavelet BigDFT library} {
    258 #   Patch bigdft-abi-1.0.4 (missing config.Sub and config.guess)
     226#   Patch bigdft-abi-1.0.4 (missing config.sub and config.guess)
    259227    patchfiles-append       patch-bigdft-config.diff
    260228}
    261229
    262230variant atompaw description {Build including AtomPAW atomic dataset generator} {
    263231}
    264232 
     233variant no_mpi conflicts mpich mpich_devel openmpi openmpi_devel description {Build without MPI support} {
     234}
     235
    265236livecheck.type      regex
    266237livecheck.url       ${homepage}/downloads/source-packages/abinit-1/releases/index.html
    267238livecheck.regex     ABINIT (\[0-9.\]+)