<!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>[152561] trunk/dports/science/berkeleygw</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/152561">152561</a></dd>
<dt>Author</dt> <dd>dstrubbe@macports.org</dd>
<dt>Date</dt> <dd>2016-09-12 10:31:18 -0700 (Mon, 12 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>berkeleygw: Update to version 1.2.0. FFTW-3 is now used by default; +fftw2 uses FFTW-2. Take advantage of fixes that enable broader cpp usage. Better scalapack compatibility checking. A couple of patches to build system. Use gsed in testsuite. Enable OpenMP threads.</pre>

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

<h3>Added Paths</h3>
<ul>
<li>trunk/dports/science/berkeleygw/files/</li>
<li><a href="#trunkdportsscienceberkeleygwfilespatchCommoncommonrulesmkdiff">trunk/dports/science/berkeleygw/files/patch-Common-common-rules.mk.diff</a></li>
<li><a href="#trunkdportsscienceberkeleygwfilespatchMakefilediff">trunk/dports/science/berkeleygw/files/patch-Makefile.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsscienceberkeleygwPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/science/berkeleygw/Portfile (152560 => 152561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/berkeleygw/Portfile        2016-09-12 17:22:38 UTC (rev 152560)
+++ trunk/dports/science/berkeleygw/Portfile        2016-09-12 17:31:18 UTC (rev 152561)
</span><span class="lines">@@ -6,8 +6,7 @@
</span><span class="cx"> PortGroup           linear_algebra 1.0
</span><span class="cx"> 
</span><span class="cx"> name                berkeleygw
</span><del>-version             1.1-beta2
-revision            1
</del><ins>+version             1.2.0
</ins><span class="cx"> categories          science
</span><span class="cx"> platforms           darwin
</span><span class="cx"> license             BSD
</span><span class="lines">@@ -21,15 +20,17 @@
</span><span class="cx"> homepage            http://www.berkeleygw.org
</span><span class="cx"> master_sites        ${homepage}/releases
</span><span class="cx"> 
</span><del>-checksums           rmd160  7e1ce392da45282ef878ed1a53b34184d96c7ca2 \
-                    sha256  83deea17ccbd50e9e505f69fadf858595793f9b853ec012722659100d5cf8885
</del><ins>+checksums           rmd160  26933a24c10ba03457c667bc5f2d3ca21df2a436 \
+                    sha256  1305dc8587af666fe437bc2561a9106b2b0bcdbe91980b8f1ae7bbd491ce1e25
</ins><span class="cx"> 
</span><span class="cx"> distfiles           BGW-${version}.tar.gz
</span><span class="cx"> # needed for case-sensitive filesystems
</span><span class="cx"> worksrcdir          BerkeleyGW-${version}
</span><span class="cx"> 
</span><del>-depends_lib         port:fftw
-# fftw port always has a Fortran variant
</del><ins>+depends_lib         port:fftw-3
+if {![variant_isset fftw2]} {
+    compilers.enforce_some_fortran  fftw-3
+}
</ins><span class="cx"> 
</span><span class="cx"> # May fail with +mpich +gcc5. Use +mpich +gfortran instead.
</span><span class="cx"> # In file included from /opt/local/include/mpich-gcc5/mpi.h:2231:0,
</span><span class="lines">@@ -38,34 +39,36 @@
</span><span class="cx"> #  #  error 'Please use the same version of GCC and g++ for compiling MPICH and user MPI programs'
</span><span class="cx"> #     ^
</span><span class="cx"> 
</span><del>-# WHAT DO WE DO WHEN meaning of 'gfortran' is updated? No record... Must rename to gfortran5 etc.
</del><ins>+# WHAT DO WE DO WHEN meaning of 'gfortran' is updated? No record... Maybe rename to gfortran5 etc. ?
</ins><span class="cx"> 
</span><span class="cx"> # test hangs in Epsilon with OpenMPI, for unknown reason.
</span><del>-# no appropriate way to set cpp for gcc5, gcc6, or clang
</del><span class="cx"> # dragonegg fails to link with error
</span><span class="cx"> #   Undefined symbols for architecture x86_64:
</span><span class="cx"> #   &quot;_llvm.objectsize.i64&quot;, referenced from:
</span><span class="cx"> #   _spg_get_international in libsymspg.a(spglib.o)
</span><span class="cx"> #   _spg_get_schoenflies in libsymspg.a(spglib.o)
</span><span class="cx"> compilers.choose    fc cc cxx cpp
</span><del>-mpi.setup           require_fortran -dragonegg -openmpi -openmpi_devel
</del><ins>+mpi.setup           require_fortran -dragonegg -openmpi -openmpi_devel -gfortran -clang -llvm
+# FIXME: +gfortran just needs smarter setting of cpp to the one from gcc;
+#clang and llvm only useful with +g95 currently (which is useless)
</ins><span class="cx"> 
</span><span class="cx"> # just for cpp
</span><del>-if {[variant_isset g95] || [variant_isset gcc5] || [variant_isset gcc6] || [variant_isset gfortran]} {
</del><ins>+if {[variant_isset g95]} {
</ins><span class="cx">     depends_build-append  port:llvm-gcc42
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # FIXME: this unnecessarily enforces scalapack also had same C compiler as we are using.
</span><span class="cx"> if {[mpi_variant_isset]} {
</span><span class="cx">     depends_lib-append  port:scalapack
</span><del>-    mpi.enforce_variant     scalapack
</del><ins>+    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;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # fftw is not universal
</span><span class="cx"> universal_variant   no
</span><span class="cx"> 
</span><del>-# FIXME: add options for threads
-
</del><span class="cx"> configure {
</span><span class="cx">     system -W ${worksrcpath} &quot;sed 's|/opt/local|${prefix}|' &lt; config/generic.serial.macos.mk &gt; arch.mk&quot;
</span><span class="cx">     reinplace -W ${worksrcpath} &quot;s|MATHFLAG += -DHDF5||&quot; arch.mk
</span><span class="lines">@@ -74,6 +77,9 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+patchfiles          patch-Common-common-rules.mk.diff \
+                    patch-Makefile.diff
+
</ins><span class="cx"> build.target            all-flavors
</span><span class="cx"> use_parallel_build  yes
</span><span class="cx"> 
</span><span class="lines">@@ -81,16 +87,19 @@
</span><span class="cx"> 
</span><span class="cx"> test.run            yes
</span><span class="cx"> 
</span><del>-# known problems to be fixed: Graphene incorrectly has kernel_k_interpolation.
-# Si2-SAPO/sapo.inp has pointer being freed was not allocated
</del><span class="cx"> 
</span><ins>+#depends_build       port:gsed
</ins><span class="cx"> pre-test {
</span><ins>+    reinplace -W ${worksrcpath}/testsuite &quot;s|sed|gsed|&quot; Graphene/Graphene.test Graphene/Graphene_3D.test \
+        Si-EPM/Si.test Si-EPM/Si_cplx_spin.test
+
</ins><span class="cx">     if {[mpi_variant_isset]} {
</span><del>-        test.args-append    TESTSCRIPT=&quot;MPIEXEC=${prefix}/bin/${mpi.exec} make check-parallel&quot; PARAFLAG=-DMPI
</del><ins>+        test.args-append    TESTSCRIPT=&quot;MPIEXEC=${prefix}/bin/${mpi.exec} make check-parallel&quot;
</ins><span class="cx">         test.target         check-jobscript
</span><span class="cx"> 
</span><ins>+        # FIXME: what about with threads? set OMP_NUM_THREADS=2 and divide ncpus by 2.
</ins><span class="cx">         if {![catch {sysctl hw.ncpu} ncpus]} {
</span><del>-            test.env-append OCT_TEST_NJOBS=$ncpus
</del><ins>+            test.env-append BGW_TEST_MPI_NPROCS=$ncpus
</ins><span class="cx">         }
</span><span class="cx">         ui_msg &quot;Running testsuite in parallel with $ncpus MPI tasks&quot;       
</span><span class="cx">     } else {
</span><span class="lines">@@ -111,19 +120,23 @@
</span><span class="cx">         set mathflag &quot;${mathflag} -DHDF5&quot;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if {[variant_isset fftw3]} {
-        build.args-append  FFTWLIB=&quot;-L${prefix}/lib/ -lfftw3&quot;
</del><ins>+    if {[variant_isset fftw2]} {
+        build.args-append  FFTWLIB=&quot;-L${prefix}/lib/ -ldfftw&quot;
+    } else {
+        if {[variant_isset threads]} {
+            build.args-append  FFTWLIB=&quot;-L${prefix}/lib/ -lfftw3 -lfftw3_threads&quot;
+        } else {
+            build.args-append  FFTWLIB=&quot;-L${prefix}/lib/ -lfftw3&quot;
+        }
</ins><span class="cx">         set mathflag &quot;${mathflag} -DUSEFFTW3&quot;
</span><del>-    } else {
-        build.args-append  FFTWLIB=&quot;-L${prefix}/lib/ -ldfftw&quot;
</del><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if {[variant_isset g95] || [variant_isset gcc5] || [variant_isset gcc6] || [variant_isset gfortran]} {
</del><ins>+    if {[variant_isset g95]} {
</ins><span class="cx">         set configure.cpp     llvm-cpp-4.2
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if {[variant_isset g95]} {
</span><del>-        build.args-append COMPFLAG=&quot;-DG95&quot; FCPP=&quot;${configure.cpp} -P -ansi&quot; \
</del><ins>+        build.args-append COMPFLAG=&quot;-DG95&quot; FCPP=&quot;${configure.cpp} -P -C&quot; \
</ins><span class="cx">                           F90free=&quot;${prefix}/bin/g95 -ffree-form -ffree-line-length-huge -fno-second-underscore&quot; \
</span><span class="cx">                           MOD_OPT=&quot;-fmod=&quot;
</span><span class="cx">         # test, destroot args needed just to avoid trying to build in the test/openmp directory unnecessarily
</span><span class="lines">@@ -131,19 +144,30 @@
</span><span class="cx">         destroot.args-append  COMPFLAG=&quot;-DG95&quot;
</span><span class="cx">     } else {
</span><span class="cx">         # gcc is default in arch.mk so most things do not need to be modified
</span><del>-        build.args-append FCPP=&quot;${configure.cpp} -ansi&quot; \
</del><ins>+        build.args-append FCPP=&quot;${configure.cpp} -C&quot; \
</ins><span class="cx">             F90free=&quot;${configure.fc} -ffree-form -ffree-line-length-none -fno-second-underscore&quot;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if {[variant_isset threads]} {
+        set paraflag &quot;-DOMP&quot;
+    } else {
+        set paraflag &quot;&quot;
+    }
+    
</ins><span class="cx">     if {[mpi_variant_isset]} {
</span><span class="cx">         set mathflag &quot;${mathflag} -DUSESCALAPACK&quot;
</span><del>-        build.args-append PARAFLAG=&quot;-DMPI&quot; C_PARAFLAG=&quot;-DPARA&quot; SCALAPACKLIB=&quot;-L${prefix}/lib/ -lscalapack&quot;
</del><ins>+        set paraflag &quot;${paraflag} -DMPI&quot;
+        build.args-append C_PARAFLAG=&quot;-DPARA&quot; SCALAPACKLIB=&quot;-L${prefix}/lib/ -lscalapack&quot;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    build.args-append   MATHFLAG=&quot;${mathflag}&quot;
-    test.args-append    MATHFLAG=&quot;${mathflag}&quot;
</del><ins>+    build.args-append   MATHFLAG=&quot;${mathflag}&quot; PARAFLAG=&quot;${paraflag}&quot;
+    test.args-append    MATHFLAG=&quot;${mathflag}&quot; PARAFLAG=&quot;${paraflag}&quot;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+variant threads description {Build with OpenMP support} conflicts g95 {
+    set configure.fc &quot;${configure.fc} -fopenmp&quot;
+}
+
</ins><span class="cx"> variant debug description {Add debug flags for more checking and output, but slower runs.} {
</span><span class="cx">     build.args-append    DEBUGFLAG=&quot;-DDEBUG -DVERBOSE&quot;
</span><span class="cx"> }
</span><span class="lines">@@ -154,9 +178,9 @@
</span><span class="cx">     compilers.enforce_fortran   hdf5
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-variant fftw3 description {Build with FFTW-3 rather than FFTW-2 for better performance} {
-    depends_lib-replace         port:fftw port:fftw-3
-    compilers.enforce_some_fortran  fftw-3
</del><ins>+variant fftw2 description {Build with FFTW-2} {
+    depends_lib-replace        port:fftw-3 port:fftw
+    # fftw port always has a Fortran variant
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> livecheck.type      none
</span></span></pre></div>
<a id="trunkdportsscienceberkeleygwfilespatchCommoncommonrulesmkdiff"></a>
<div class="addfile"><h4>Added: trunk/dports/science/berkeleygw/files/patch-Common-common-rules.mk.diff (0 => 152561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/berkeleygw/files/patch-Common-common-rules.mk.diff                                (rev 0)
+++ trunk/dports/science/berkeleygw/files/patch-Common-common-rules.mk.diff        2016-09-12 17:31:18 UTC (rev 152561)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+--- Common/common-rules.mk.orig        2016-09-09 10:35:06.000000000 -0700
++++ Common/common-rules.mk        2016-09-09 10:35:16.000000000 -0700
+@@ -333,4 +333,5 @@
+ clean-keepmod clean-keepmod-common \
+ clean-keepmod-utilities clean-cpp clean-wfnutils \
+ qhull clean-qhull cleanall-qhull clean-keepmod-qhull \
+-abi2bgw clean-abi2bgw cleanall-abi2bgw clean-keepmod-abi2bgw
++abi2bgw clean-abi2bgw cleanall-abi2bgw clean-keepmod-abi2bgw \
++sapo epm icm utilities
</ins></span></pre></div>
<a id="trunkdportsscienceberkeleygwfilespatchMakefilediff"></a>
<div class="addfile"><h4>Added: trunk/dports/science/berkeleygw/files/patch-Makefile.diff (0 => 152561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/berkeleygw/files/patch-Makefile.diff                                (rev 0)
+++ trunk/dports/science/berkeleygw/files/patch-Makefile.diff        2016-09-12 17:31:18 UTC (rev 152561)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+--- Makefile.orig        2016-09-09 18:09:20.000000000 -0400
++++ Makefile        2016-09-09 18:09:31.000000000 -0400
+@@ -106,7 +106,7 @@
+ manual: printsvninfo
+         bin/assemble_manual.sh &gt; manual.html

+-install: all-flavors
++install: all
+ ifdef INSTDIR
+         mkdir -p $(INSTDIR)/bin
+         install bin/*.x $(INSTDIR)/bin/
</ins></span></pre>
</div>
</div>

</body>
</html>