Ticket #39835: Portfile-octopus.diff

File Portfile-octopus.diff, 6.9 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 { ![active_variants netcdf-fortran ${fortran}] } {
     82        ui_error "netcdf-fortran must have been built with +${fortran}."
     83        return -code error "netcdf-fortran must have been built with +${fortran}."
     84    }
     85
     86    if { ![active_variants etsf_io ${fortran}] } {
     87        ui_error "etsf_io must have been built with +${fortran}."
     88        return -code error "etsf_io must have been built with +${fortran}."
     89    }
    3890
    3991    # 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"
     92    set fftw_fortran no
     93    foreach fc_name ${fortrans} {
     94        if { [active_variants fftw-3 ${fc_name}] } { set fftw_fortran yes }
     95    }
     96    if { ${fftw_fortran} == "no" } {
     97        ui_error "fftw-3 must have been built with a Fortran variant"
     98        return -code error "fftw-3 must have been built with a Fortran variant"
    4699    }
    47100}
    48 configure.optflags  -O3
    49101
    50102# 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.
     103# variants: berkeleygw, openmp, threads (for fftw, atlas?), scalapack, arpack
     104# no way to turn off PAPI.
    53105
    54106# libxc does not have universal variant, so octopus cannot either
    55107universal_variant   no
     
    57109test.run            yes
    58110test.target         check-full
    59111
    60 variant gcc46 conflicts gcc47 description {Build with GCC 4.6} {
     112variant gcc46 conflicts gcc47 gcc48 openmpi mpich description {Build with GCC 4.6} {
    61113    configure.compiler  macports-gcc-4.6
    62114    depends_lib-append  port:gcc46
    63     require_active_variants libxc gcc46
    64115}
    65116
    66 variant gcc47 conflicts gcc46 description {Build with GCC 4.7} {
     117variant gcc47 conflicts gcc46 gcc48 openmpi mpich description {Build with GCC 4.7} {
    67118    configure.compiler  macports-gcc-4.7
    68119    depends_lib-append  port:gcc47
    69     require_active_variants libxc gcc47
    70120}
    71121
    72 default_variants +newuoa
    73 if {![variant_isset gcc46]} {
    74     default_variants    +gcc47
     122variant gcc48 conflicts gcc46 gcc47 openmpi mpich description {Build with GCC 4.8} {
     123    configure.compiler  macports-gcc-4.8
     124    depends_lib-append  port:gcc48
     125}
     126
     127variant openmpi conflicts gcc46 gcc47 gcc48 mpich description {Build with OpenMPI} {
     128    configure.cc           openmpicc
     129    configure.fc           openmpif90
     130    configure.args-delete  --disable-mpi
     131    # an in-place allreduce of lxyz_inv in mesh_init.F90 leads to zeroes afterwards with MPI2
     132    configure.args-append  --enable-mpi --without-external_zoltan --disable-mpi2
     133    depends_lib-append     port:openmpi
     134    test.env-append        MPIEXEC=${prefix}/bin/openmpiexec
     135}
     136
     137variant mpich conflicts gcc46 gcc47 gcc48 openmpi description {Build with MPICH} {
     138    configure.cc           mpicc
     139    configure.fc           mpif90
     140    configure.args-delete  --disable-mpi
     141    configure.args-append  --enable-mpi --without-external_zoltan
     142    depends_lib-append     path:bin/mpif90:mpich
    75143}
    76144
    77145variant newuoa description {Build with internal newuoa library for optimal control} {
     
    82150    configure.args-delete   --with-netcdf-prefix=no
    83151    configure.args-append   --with-netcdf-prefix=${prefix}
    84152    depends_lib-append      port:netcdf-fortran
    85 
    86153    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     }
    92154}
    93155
    94156variant etsf_io requires netcdf description {Build with support for ETSF_IO output} {
    95157    configure.args-delete   --with-etsf-io-prefix=no
    96158    configure.args-append   --with-etsf-io-prefix=${prefix}
    97159    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     }
    104160}
    105161
    106162variant sparskit description {Build with support for SPARSKIT propagators} {