Skip to content

Commit

Permalink
*/*: rebuild with numpy 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
z-erica authored and nekopsykose committed Jun 26, 2024
1 parent d98262d commit 05a57f9
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 24 deletions.
2 changes: 1 addition & 1 deletion contrib/blender/template.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgname = "blender"
pkgver = "4.1.1"
pkgrel = 5
pkgrel = 6
build_style = "cmake"
configure_args = [
"-DCMAKE_BUILD_TYPE=Release",
Expand Down
2 changes: 1 addition & 1 deletion contrib/opencv/template.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgname = "opencv"
pkgver = "4.10.0"
pkgrel = 2
pkgrel = 3
build_style = "cmake"
configure_args = [
# rm NDEBUG
Expand Down
28 changes: 9 additions & 19 deletions contrib/python-fasttext/patches/no-march-native.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
diff -Nurp a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2020-04-28 09:40:33.000000000 +0000
+++ b/CMakeLists.txt 2024-01-16 08:21:47.854147584 +0000
@@ -15,7 +15,7 @@ include_directories(fasttext)

include_directories(fasttext)

-set(CMAKE_CXX_FLAGS " -pthread -std=c++11 -funroll-loops -O3 -march=native")
+set(CMAKE_CXX_FLAGS "-std=c++11")

set(HEADER_FILES
src/args.h
diff -Nurp a/setup.py b/setup.py
--- a/setup.py 2020-04-28 09:40:33.000000000 +0000
+++ b/setup.py 2024-01-16 08:22:44.057845517 +0000
@@ -75,8 +75,6 @@ ext_modules = [
--- a/setup.py
+++ b/setup.py
@@ -79,11 +81,6 @@
FASTTEXT_SRC,
],
language='c++',
- extra_compile_args=["-O0 -fno-inline -fprofile-arcs -pthread -march=native" if coverage else
- "-O3 -funroll-loops -pthread -march=native"],
language="c++",
- extra_compile_args=[
- "-O0 -fno-inline -fprofile-arcs -pthread -march=native"
- if coverage
- else "-O3 -funroll-loops -pthread -march=native"
- ],
),
]

20 changes: 20 additions & 0 deletions contrib/python-fasttext/patches/numpy-2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/python/fasttext_module/fasttext/FastText.py
+++ b/python/fasttext_module/fasttext/FastText.py
@@ -38,7 +38,7 @@
else:
y_scores, y_true = ([], ())

- return np.array(y_scores, copy=False), np.array(y_true, copy=False)
+ return np.asarray(y_scores), np.asarray(y_true)

def precision_recall_curve(self, label=None):
"""Return precision/recall curve"""
@@ -53,7 +53,7 @@
else:
precision, recall = ([], ())

- return np.array(precision, copy=False), np.array(recall, copy=False)
+ return np.asarray(precision), np.asarray(recall)

def precision_at_recall(self, recall, label=None):
"""Return precision for a given recall"""
6 changes: 3 additions & 3 deletions contrib/python-fasttext/template.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pkgname = "python-fasttext"
pkgver = "0.9.2"
pkgver = "0.9.3"
pkgrel = 0
build_style = "python_pep517"
hostmakedepends = [
Expand All @@ -17,8 +17,8 @@
maintainer = "Duncan Bellamy <dunk@denkimushi.com>"
license = "MIT"
url = "https://fasttext.cc/index.html"
source = f"https://github.com/facebookresearch/fasttext/archive/refs/tags/v{pkgver}.tar.gz"
sha256 = "7ea4edcdb64bfc6faaaec193ef181bdc108ee62bb6a04e48b2e80b639a99e27e"
source = f"$(PYPI_SITE)/f/fasttext/fasttext-{pkgver}.tar.gz"
sha256 = "eb03f2ef6340c6ac9e4398a30026f05471da99381b307aafe2f56e4cd26baaef"
# Tests require 300+MB test data downloaded with a script
options = ["!check"]

Expand Down

0 comments on commit 05a57f9

Please sign in to comment.