<pre style='margin:0'>
Ryan Schmidt (ryandesign) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/6c99b08220ed2d2054a64393fa124d00c84a59a7">https://github.com/macports/macports-ports/commit/6c99b08220ed2d2054a64393fa124d00c84a59a7</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 6c99b08220e word2vec: Update to 20170716
</span>6c99b08220e is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 6c99b08220ed2d2054a64393fa124d00c84a59a7
</span>Author: Ryan Schmidt <ryandesign@macports.org>
AuthorDate: Mon Jun 29 10:44:54 2020 -0500
<span style='display:block; white-space:pre;color:#404040;'> word2vec: Update to 20170716
</span>---
textproc/word2vec/Portfile | 22 ++++-----
.../files/fgetc_unlocked-fputc_unlocked.patch | 52 ++++++++++++++++++++++
.../word2vec/files/patch-compute-accuracy.c.diff | 6 +--
textproc/word2vec/files/patch-demo.diff | 1 +
textproc/word2vec/files/patch-malloc.diff | 33 --------------
textproc/word2vec/files/prevent-early-exit.patch | 14 ++++++
6 files changed, 79 insertions(+), 49 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/textproc/word2vec/Portfile b/textproc/word2vec/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 801b5ca15f3..76e85fc9fd9 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/textproc/word2vec/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/textproc/word2vec/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3,15 +3,12 @@
</span> PortSystem 1.0
PortGroup github 1.0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-github.setup tmikolov word2vec d83ccfba4dd08f113d5e75d67c9f6cd30f6532c4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-version 20150131
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+github.setup tmikolov word2vec 20c129af10659f7c50e86e3be406df663beff438
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+version 20170716
</span> revision 0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-checksums rmd160 07cc774a7b4141f86dab449fef83554cfbc1d6f7 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 48ef7b400f4c1040a314f23901cccb864055d985ac208d5ea5ca22b7f80ad9c8 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size 104573
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Newer versions do not build on macOS:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# https://github.com/tmikolov/word2vec/issues/48
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums rmd160 de98886c52303242566eacd5a3eaf4459026bd71 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 e546d2c1213ca55fd2291a638139ef2730c3f0b737b2aa42dd98e25936a226c0 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 104875
</span>
categories textproc
maintainers nomaintainer
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -30,13 +27,15 @@ github.tarball_from archive
</span>
depends_run port:wget
<span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles patch-malloc.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles fgetc_unlocked-fputc_unlocked.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ prevent-early-exit.patch \
</span> patch-compute-accuracy.c.diff \
patch-demo.diff
use_configure no
variant universal {}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# This is what the makefile uses.
</span> configure.optflags -O3
build.args CC="${configure.cc}" \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -55,10 +54,7 @@ destroot {
</span> xinstall -m 0644 -W ${worksrcpath} \
questions-phrases.txt questions-words.txt \
${destroot}${exdir}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # fix demo scripts.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach f [glob ${destroot}${execdir}/demo-*.sh] {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- reinplace "s|@EXECDIR@|${execdir}|g" ${f}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|@EXECDIR@|${execdir}|g" {*}[glob ${destroot}${execdir}/demo-*.sh]
</span> set docdir ${prefix}/share/doc/${name}
xinstall -d ${destroot}${docdir}
xinstall -m 0644 -W ${worksrcpath} \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/textproc/word2vec/files/fgetc_unlocked-fputc_unlocked.patch b/textproc/word2vec/files/fgetc_unlocked-fputc_unlocked.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..57446be2ded
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/textproc/word2vec/files/fgetc_unlocked-fputc_unlocked.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,52 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Fix build on Darwin by replacing GNU-specific fgetc_unlocked with
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+getc_unlocked and fputc_unlocked with putc_unlocked.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/tmikolov/word2vec/issues/48
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/tmikolov/word2vec/pull/40
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- word2phrase.c.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ word2phrase.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -42,7 +42,7 @@ unsigned long long next_random = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void ReadWord(char *word, FILE *fin, char *eof) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int a = 0, ch;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ while (1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ch = fgetc_unlocked(fin);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ch = getc_unlocked(fin);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (ch == EOF) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *eof = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -246,7 +246,7 @@ void TrainModel() {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (eof) break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (word[0] == '\n') {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ //fprintf(fo, "\n");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- fputc_unlocked('\n', fo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ putc_unlocked('\n', fo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cn++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -286,12 +286,12 @@ void TrainModel() {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ next_random = next_random * (unsigned long long)25214903917 + 11;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ //if (next_random & 0x10000) score = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (score > threshold) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- fputc_unlocked('_', fo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ putc_unlocked('_', fo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pb = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else fputc_unlocked(' ', fo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else putc_unlocked(' ', fo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ a = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ while (word[a]) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- fputc_unlocked(word[a], fo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ putc_unlocked(word[a], fo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ a++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pa = pb;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- word2vec.c.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ word2vec.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -71,7 +71,7 @@ void InitUnigramTable() {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void ReadWord(char *word, FILE *fin, char *eof) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int a = 0, ch;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ while (1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ch = fgetc_unlocked(fin);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ch = getc_unlocked(fin);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (ch == EOF) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *eof = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/textproc/word2vec/files/patch-compute-accuracy.c.diff b/textproc/word2vec/files/patch-compute-accuracy.c.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index a8996dce086..8a46c5b4953 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/textproc/word2vec/files/patch-compute-accuracy.c.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/textproc/word2vec/files/patch-compute-accuracy.c.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,8 +1,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- compute-accuracy.c.orig 2014-02-23 20:29:23.000000000 +0900
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ compute-accuracy.c 2014-02-23 20:30:44.000000000 +0900
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- compute-accuracy.c.orig 2017-07-16 17:46:08.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ compute-accuracy.c 2020-06-29 10:24:43.000000000 -0500
</span> @@ -28,7 +28,8 @@
FILE *f;
<span style='display:block; white-space:pre;background:#ffe0e0;'>- char st1[max_size], st2[max_size], st3[max_size], st4[max_size], bestw[N][max_size], file_name[max_size], ch;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char st1[max_size], st2[max_size], st3[max_size], st4[max_size], bestw[N][max_size], file_name[max_size];
</span> float dist, len, bestd[N], vec[max_size];
- long long words, size, a, b, c, d, b1, b2, b3, threshold = 0;
+ long long words, size, b, c, d, b1, b2, b3, threshold = 0;
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/textproc/word2vec/files/patch-demo.diff b/textproc/word2vec/files/patch-demo.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index f110dae50a5..5a76b7e7ae7 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/textproc/word2vec/files/patch-demo.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/textproc/word2vec/files/patch-demo.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,3 +1,4 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Adjust demo paths so they work regardless of the current working directory.
</span> --- demo-analogy.sh.orig 2014-09-07 01:54:27.000000000 +0900
+++ demo-analogy.sh 2014-12-24 22:55:24.000000000 +0900
@@ -7,5 +7,5 @@
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/textproc/word2vec/files/patch-malloc.diff b/textproc/word2vec/files/patch-malloc.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 9576dc12887..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/textproc/word2vec/files/patch-malloc.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,33 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- compute-accuracy.c.orig 2014-02-22 19:15:25.000000000 +0900
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ compute-accuracy.c 2014-02-22 19:17:40.000000000 +0900
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -16,7 +16,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <stdlib.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <string.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <math.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#include <malloc.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <stdlib.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <ctype.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const long long max_size = 2000; // max length of strings
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- distance.c.orig 2014-02-22 19:15:32.000000000 +0900
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ distance.c 2014-02-22 19:16:29.000000000 +0900
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -15,7 +15,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <stdio.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <string.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <math.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#include <malloc.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <stdlib.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const long long max_size = 2000; // max length of strings
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const long long N = 40; // number of closest words that will be shown
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- word-analogy.c.orig 2014-02-22 19:15:49.000000000 +0900
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ word-analogy.c 2014-02-22 19:17:27.000000000 +0900
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -15,7 +15,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <stdio.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <string.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include <math.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#include <malloc.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#include <stdlib.h>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const long long max_size = 2000; // max length of strings
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const long long N = 40; // number of closest words that will be shown
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/textproc/word2vec/files/prevent-early-exit.patch b/textproc/word2vec/files/prevent-early-exit.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..132f2a91d74
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/textproc/word2vec/files/prevent-early-exit.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,14 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Prevent last thread from exiting early on multiple iterations.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/tmikolov/word2vec/issues/47
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/tmikolov/word2vec/pull/39
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- word2vec.c.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ word2vec.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -424,6 +424,7 @@ void *TrainModelThread(void *id) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ last_word_count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sentence_length = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fseek(fi, file_size / (long long)num_threads * (long long)id, SEEK_SET);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ eof = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ word = sen[sentence_position];
</span></pre><pre style='margin:0'>
</pre>