[113546] trunk/dports/textproc/eda

hum at macports.org hum at macports.org
Tue Nov 19 07:12:41 PST 2013


Revision: 113546
          https://trac.macports.org/changeset/113546
Author:   hum at macports.org
Date:     2013-11-19 07:12:41 -0800 (Tue, 19 Nov 2013)
Log Message:
-----------
eda: update to 0.3.2; add patch-LBFGS.hpp.diff to build with clang++ and delete compiler.blacklist; add model variant to install a standard model file.

Modified Paths:
--------------
    trunk/dports/textproc/eda/Portfile
    trunk/dports/textproc/eda/files/eda_demo

Added Paths:
-----------
    trunk/dports/textproc/eda/files/patch-LBFGS.hpp.diff

Modified: trunk/dports/textproc/eda/Portfile
===================================================================
--- trunk/dports/textproc/eda/Portfile	2013-11-19 14:54:40 UTC (rev 113545)
+++ trunk/dports/textproc/eda/Portfile	2013-11-19 15:12:41 UTC (rev 113546)
@@ -4,75 +4,75 @@
 PortSystem          1.0
 
 name                eda
-version             0.2.0
+version             0.3.2
 categories          textproc japanese
 maintainers         hum openmaintainer
 
 description         a word-based dependency parser written in C++
-long_description    EDA is ${description}.
+long_description    EDA is ${description}. \
+                    The name EDA stands for Easily adaptable Dependency Analyzer.
 
 homepage            http://plata.ar.media.kyoto-u.ac.jp/tool/EDA/
 platforms           darwin
 license             BSD
 
 master_sites        ${homepage}downloads/
-checksums           rmd160  1a08c2d30aba0afafd83605c8731578f60ecb702 \
-                    sha256  7bc24b45beaabdabe0fc4165db935fba56bef5b7de8f4de846d058fc1561919c
+checksums           ${distname}${extract.suffix} \
+                    rmd160  7f3c23d8c08543af1917baf5640c7ce58bd14a69 \
+                    sha256  daebcb2e46668df127d35be4254a8e1687035c42a533feb2f377d56029d0bbfb
 
+patchfiles          patch-LBFGS.hpp.diff
+
 installs_libs       no
 
-depends_lib         port:boost \
-                    port:zlib
-
 depends_run         port:kytea
 
 use_configure       no
 
 variant universal   {}
 
-# Project bugs prevent building with clang
-compiler.blacklist  *clang*
-
+set cflags          "${configure.cflags} [get_canonical_archflags]"
 set cxxflags        "${configure.cxxflags} [get_canonical_archflags cxx]"
-set cppflags        "-I../lib/soplib ${configure.cppflags}"
-set ldflags         "${configure.ldflags} -lz"
-build.args          CXX="${configure.cxx}" \
-                    CXXFLAGS="${cxxflags} ${cppflags} ${ldflags}"
+build.args          CC="${configure.cc}" CFLAGS="${cflags}" \
+                    CXX="${configure.cxx}" CXXFLAGS="${cxxflags}"
 
 destroot {
     # install binaries.
-    xinstall -m 755 -W ${worksrcpath}/src/eda \
-        eda train-eda \
+    xinstall -m 755 -W ${worksrcpath} eda train-eda \
         ${destroot}${prefix}/bin
-    # install a demo script.
-    xinstall -m 755 ${filespath}/eda_demo ${destroot}${prefix}/bin
-    reinplace "s|@prefix@|${prefix}|g" ${destroot}${prefix}/bin/eda_demo
-    # install models.
-    set models_dir ${destroot}${prefix}/lib/${name}/models
-    xinstall -d ${models_dir}
-    xinstall -m 644 -W ${worksrcpath}/data \
-        jp-0.1.0-utf8-vocab-small.dat  \
-        jp-0.1.0-utf8-weight-small.dat \
-        ${models_dir}
     # install additional documents.
-    set doc_dir ${destroot}${prefix}/share/doc/${name}
-    xinstall -d ${doc_dir}
+    set dest_doc ${destroot}${prefix}/share/doc/${name}
+    xinstall -d ${dest_doc}
+    xinstall -m 644 -W ${worksrcpath} README \
+        ${dest_doc}
+    # install sample data.
+    set dest_ex ${destroot}${prefix}/share/examples/${name}
+    xinstall -d ${dest_ex}
     xinstall -m 644 -W ${worksrcpath} \
-        COPYING README \
-        ${doc_dir}
-    # install scripts.
-    set scripts_dir ${destroot}${prefix}/share/${name}/scripts
-    xinstall -d ${scripts_dir}
-    xinstall -m 755 -W ${worksrcpath} \
-        eval.pl \
-        ${scripts_dir}
-    # install sample data.
-    set sample_dir ${destroot}${prefix}/share/${name}/sample
-    xinstall -d ${sample_dir}
-    xinstall -m 644 -W ${worksrcpath}/data \
-        sample.tree sample.txt sample_test.tree \
-        ${sample_dir}
+        sample.eda sample.eda_ne sample.kytea \
+        ${dest_ex}
 }
 
