Ticket #39835: Portfile-octopus.2.diff

File Portfile-octopus.2.diff, 7.1 KB (added by dstrubbe (David Strubbe), 11 years ago)
  • (a) Portfile_r107233 vs. (b) Portfile

    a b  
    3030                    --disable-gdlib --without-sparskit --with-netcdf-prefix=no \
    3131                    --with-etsf-io-prefix=no --with-berkeleygw-prefix=no \
    3232                    --with-arpack=no --with-libfm=no --with-pfft-prefix=no \
    33                     --with-pspio-prefix=no --with-nfft=no
     33                    --with-pspio-prefix=no --with-nfft=no --with-blacs=no \
     34                    --with-scalapack=no FCCPP="${configure.cc} -E -ansi" \
     35                    --enable-utils
    3436# configure will find and use these other libraries unless they are explicitly disabled
     37configure.optflags  -O3
     38
     39default_variants +newuoa
     40if {![variant_isset gcc46] && ![variant_isset gcc48] && ![variant_isset openmpi] && ![variant_isset mpich]} {
     41    default_variants    +gcc47
     42}
     43
     44pre-fetch {
     45    set fortran unknown
     46    set fortrans { gcc42 gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 g95 }
     47
     48    foreach fc_name ${fortrans} {
     49        if { [variant_isset ${fc_name}] } {
     50            set fortran ${fc_name}
     51        } elseif { [variant_isset openmpi] } {
     52            if { [active_variants openmpi ${fc_name}] } { set fortran ${fc_name} }
     53        } elseif { [variant_isset mpich] } {
     54            if { [_portnameactive mpich] } {
     55                if { [active_variants mpich ${fc_name}] } { set fortran ${fc_name} }
     56            } elseif { [_portnameactive mpich-devel] } {
     57                if { [active_variants mpich-devel ${fc_name}] } { set fortran ${fc_name} }
     58            }
     59        }
     60    }
     61
     62    if { ${fortran} == "unknown" } {
     63        if { [variant_isset openmpi] } {
     64            ui_error "Variant +openmpi requires openmpi to have been built with Fortran support."
     65            return -code error "Variant +openmpi requires openmpi to have been built with Fortran support."
     66        } elseif { [variant_isset mpich] } {
     67            ui_error "Variant +mpich requires mpich/mpich-devel to have been built with Fortran support."
     68            return -code error "Variant +mpich requires mpich/mpich-devel to have been built with Fortran support."
     69        } else {
     70            ui_error "Internal error: cannot determine Fortran compiler."
     71            return -code error "Internal error: cannot determine Fortran compiler."
     72        }
     73    }
     74    ui_msg "Fortran compiler is ${fortran}."
     75
     76    if { ![active_variants libxc ${fortran}] } {
     77        ui_error "libxc must have been built with +${fortran}."
     78        return -code error "libxc must have been built with +${fortran}."
     79    }
    3580
    36 pre-configure {
    37     configure.args-append  FCCPP="${configure.cpp} -ansi"
     81    if { [variant_isset netcdf-fortran] } {
     82        if {![active_variants netcdf-fortran ${fortran}] } {
     83            ui_error "netcdf-fortran must have been built with +${fortran}."
     84            return -code error "netcdf-fortran must have been built with +${fortran}."
     85        }
     86    }
     87
     88    if { [variant_isset etsf_io] } {
     89        if {![active_variants etsf_io ${fortran}] } {
     90            ui_error "etsf_io must have been built with +${fortran}."
     91            return -code error "etsf_io must have been built with +${fortran}."
     92        }
     93    }
    3894
    3995    # use of the same Fortran compiler as the one being used here does not seem necessary
    40     if { ![active_variants fftw-3 gcc43] && ![active_variants fftw-3 gcc44] && \
    41          ![active_variants fftw-3 gcc45] && ![active_variants fftw-3 gcc46] && \
    42          ![active_variants fftw-3 gcc47] && ![active_variants fftw-3 gcc48] && \
    43          ![active_variants fftw-3 g95] } {
    44         ui_error "fftw-3 must be built with a Fortran variant"
    45         return -code error "fftw-3 needs Fortran variant"
     96    set fftw_fortran no
     97    foreach fc_name ${fortrans} {
     98        if { [active_variants fftw-3 ${fc_name}] } { set fftw_fortran yes }
     99    }
     100    if { ${fftw_fortran} == "no" } {
     101        ui_error "fftw-3 must have been built with a Fortran variant"
     102        return -code error "fftw-3 must have been built with a Fortran variant"
    46103    }
    47104}
    48 configure.optflags  -O3
    49105
    50106# More options that could be added:
    51 # variants: berkeleygw, openmp, openmpi, mpich, threads (for fftw, atlas?), scalapack, arpack
    52 # with MPI would need to disable zoltan, scalapack explicitly. no way to turn off PAPI.
     107# variants: berkeleygw, openmp, threads (for fftw, atlas?), scalapack, arpack
     108# no way to turn off PAPI.
    53109
    54110# libxc does not have universal variant, so octopus cannot either
    55111universal_variant   no
     
    57113test.run            yes
    58114test.target         check-full
    59115
    60 variant gcc46 conflicts gcc47 description {Build with GCC 4.6} {
     116variant gcc46 conflicts gcc47 gcc48 openmpi mpich description {Build with GCC 4.6} {
    61117    configure.compiler  macports-gcc-4.6
    62118    depends_lib-append  port:gcc46
    63     require_active_variants libxc gcc46
    64119}
    65120
    66 variant gcc47 conflicts gcc46 description {Build with GCC 4.7} {
     121variant gcc47 conflicts gcc46 gcc48 openmpi mpich description {Build with GCC 4.7} {
    67122    configure.compiler  macports-gcc-4.7
    68123    depends_lib-append  port:gcc47
    69     require_active_variants libxc gcc47
    70124}
    71125
    72 default_variants +newuoa
    73 if {![variant_isset gcc46]} {
    74     default_variants    +gcc47
     126variant gcc48 conflicts gcc46 gcc47 openmpi mpich description {Build with GCC 4.8} {
     127    configure.compiler  macports-gcc-4.8
     128    depends_lib-append  port:gcc48
     129}
     130
     131variant openmpi conflicts gcc46 gcc47 gcc48 mpich description {Build with OpenMPI} {
     132    configure.cc           openmpicc
     133    configure.fc           openmpif90
     134    configure.args-delete  --disable-mpi
     135    # an in-place allreduce of lxyz_inv in mesh_init.F90 leads to zeroes afterwards with MPI2
     136    configure.args-append  --enable-mpi --without-external_zoltan --disable-mpi2
     137    depends_lib-append     port:openmpi
     138    test.env-append        MPIEXEC=${prefix}/bin/openmpiexec
     139}
     140
     141variant mpich conflicts gcc46 gcc47 gcc48 openmpi description {Build with MPICH} {
     142    configure.cc           mpicc
     143    configure.fc           mpif90
     144    configure.args-delete  --disable-mpi
     145    configure.args-append  --enable-mpi --without-external_zoltan
     146    depends_lib-append     path:bin/mpif90:mpich
    75147}
    76148
    77149variant newuoa description {Build with internal newuoa library for optimal control} {
     
    82154    configure.args-delete   --with-netcdf-prefix=no
    83155    configure.args-append   --with-netcdf-prefix=${prefix}
    84156    depends_lib-append      port:netcdf-fortran
    85 
    86157    require_active_variants netcdf-fortran {} universal
    87     if {[variant_isset gcc46]} {
    88         require_active_variants netcdf-fortran gcc46
    89     } else {
    90         require_active_variants netcdf-fortran gcc47
    91     }
    92158}
    93159
    94160variant etsf_io requires netcdf description {Build with support for ETSF_IO output} {
    95161    configure.args-delete   --with-etsf-io-prefix=no
    96162    configure.args-append   --with-etsf-io-prefix=${prefix}
    97163    depends_lib-append      port:etsf_io
    98 
    99     if {[variant_isset gcc46]} {
    100         require_active_variants etsf_io gcc46
    101     } else {
    102         require_active_variants etsf_io gcc47
    103     }
    104164}
    105165
    106166variant sparskit description {Build with support for SPARSKIT propagators} {