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 |
| 58 | set current_mpi "none" |
| 59 | if { ![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" } |
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 |
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" |
| 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 | } |
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} { |
| 182 | variant fftw3 description {Build with support for fftw-3 FFT library} { |