singular: import aarch64 support patch

authored by

Mauricio Collares and committed by
Masanori Ogino
aebef170 ceaf48fd

+44 -3
+6 -3
pkgs/applications/science/math/singular/default.nix
··· 1 1 { stdenv, fetchFromGitHub, gmp, bison, perl, ncurses, readline, coreutils, pkg-config 2 2 , lib 3 3 , fetchpatch 4 - , autoreconfHook269 4 + , autoreconfHook 5 5 , sharutils 6 6 , file 7 7 , flint ··· 48 48 fetchSubmodules = true; 49 49 }; 50 50 51 - patches = lib.optionals enableDocs [ 51 + patches = [ 52 + # add aarch64 support to cpu-check.m4. copied from redhat. 53 + ./redhat-aarch64.patch 54 + ] ++ lib.optionals enableDocs [ 52 55 # singular supports building without 4ti2, bertini, normaliz or 53 56 # topcom just fine, but the docbuilding does not skip manual pages 54 57 # tagged as depending on those binaries (probably a bug in ··· 96 99 bison 97 100 perl 98 101 pkg-config 99 - autoreconfHook269 102 + autoreconfHook 100 103 sharutils # needed for regress.cmd install checks 101 104 ] ++ lib.optionals enableDocs [ 102 105 doxygen
+38
pkgs/applications/science/math/singular/redhat-aarch64.patch
··· 1 + diff --git a/m4/cpu-check.m4 b/m4/cpu-check.m4 2 + index 3cf0a7f08..12bb926ac 100644 3 + --- a/m4/cpu-check.m4 4 + +++ b/m4/cpu-check.m4 5 + @@ -37,6 +37,18 @@ if test "$ac_cv_singcpuname" = ppc; then 6 + AC_DEFINE(SI_CPU_PPC,1,"PPC") 7 + AC_SUBST(SI_CPU_PPC) 8 + fi 9 + +if test "$ac_cv_singcpuname" = arm -o "$ac_cv_singcpuname" = armel; then 10 + + AC_DEFINE(SI_CPU_ARM,1,"ARM") 11 + + AC_SUBST(SI_CPU_ARM) 12 + +fi 13 + +if test "$ac_cv_singcpuname" = aarch64; then 14 + + AC_DEFINE(SI_CPU_AARCH64,1,"AARCH64") 15 + + AC_SUBST(SI_CPU_AARCH64) 16 + +fi 17 + +if test "$ac_cv_singcpuname" = s390; then 18 + + AC_DEFINE(SI_CPU_S390,1,"S390") 19 + + AC_SUBST(SI_CPU_S390) 20 + +fi 21 + 22 + # UNAME and PATH 23 + AC_MSG_CHECKING(uname for Singular) 24 + @@ -65,6 +77,14 @@ dnl testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache 25 + [powerpc*|ppc*], [AC_DEFINE(HAVE_GENERIC_MULT,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)], 26 + dnl the following settings seems to be better on arm processors 27 + [arm*], [], 28 + +dnl FIXME: need to run some tests 29 + + [aarch64*], [ 30 + + AC_DEFINE(HAVE_MULT_MOD,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms) 31 + + AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add) 32 + + AC_DEFINE(HAVE_DIV_MOD,1,division using extend euclidian algorithm otherwise using tables of logartihms) 33 + + ], 34 + +dnl FIXME: need to run some tests 35 + + [s390*], [AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add)], 36 + [] 37 + ) 38 +