summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauricio Collares <mauricio@collares.org>2021-12-27 22:23:05 -0300
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2021-12-30 16:39:12 +0000
commit4e39259eba52ac311cfdce088f398bcd5b0bf957 (patch)
tree692849bd7c08d2bbf59bffccb82c3677539dc31d
parentgitlab: 14.5.2 -> 14.6.0 (diff)
downloadnixpkgs-origin/backport-152409-to-release-21.11.tar.gz
singular: backport patch to fix docbuilding with >= 64 cpusorigin/backport-152409-to-release-21.11
(cherry picked from commit ec0c4a001f48aea7570bfe96592c418a83964707)
-rw-r--r--pkgs/applications/science/math/singular/default.nix7
-rw-r--r--pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch15
-rw-r--r--pkgs/applications/science/math/singular/vspace-MAX_PROCESS.patch35
3 files changed, 39 insertions, 18 deletions
diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix
index df298aab2114..b543252e8712 100644
--- a/pkgs/applications/science/math/singular/default.nix
+++ b/pkgs/applications/science/math/singular/default.nix
@@ -47,12 +47,13 @@ stdenv.mkDerivation rec {
};
patches = [
+ # fix timeouts when docbuilding with >= 64 cpus
+ # https://github.com/Singular/Singular/issues/1117
+ ./vspace-MAX_PROCESS.patch
+
# add aarch64 support to cpu-check.m4. copied from redhat.
./redhat-aarch64.patch
- # vspace causes hangs in modstd and other libraries on aarch64
- ./disable-vspace-on-aarch64.patch
-
# the newest version of ax-prog-cc-for-build.m4 seems to trigger
# linker errors. see
# https://github.com/alsa-project/alsa-firmware/issues/3 for a
diff --git a/pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch b/pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch
deleted file mode 100644
index 3e51b7fb2cec..000000000000
--- a/pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/kernel/mod2.h b/kernel/mod2.h
-index 867fcae47..2abd84f23 100644
---- a/kernel/mod2.h
-+++ b/kernel/mod2.h
-@@ -60,8 +60,10 @@
-
- /* define for parallel processes with shared memory */
- #ifndef __CCYGWIN__
-+#ifndef SI_CPU_AARCH64
- #define HAVE_VSPACE 1
- #endif
-+#endif
-
- /*#define PROFILING*/
- #ifdef PROFILING
diff --git a/pkgs/applications/science/math/singular/vspace-MAX_PROCESS.patch b/pkgs/applications/science/math/singular/vspace-MAX_PROCESS.patch
new file mode 100644
index 000000000000..78d658f926ee
--- /dev/null
+++ b/pkgs/applications/science/math/singular/vspace-MAX_PROCESS.patch
@@ -0,0 +1,35 @@
+diff --git a/kernel/GBEngine/kChinese.cc b/kernel/GBEngine/kChinese.cc
+index 829a66609..84655caf2 100644
+--- a/kernel/GBEngine/kChinese.cc
++++ b/kernel/GBEngine/kChinese.cc
+@@ -209,6 +209,8 @@ ideal id_ChineseRemainder_0(ideal *xx, number *q, int rl, const ring r)
+ return NULL;
+ }
+ int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
++ if (cpus>=vspace::internals::MAX_PROCESS)
++ cpus=vspace::internals::MAX_PROCESS-1;
+ if ((cpus==1) || (2*cpus>=cnt))
+ /* at least 2 polys for each process, or switch to seriell version */
+ return id_ChineseRemainder(xx,q,rl,r);
+@@ -295,6 +297,8 @@ ideal id_Farey_0(ideal x, number N, const ring r)
+ {
+ int cnt=IDELEMS(x)*x->nrows;
+ int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
++ if (cpus>=vspace::internals::MAX_PROCESS)
++ cpus=vspace::internals::MAX_PROCESS-1;
+ if (2*cpus>=cnt) /* at least 2 polys for each process,
+ or switch to seriell version */
+ return id_Farey(x,N,r);
+diff --git a/kernel/GBEngine/kverify.cc b/kernel/GBEngine/kverify.cc
+index 909d84994..aa06d6624 100644
+--- a/kernel/GBEngine/kverify.cc
++++ b/kernel/GBEngine/kverify.cc
+@@ -176,6 +176,8 @@ BOOLEAN kVerify2(ideal F, ideal Q)
+ /*---------------------------------------------------------------------*/
+ BOOLEAN all_okay=TRUE;
+ int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
++ if (cpus>=vspace::internals::MAX_PROCESS)
++ cpus=vspace::internals::MAX_PROCESS-1;
+ int parent_pid=getpid();
+ using namespace vspace;
+ vmem_init();