<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[145879] trunk/dports/science/abinit/Portfile</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/145879">145879</a></dd>
<dt>Author</dt> <dd>dstrubbe@macports.org</dd>
<dt>Date</dt> <dd>2016-02-19 10:20:34 -0800 (Fri, 19 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>abinit: Add variants to choose linear algebra library, including scalapack. Comment out bigdft/atompaw stuff. Enable more tests. Fix test phase to actually use mpirun.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsscienceabinitPortfile">trunk/dports/science/abinit/Portfile</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsscienceabinitPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/science/abinit/Portfile (145878 => 145879)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/abinit/Portfile        2016-02-19 18:19:50 UTC (rev 145878)
+++ trunk/dports/science/abinit/Portfile        2016-02-19 18:20:34 UTC (rev 145879)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> # g95 is not compatible with OpenMP, and support will be removed in the next version
</span><span class="cx"> mpi.setup           default require_fortran -g95
</span><span class="cx"> 
</span><del>-configure.args-append  --with-linalg-flavor=&quot;atlas&quot; --enable-gw-dpc
</del><ins>+configure.args-append  --enable-gw-dpc
</ins><span class="cx"> configure.optflags  -O3
</span><span class="cx"> 
</span><span class="cx"> use_parallel_build  yes
</span><span class="lines">@@ -53,7 +53,6 @@
</span><span class="cx"> #build.target        multi multi_nprocs=4
</span><span class="cx"> 
</span><span class="cx"> default_variants +etsf_io +libxc
</span><del>-# Do not put +wannier90 since tests fail for wannier90 use.
</del><span class="cx"> 
</span><span class="cx"> pre-configure {
</span><span class="cx">     if {[fortran_variant_name] eq &quot;g95&quot;} {
</span><span class="lines">@@ -94,21 +93,44 @@
</span><span class="cx"> #            set dft-flavor ${dft-flavor}+wannier90
</span><span class="cx"> #        }
</span><span class="cx"> #    }
</span><del>-    if { [variant_isset bigdft] } {
-        if { ${dft-flavor} eq &quot;none&quot; } {
-            set dft-flavor bigdft
</del><ins>+#    if { [variant_isset bigdft] } {
+#        if { ${dft-flavor} eq &quot;none&quot; } {
+#            set dft-flavor bigdft
+#        } else {
+#            set dft-flavor ${dft-flavor}+bigdft
+#        }
+#    }
+#    if { [variant_isset atompaw] } {
+#        if { ${dft-flavor} eq &quot;none&quot; } {
+#            set dft-flavor atompaw
+#        } else {
+#            set dft-flavor ${dft-flavor}+atompaw
+#        }
+#    }
+    configure.args-append  --with-dft-flavor=&quot;${dft-flavor}&quot;
+
+    set linalg-flavor &quot;none&quot;
+    if { [variant_isset atlas] } {
+        set linalg-flavor atlas
+        if {[variant_isset threads]} {
+            set linalg_libs    -ltatlas
</ins><span class="cx">         } else {
</span><del>-            set dft-flavor ${dft-flavor}+bigdft
</del><ins>+            set linalg_libs    -lsatlas
</ins><span class="cx">         }
</span><del>-    }
-    if { [variant_isset atompaw] } {
-        if { ${dft-flavor} eq &quot;none&quot; } {
-            set dft-flavor atompaw
-        } else {
-            set dft-flavor ${dft-flavor}+atompaw
</del><ins>+    } else {
+        set linalg-flavor netlib
+        if { [variant_isset accelerate] } {
+            set linalg_libs        -lveclibfort
+        } elseif { [variant_isset openblas] } {
+            set linalg_libs        -lopenblas
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-    configure.args-append  --with-dft-flavor=&quot;${dft-flavor}&quot;
</del><ins>+    if { [variant_isset scalapack] } {
+        set linalg-flavor ${linalg-flavor}+scalapack
+        set linalg_libs        &quot;${linalg_libs} -lscalapack&quot;
+    }
+    configure.args-append   --with-linalg-flavor=&quot;${linalg-flavor}&quot;
+    configure.args-append   --with-linalg-libs=&quot;${linalg_libs}&quot;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # install binaries and pkgconfig but the very large number of test files
</span><span class="lines">@@ -119,14 +141,32 @@
</span><span class="cx"> 
</span><span class="cx"> test.run            yes
</span><span class="cx"> test.cmd            tests/runtests.py
</span><del>-test.target         built-in fast
</del><ins>+# args -t0 for no timeout since it cannot be found anyway; or: set depends_build-append port:timeout
+test.target         built-in fast tutorespfn tutorial unitary
+#test.target         built-in fast tutorespfn tutorial unitary v1 v2 v3 v4 v5 v6 v67mbpt v7
</ins><span class="cx"> # wannier90 test will probably fail, version 2.0.x is not supported anyway
</span><span class="cx"> 
</span><ins>+# for +scalapack +atlas -libxc:
+# hang in test [v2][t79].
+# :info:test [tutorial][tspin_6][np=1]: failed: absolute error 2.7e-08 &gt; 2.5e-08
+
+# other config options to add:
+# --enable-mpi-inplace
+# --with-atompaw-libs; --with-atompaw-incs
+
+pre-test {
+    if {[mpi_variant_isset]} {
+        test.target-append paral mpiio tutoparal
+        reinplace &quot;s|mpirun -np|${mpi.exec} -np|&quot; ${worksrcpath}/tests/pymods/jobrunner.py
+        test.args-append -n 1
+    } else {
+        test.target-append seq
+    }
+}
+
</ins><span class="cx"> pre-configure {
</span><span class="cx">     configure.args-append  FCCPP=&quot;${configure.cc} -E -ansi&quot;
</span><span class="cx">     if {[mpi_variant_isset]} {
</span><del>-        configure.args-append  MPI_RUNNER=${mpi.exec}
-        test.env-append        MPIEXEC=${mpi.exec}
</del><span class="cx">         configure.args-append  --enable-mpi=&quot;yes&quot; --enable-mpi-io=&quot;yes&quot;
</span><span class="cx">     } else {
</span><span class="cx">         configure.args-append  --enable-mpi=&quot;no&quot;
</span><span class="lines">@@ -149,8 +189,6 @@
</span><span class="cx"> variant threads description {Build with support for OpenMP threads} {
</span><span class="cx">     configure.args-append   --enable-openmp
</span><span class="cx">     configure.fcflags-append -fopenmp
</span><del>-    configure.args-append   --with-linalg-libs=&quot;-L${prefix}/lib -ltatlas&quot;
-    configure.args-append   --with-linalg-incs=&quot;-I${prefix}/include&quot;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> variant netcdf description {Build with support for NetCDF transferable I/O} {
</span><span class="lines">@@ -178,9 +216,42 @@
</span><span class="cx">     test.target-append      libxc
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#3 possibilities for blas/lapack + ScaLapack
+#-------------------------------------------
+if {![variant_isset accelerate] &amp;&amp; ![variant_isset atlas] &amp;&amp; ![variant_isset openblas]} {
+    default_variants-append +accelerate
+}
+
+variant accelerate conflicts atlas openblas description {Build with linear algebra from built-in Accelerate framework} {
+    depends_lib-append      port:veclibfort
+}
+
+variant atlas conflicts accelerate openblas description {Build with linear algebra from ATLAS} {
+    depends_lib-append      port:atlas
+}
+
+variant openblas conflicts accelerate atlas description {Build with linear algebra from OpenBLAS} {
+    # allow OpenBLAS-devel too
+    depends_lib-append      path:lib/libopenblas.dylib:OpenBLAS
+    require_active_variants path:lib/libopenblas.dylib:OpenBLAS lapack
+}
+
+variant scalapack description {Build with ScaLAPACK for parallel linear algebra} {
+    depends_lib-append      port:scalapack
+
+    if {![mpi_variant_isset]} {
+        ui_error &quot;+scalapack requires an MPI variant. Choose +mpich, +mpich_devel, +openmpi, or +openmpi_devel.&quot;
+        return -code error &quot;+scalapack requires an MPI variant.&quot;
+    }
+    
+    mpi.setup               require
+    mpi.enforce_variant     scalapack
+}
+
</ins><span class="cx"> # abinit does not work with Wannier90 version 2.0.x currently
</span><span class="cx"> #variant wannier90 description {Build with support for Wannier90} {
</span><span class="cx"> #    depends_lib-append      port:wannier90
</span><ins>+#    test.target-append      wannier90 tutoplugs vdwxc
</ins><span class="cx"> #}
</span><span class="cx"> 
</span><span class="cx"> # FIXME: the code's build system will download BigDFT itself, which is contrary to the
</span></span></pre>
</div>
</div>

</body>
</html>