| 37 | configure.optflags -O3 |
| 38 | |
| 39 | default_variants +newuoa |
| 40 | if {![variant_isset gcc46] && ![variant_isset gcc48] && ![variant_isset openmpi] && ![variant_isset mpich]} { |
| 41 | default_variants +gcc47 |
| 42 | } |
| 43 | |
| 44 | pre-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 | } |
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 | } |
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" |
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. |
72 | | default_variants +newuoa |
73 | | if {![variant_isset gcc46]} { |
74 | | default_variants +gcc47 |
| 126 | variant 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 | |
| 131 | variant 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 | |
| 141 | variant 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 |