Package Details: fasttext 0.9.2-4

Git Clone URL: https://aur.archlinux.org/fasttext.git (read-only, click to copy)
Package Base: fasttext
Description: Library for fast text representation and classification
Upstream URL: https://github.com/facebookresearch/fastText
Licenses: MIT
Submitter: peippo
Maintainer: peippo
Last Packager: peippo
Votes: 3
Popularity: 0.113293
First Submitted: 2018-10-29 08:54 (UTC)
Last Updated: 2024-07-01 09:17 (UTC)

Dependencies (1)

Required by (2)

Sources (2)

Latest Comments

peippo commented on 2024-07-01 09:17 (UTC)

Thanks @Blubberbub, this is a fantastic contribution!

Blubberbub commented on 2024-07-01 06:55 (UTC)

Compiling gcc12 myself for hours, when the fix to make it compile with current gcc is a single line change feels not worth it to me. Could you fix the package?

Something like this:

diff --git a/.SRCINFO b/.SRCINFO
index b47459d..9e398fb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -5,8 +5,7 @@ pkgbase = fasttext
    url = https://github.com/facebookresearch/fastText
    arch = x86_64
    license = BSD
-   makedepends = gcc12
-   depends = gcc12-libs
+   depends = gcc-libs
    optdepends = fasttext-langid-models
    source = fasttext-0.9.2.tar.gz::https://github.com/facebookresearch/fastText/archive/v0.9.2.tar.gz
    sha256sums = 7ea4edcdb64bfc6faaaec193ef181bdc108ee62bb6a04e48b2e80b639a99e27e
diff --git a/PKGBUILD b/PKGBUILD
index 4541677..0b8c7b5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,13 +11,12 @@ arch=('x86_64')
 license=('BSD')

 depends=(
-    "gcc12-libs"
+    "gcc-libs"
 )
 optdepends=(
     "fasttext-langid-models"
 )
 makedepends=(
-    "gcc12"
 )

 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/facebookresearch/fastText/archive/v${pkgver}.tar.gz")
@@ -25,7 +24,8 @@ sha256sums=("7ea4edcdb64bfc6faaaec193ef181bdc108ee62bb6a04e48b2e80b639a99e27e")

 build() {
     cd "${srcdir}/fastText-${pkgver}"
-    make CXX=g++-12
+    patch --strip=1 < ../../patch_cstdint_include.patch
+    make
 }

 package() {
diff --git a/patch_cstdint_include.patch b/patch_cstdint_include.patch
new file mode 100644
index 0000000..916539e
--- /dev/null
+++ b/patch_cstdint_include.patch
@@ -0,0 +1,11 @@
+diff --color --unified --recursive --text fastText-0.9.2.old/src/args.cc fastText-0.9.2.new/src/args.cc
+--- fastText-0.9.2.old/src/args.cc 2024-06-06 16:24:57.734700026 +0200
++++ fastText-0.9.2.new/src/args.cc 2024-06-06 16:25:45.338492231 +0200
+@@ -10,6 +10,7 @@
+
+ #include <stdlib.h>
+
++#include <cstdint>
+ #include <iostream>
+ #include <stdexcept>
+ #include <string>

peippo commented on 2023-12-05 08:19 (UTC)

Thanks @xuiqzy for spotting this, I pushed a new PKGBUILD

xuiqzy commented on 2023-12-05 00:10 (UTC)

This seems to be the error: https://github.com/facebookresearch/fastText/issues/1281 Fix in comment there, make depend on gcc12 and overwrite which compiler is used when building.

xuiqzy commented on 2023-12-05 00:04 (UTC)

Failure in build, even in chroot:

==> Starting build()...
c++ -pthread -std=c++11 -march=native -O3 -funroll-loops -DNDEBUG -c src/args.cc
c++ -pthread -std=c++11 -march=native -O3 -funroll-loops -DNDEBUG -c src/autotune.cc
c++ -pthread -std=c++11 -march=native -O3 -funroll-loops -DNDEBUG -c src/matrix.cc
c++ -pthread -std=c++11 -march=native -O3 -funroll-loops -DNDEBUG -c src/dictionary.cc
c++ -pthread -std=c++11 -march=native -O3 -funroll-loops -DNDEBUG -c src/loss.cc
c++ -pthread -std=c++11 -march=native -O3 -funroll-loops -DNDEBUG -c src/productquantizer.cc
c++ -pthread -std=c++11 -march=native -O3 -funroll-loops -DNDEBUG -c src/densematrix.cc
c++ -pthread -std=c++11 -march=native -O3 -funroll-loops -DNDEBUG -c src/quantmatrix.cc
c++ -pthread -std=c++11 -march=native -O3 -funroll-loops -DNDEBUG -c src/vector.cc
src/args.cc: In member function ‘int64_t fasttext::Args::getAutotuneModelSize() const’:
src/args.cc:468:3: error: ‘uint64_t’ was not declared in this scope
  468 |   uint64_t multiplier = 1;
      |   ^~~~~~~~
src/args.cc:17:1: note: ‘uint64_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   16 | #include <unordered_map>
  +++ |+#include <cstdint>
   17 | 
src/args.cc:471:5: error: ‘multiplier’ was not declared in this scope
  471 |     multiplier = units[lastCharacter];
      |     ^~~~~~~~~~
src/args.cc:474:11: error: expected ‘;’ before ‘size’
  474 |   uint64_t size = 0;
      |           ^~~~~
      |           ;
src/args.cc:478:5: error: ‘size’ was not declared in this scope
  478 |     size = std::stol(modelSize, &nonNumericCharacter);
      |     ^~~~
src/args.cc:490:10: error: ‘size’ was not declared in this scope
  490 |   return size * multiplier;
      |          ^~~~
src/args.cc:490:17: error: ‘multiplier’ was not declared in this scope
  490 |   return size * multiplier;
      |                 ^~~~~~~~~~
make: *** [Makefile:30: args.o] Error 1
make: *** Waiting for unfinished jobs....
==> ERROR: A failure occurred in build().
    Aborting...


xuiqzy commented on 2023-12-05 00:01 (UTC)

Could (opt) depend on fasttext-langid-models and fasttext-langid-models could (opt) depend on this (fasttext) package to make it easier to install and use both together.

peippo commented on 2022-10-19 05:12 (UTC) (edited on 2022-10-19 05:12 (UTC) by peippo)

@binarynoise : both of them are part of base-devel, which is expected to be installed in any PKGBUILD.

binarynoise commented on 2022-10-18 20:44 (UTC)

This package lacks makedeps on make and binutils. Without building fails.