+default_variants    +model
+
+set model_file      bccwj-20130906.etm
+
+variant model description {Add model} {
+    distfiles-append   ${model_file}
+    checksums-append   ${model_file} \
+        rmd160  73a31ef68615df9fd5d167c4f01a591cfb663bc7 \
+        sha256  c665c79ca264f59de15edb0fbb96103e6655a8a9fee826068341bdfc768d7ce5
+
+    post-destroot {
+        # install models.
+        set dest_models ${destroot}${prefix}/lib/${name}/models
+        xinstall -d ${dest_models}
+        xinstall -m 644 -W ${distpath} ${model_file} ${dest_models}
+        # install a demo script.
+        xinstall -m 755 ${filespath}/eda_demo ${destroot}${prefix}/bin
+        reinplace "s|@prefix@|${prefix}|g" ${destroot}${prefix}/bin/eda_demo
+    }
+}
+
 livecheck.type      regex
 livecheck.regex     ${name}-(\[0-9.\]+)\\.

Modified: trunk/dports/textproc/eda/files/eda_demo
===================================================================
--- trunk/dports/textproc/eda/files/eda_demo	2013-11-19 14:54:40 UTC (rev 113545)
+++ trunk/dports/textproc/eda/files/eda_demo	2013-11-19 15:12:41 UTC (rev 113546)
@@ -1,2 +1,2 @@
 #!/bin/sh
- at prefix@/bin/kytea "$@" | @prefix@/bin/eda -v @prefix@/lib/eda/models/jp-0.1.0-utf8-vocab-small.dat -w @prefix@/lib/eda/models/jp-0.1.0-utf8-weight-small.dat
+ at prefix@/bin/kytea | @prefix@/bin/eda -m @prefix@/lib/eda/models/bccwj-20130906.etm -i kytea "$@"

Added: trunk/dports/textproc/eda/files/patch-LBFGS.hpp.diff
===================================================================
--- trunk/dports/textproc/eda/files/patch-LBFGS.hpp.diff	                        (rev 0)
+++ trunk/dports/textproc/eda/files/patch-LBFGS.hpp.diff	2013-11-19 15:12:41 UTC (rev 113546)
@@ -0,0 +1,69 @@
+--- LBFGS.hpp.ori	2013-10-14 21:08:23.000000000 +0900
++++ LBFGS.hpp	2013-11-18 21:33:34.000000000 +0900
+@@ -19,11 +19,6 @@
+ class LBFGS {
+ public:
+   static const unsigned int DEFAULT_NUM_VECTORS = 7;
+-  static const RealNumber LINE_SEARCH_ALPHA = 0.1;
+-  static const RealNumber LINE_SEARCH_BETA  = 0.5;
+-  static const RealNumber MIN_GRAD_NORM = 0.0001;
+-  static const RealNumber MIN_FUNC_DIFF = 0.000001;
+-
+   static const unsigned int MAX_LINE_SEARCH_ITERATIONS = 100;
+ 
+ protected:
+@@ -55,19 +50,23 @@
+   backtracking_line_search(const MathVec<RealNumber> & grad0, const RealNumber f0, 
+                            MathVec<RealNumber> & dx, MathVec<RealNumber> & grad1)
+   {
+-    RealNumber t = 1.0 / this->LINE_SEARCH_BETA;
++    const RealNumber LINE_SEARCH_ALPHA = 0.1;
++    const RealNumber LINE_SEARCH_BETA  = 0.5;
++    const RealNumber MIN_FUNC_DIFF = 0.000001;
++
++    RealNumber t = 1.0 / LINE_SEARCH_BETA;
+     RealNumber old_t = 0.0;
+-    RealNumber tolerance = this->LINE_SEARCH_ALPHA * dot_product(dx, grad0);
++    RealNumber tolerance = LINE_SEARCH_ALPHA * dot_product(dx, grad0);
+ 
+     RealNumber f = 0.0;
+     unsigned int i = 0;
+     do {
+-      if (++i > this->MAX_LINE_SEARCH_ITERATIONS) {
++      if (++i > MAX_LINE_SEARCH_ITERATIONS) {
+         cerr << "Warning: line search not terminated" << endl;
+         is_converged = true;
+         break;
+       }
+-      t *= this->LINE_SEARCH_BETA;
++      t *= LINE_SEARCH_BETA;
+       //if(t==0) cerr << " looping infinitely " << endl;
+       //cerr << "line search: " << t << endl;
+       //x = x0 + t * dx;
+@@ -82,7 +81,7 @@
+     dx *= t;
+ 
+     // check convergence
+-    if (fabs(1.0 - fabs(f / f0)) < this->MIN_FUNC_DIFF) {
++    if (fabs(1.0 - fabs(f / f0)) < MIN_FUNC_DIFF) {
+       is_converged = true;
+     }
+ 
+@@ -145,6 +144,8 @@
+   }
+ 
+   virtual void iteration() {
++    const RealNumber MIN_GRAD_NORM = 0.0001;
++
+     if(is_beginning) {
+       //cerr << "beginning" << endl;
+       f = func_grad(x.STLVec(), grad.STLVec());
+@@ -153,7 +154,7 @@
+     //cerr << "iteration " << iter << ": obj = " << f << endl;
+     //cerr << "|grad|=" << sqrt(dot_product(grad, grad)) << endl;
+     grad_norm = sqrt(dot_product(grad, grad));
+-    if (grad_norm < this->MIN_GRAD_NORM) {
++    if (grad_norm < MIN_GRAD_NORM) {
+         is_converged = true;
+         return;
+     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20131119/12d6afed/attachment-0001.html>


More information about the macports-changes mailing list