[116360] trunk/dports/science/octopus/Portfile

sean at macports.org sean at macports.org
Thu Jan 23 12:13:32 PST 2014


Revision: 116360
          https://trac.macports.org/changeset/116360
Author:   sean at macports.org
Date:     2014-01-23 12:13:32 -0800 (Thu, 23 Jan 2014)
Log Message:
-----------
octopus: use mpi portgroup

Modified Paths:
--------------
    trunk/dports/science/octopus/Portfile

Modified: trunk/dports/science/octopus/Portfile
===================================================================
--- trunk/dports/science/octopus/Portfile	2014-01-23 20:13:29 UTC (rev 116359)
+++ trunk/dports/science/octopus/Portfile	2014-01-23 20:13:32 UTC (rev 116360)
@@ -2,8 +2,11 @@
 # $Id$
 
 PortSystem          1.0
-PortGroup           active_variants 1.1
+PortGroup           mpi 1.0
 
+mpi.setup           require_fortran -clang -dragonegg -fortran
+compilers.enforce_fortran libxc fftw-3
+
 name                octopus
 version             4.1.2
 categories          science
@@ -36,69 +39,19 @@
 configure.optflags  -O3
 
 default_variants +newuoa
-if {![variant_isset gcc46] && ![variant_isset gcc47] && ![variant_isset gcc48] && ![variant_isset openmpi] && ![variant_isset mpich]} {
+if {![fortran_variant_isset]} {
     default_variants    +gcc48
 }
 
-pre-fetch {
-    set fortran unknown
-    set fortrans { gcc42 gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 gcc49 g95 }
+pre-configure {
+    configure.args-append  FCCPP="${configure.cpp} -E -ansi"
+}
 
-    foreach fc_name ${fortrans} {
-        if { [variant_isset ${fc_name}] } {
-            set fortran ${fc_name}
-        } elseif { [variant_isset openmpi] } {
-            if { [active_variants openmpi ${fc_name}] } { set fortran ${fc_name} }
-        } elseif { [variant_isset mpich] } {
-            if { [_portnameactive mpich-default] } {
-                if { [active_variants mpich-default ${fc_name}] } { set fortran ${fc_name} }
-            } elseif { [_portnameactive mpich-devel-default] } {
-                if { [active_variants mpich-devel-default ${fc_name}] } { set fortran ${fc_name} }
-            }
-        }
-    }
-
-    if { ${fortran} == "unknown" } {
-        if { [variant_isset openmpi] } {
-            ui_error "Variant +openmpi requires openmpi to have been built with Fortran support."
-            return -code error "Variant +openmpi requires openmpi to have been built with Fortran support."
-        } elseif { [variant_isset mpich] } {
-            ui_error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support."
-            return -code error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support."
-        } else {
-            ui_error "Internal error: cannot determine Fortran compiler."
-            return -code error "Internal error: cannot determine Fortran compiler."
-        }
-    }
-
-    if { ![active_variants libxc ${fortran}] } {
-        ui_error "libxc must have been built with +${fortran}."
-        return -code error "libxc must have been built with +${fortran}."
-    }
-
-    if { [variant_isset netcdf-fortran] } {
-        if {![active_variants netcdf-fortran ${fortran}] } {
-            ui_error "netcdf-fortran must have been built with +${fortran}."
-            return -code error "netcdf-fortran must have been built with +${fortran}."
-        }
-    }
-
-    if { [variant_isset etsf_io] } {
-        if {![active_variants etsf_io ${fortran}] } {
-            ui_error "etsf_io must have been built with +${fortran}."
-            return -code error "etsf_io must have been built with +${fortran}."
-        }
-    }
-
-    # use of the same Fortran compiler as the one being used here does not seem necessary
-    set fftw_fortran no
-    foreach fc_name ${fortrans} {
-        if { [active_variants fftw-3 ${fc_name}] } { set fftw_fortran yes }
-    }
-    if { ${fftw_fortran} == "no" } {
-        ui_error "fftw-3 must have been built with a Fortran variant"
-        return -code error "fftw-3 must have been built with a Fortran variant"
-    }
+if {[mpi_variant_isset]} {
+    configure.args-delete  --disable-mpi
+    # an in-place allreduce of lxyz_inv in mesh_init.F90 leads to zeroes afterwards with MPI2
+    configure.args-append  --enable-mpi --without-external_zoltan --disable-mpi2
+    test.env-append        MPIEXEC=${mpi.exec}
 }
 
 # More options that could be added:
@@ -111,42 +64,6 @@
 test.run            yes
 test.target         check-full
 
-variant gcc46 conflicts gcc47 gcc48 openmpi mpich description {Build with GCC 4.6} {
-    configure.compiler  macports-gcc-4.6
-    configure.args-append  FCCPP="${configure.cpp} -ansi"
-}
-
-variant gcc47 conflicts gcc46 gcc48 openmpi mpich description {Build with GCC 4.7} {
-    configure.compiler  macports-gcc-4.7
-    configure.args-append  FCCPP="${configure.cpp} -ansi"
-}
-
-variant gcc48 conflicts gcc46 gcc47 openmpi mpich description {Build with GCC 4.8} {
-    configure.compiler  macports-gcc-4.8
-    configure.args-append  FCCPP="${configure.cpp} -ansi"
-}
-
-variant openmpi conflicts gcc46 gcc47 gcc48 mpich description {Build with OpenMPI} {
-    configure.cc           openmpicc
-    configure.fc           openmpif90
-    configure.args-append  FCCPP="${configure.cc} -E -ansi"
-    configure.args-delete  --disable-mpi
-    # an in-place allreduce of lxyz_inv in mesh_init.F90 leads to zeroes afterwards with MPI2
-    configure.args-append  --enable-mpi --without-external_zoltan --disable-mpi2
-    depends_lib-append     port:openmpi
-    test.env-append        MPIEXEC=${prefix}/bin/openmpiexec
-}
-
-variant mpich conflicts gcc46 gcc47 gcc48 openmpi description {Build with MPICH} {
-    configure.cc           mpicc-mp
-    configure.fc           mpif90-mp
-    configure.args-append  FCCPP="${configure.cc} -E -ansi"
-    configure.args-delete  --disable-mpi
-    configure.args-append  --enable-mpi --without-external_zoltan
-    test.env-append        MPIEXEC=${prefix}/bin/mpiexec-mp
-    depends_lib-append     path:bin/mpif90-mp:mpich-default
-}
-
 variant newuoa description {Build with internal newuoa library for optimal control} {
     configure.args-append --enable-newuoa
 }
@@ -156,12 +73,14 @@
     configure.args-append   --with-netcdf-prefix=${prefix}
     depends_lib-append      port:netcdf-fortran
     require_active_variants netcdf-fortran {} universal
+    compilers.enforce_fortran netcdf-fortran
 }
 
 variant etsf_io requires netcdf description {Build with support for ETSF_IO output} {
     configure.args-delete   --with-etsf-io-prefix=no
     configure.args-append   --with-etsf-io-prefix=${prefix}
     depends_lib-append      port:etsf_io
+    compilers.enforce_fortran etsf_io
 }
 
 variant sparskit description {Build with support for SPARSKIT propagators} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140123/dde90288/attachment.html>


More information about the macports-changes mailing list