| 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 | } |
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" |
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. |
72 | | default_variants +newuoa |
73 | | if {![variant_isset gcc46]} { |
74 | | default_variants +gcc47 |
| 122 | variant 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 | |
| 127 | variant 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 | |
| 137 | variant 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 |