[143272] trunk/dports/science/abinit/Portfile

dstrubbe at macports.org dstrubbe at macports.org
Sat Dec 12 09:17:05 PST 2015


Revision: 143272
          https://trac.macports.org/changeset/143272
Author:   dstrubbe at macports.org
Date:     2015-12-09 11:12:22 -0800 (Wed, 09 Dec 2015)
Log Message:
-----------
abinit: Maintainer timeout, ticket #45617.
* Updating to 7.10.5
* Using compilers and mpi portgroups
* Adds support for gcc5 and gcc6, and understanding of +gfortran in dependencies; support for devel MPI ports
* Great simplification of enforcement of Fortran variants etc. in pre-fetch.
* Disabled +atompaw, since it (like the +bigdft variant) downloads some code itself in the build step.
* Fixed livecheck.
* Presence of Fortran variant for fftw-3 and fftw-3-single is checked.
* Apparently OpenMPI would not use MPI2 here before; I expect this is related to a bug in OpenMPI (or its packaging) that I found with octopus, and was fixed some time ago (#39826). Now MPI2 is enabled always.
* +g95 is usable now (though not with threads).
* Removed unnecessary statement "build.cmd make" which is the default.
* cxx compiler is not specified since it does not appear to be used in abinit.

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

Modified: trunk/dports/science/abinit/Portfile
===================================================================
--- trunk/dports/science/abinit/Portfile	2015-12-09 19:02:43 UTC (rev 143271)
+++ trunk/dports/science/abinit/Portfile	2015-12-09 19:12:22 UTC (rev 143272)
@@ -2,10 +2,10 @@
 # $Id$
 
 PortSystem          1.0
-PortGroup           active_variants 1.1
+PortGroup           mpi 1.0
 
 name                abinit
-version             7.10.2
+version             7.10.5
 revision            2
 categories          science
 platforms           darwin
@@ -32,19 +32,19 @@
 homepage            http://www.abinit.org
 master_sites        http://ftp.abinit.org/
 
-checksums           rmd160  cf4078c1eab2cc3200e084379738939cafda5ba2 \
-                    sha256  cbead80096d97f1c8d08ccb3b9b2851ac1e56accaebe551d9ab29757e9cd531e
+checksums           rmd160  f77a9db5bcd97bcc46ea11a96bbf8f17cb1a19b3 \
+                    sha256  e9376a3e34790bce90992f28e5fa8554b51ba467bf5709c7fd25d300e7c4f56a
 
-depends_lib         port:atlas
+# or vecLibFort, or OpenBLAS(-devel)
+depends_lib-append  port:atlas
 
-configure.args      --with-linalg-flavor="atlas" --enable-gw-dpc
+compilers.choose    cc fc
+# g95 is not compatible with OpenMP
+mpi.setup           default require_fortran -g95
+
+configure.args-append  --with-linalg-flavor="atlas" --enable-gw-dpc --enable-fox
 configure.optflags  -O3
 
-# FIXME: not right for g95? would be -ffree-line-length-huge. This is really the configure script's job? Not easy to set this right for MPI g95.
-# If this is not set, there will be some compilation failures, due to inadequate provisions by the code for compilers that don't accept long lines.
-configure.fcflags-append -ffree-line-length-none
-
-build.cmd           make
 use_parallel_build  yes
 
 # We do not need to use ABINIT's own approach to parallel builds, which only is relevant if
@@ -54,80 +54,19 @@
 
 default_variants +etsf_io +libxc
 # Do not put +wannier90 since tests fail for wannier90 use.
-if { ![variant_isset gcc46] && ![variant_isset gcc47] && ![variant_isset gcc48] && ![variant_isset gcc49] } {
-    if { ![variant_isset openmpi] } {
-        default_variants    +mpich
-    } elseif { ![variant_isset mpich] } {
-        default_variants    +openmpi
-    } else {
-        default_variants    +gcc49
-    }
-}
 
-# FIXME: use compiler and MPI port groups
-
-pre-fetch {
-    set fortran unknown
-    set fortrans { gcc42 gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 gcc49 g95 }
-
-    foreach fc_name ${fortrans} {
-        if { [variant_isset ${fc_name}] } {
-            set fortran ${fc_name}
-        } elseif { [variant_isset openmpi] } {
-            if { [_portnameactive openmpi-default] } {
-                if { [active_variants openmpi-default ${fc_name}] } { set fortran ${fc_name} }
-            } elseif { [_portnameactive openmpi-devel-default] } {
-                if { [active_variants openmpi-devel-default ${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} }
-            }
+pre-configure {
+    if {[fortran_variant_name] eq "g95"} {
+        configure.fcflags-append -ffree-line-length-huge
+        if {[variant_isset threads]} {
+            ui_error "You can select only one of +g95 and +threads."
+            return -code error "+g95 and +threads are not compatible since g95 does not support OpenMP."
         }
+    } else {
+        configure.fcflags-append -ffree-line-length-none
     }
 
-    if { ${fortran} eq "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 { [variant_isset libxc] } {
-        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] } {
-        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}."
-        }
-    }
-
-#   No need to check compiler for wannier90
-#   No need to check compiler for fftw-3
-}
-
-pre-configure {
-    if { [variant_isset etsf_io] } {
             configure.args-append  --with-trio-flavor="netcdf+etsf_io"
         } elseif { [variant_isset netcdf] } {
             configure.args-append  --with-trio-flavor="netcdf"
@@ -187,52 +126,21 @@
 test.target         built-in fast
 # wannier90 test will probably fail.
 
-variant gcc46 conflicts gcc47 gcc48 gcc49 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 gcc49 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 gcc49 openmpi mpich description {Build with GCC 4.8} {
-    configure.compiler  macports-gcc-4.8
-    configure.args-append  FCCPP="${configure.cpp} -ansi"
-}
-
-variant gcc49 conflicts gcc46 gcc47 gcc48 openmpi mpich description {Build with GCC 4.9} {
-    configure.compiler  macports-gcc-4.9
-    configure.args-append  FCCPP="${configure.cpp} -ansi"
-}
-
-variant openmpi conflicts gcc46 gcc47 gcc48 gcc49 mpich description {Build parallel version with OpenMPI} {
-    depends_lib-append     path:bin/mpif90-openmpi-mp:openmpi-default
-    configure.fc           mpif90-openmpi-mp
-    configure.cc           mpicc-openmpi-mp
-    configure.cxx          mpicxx-openmpi-mp
+pre-configure {
     configure.args-append  FCCPP="${configure.cc} -E -ansi"
-    configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes" --with-mpi-level="1"
-    configure.args-append  MPI_RUNNER=${prefix}/bin/mpiexec-openmpi-mp
-    test.env-append        MPIEXEC=${prefix}/bin/mpiexec-openmpi-mp
+    if {[mpi_variant_isset]} {
+        configure.args-append  MPI_RUNNER=${mpi.exec}
+        test.env-append        MPIEXEC=${mpi.exec}
+        configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes"
+    } else {
+        configure.args-append  --enable-mpi="no"
+    }
 }
 
-variant mpich conflicts gcc46 gcc47 gcc48 gcc49 openmpi description {Build parallel version with MPICH} {
-    depends_lib-append     path:bin/mpif90-mpich-mp:mpich-default
-    configure.fc           mpif90-mpich-mp
-    configure.cc           mpicc-mpich-mp
-    configure.cxx          mpicxx-mpich-mp
-    configure.args-append  FCCPP="${configure.cc} -E -ansi"
-    configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes"
-    configure.args-append  MPI_RUNNER=${prefix}/bin/mpiexec-mpich-mp
-    test.env-append        MPIEXEC=${prefix}/bin/mpiexec-mpich-mp
-}
-
 variant fftw3 description {Build with support for fftw-3 FFT library} {
-    # FIXME: these need to be installed with some Fortran variant
-    depends_lib-append      port:fftw-3
-    depends_lib-append      port:fftw-3-single
+    depends_lib-append      port:fftw-3 port:fftw-3-single
+    compilers.enforce_some_fortran fftw-3 fftw-3-single
+    
     if { [variant_isset threads] } {
         configure.args-append   --with-fft-flavor="fftw3-threads"
         configure.args-append   --with-fft-libs="-lfftw3_threads -lfftw3 -lfftw3f"
@@ -242,7 +150,8 @@
     }
 }
 
-variant threads description {Build with support for multi-thread support (openMP)} {
+variant threads description {Build with support for OpenMP threads} {
+    # not compatible with g95. What about threaded FFTW3?
     configure.args-append   --enable-openmp
     configure.fcflags-append -fopenmp
     configure.args-append   --with-linalg-libs="-L${prefix}/lib -ltatlas"
@@ -251,17 +160,20 @@
 
 variant netcdf description {Build with support for NetCDF transferable I/O} {
     depends_lib-append      port:netcdf-fortran
+    compilers.enforce_fortran netcdf-fortran
     configure.args-append   --with-netcdf-incs="-I${prefix}/include"
     configure.args-append   --with-netcdf-libs="-L${prefix}/lib -lnetcdf -lnetcdff"
 }
 
 variant etsf_io requires netcdf description {Build with support for ETSF_IO transferable I/O} {
     depends_lib-append      port:etsf_io
+    compilers.enforce_fortran etsf_io
     configure.args-append   --with-etsf-io-incs="-I${prefix}/include/gcc"
 }
 
 variant libxc description {Build with support for libXC exchange-correlation library} {
     depends_lib-append      port:libxc
+    compilers.enforce_fortran libxc
     configure.args-append   --with-libxc-incs="-I${prefix}/include"
 }
 
@@ -281,9 +193,10 @@
 #    patchfiles-append       patch-fallbacks-sources-bigdft-1.7.0.93-src-Makefile.in.diff
 #}
 
-variant atompaw description {Build including AtomPAW atomic dataset generator} {
-}
+# FIXME: same problem as for BigDFT, it gets downloaded. Make a separate port.
+#variant atompaw description {Build including AtomPAW atomic dataset generator} {
+#}
  
 livecheck.type      regex
-livecheck.url       ${homepage}/downloads/source-packages/abinit-1/releases/index.html
-livecheck.regex     ABINIT (\[0-9.\]+)
+livecheck.url       ${homepage}/downloads/abinit-packages
+livecheck.regex     ABINIT v (\[0-9.\]+)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151212/dde1b970/attachment-0001.html>


More information about the macports-changes mailing list