[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#894574: Please add support for riscv64 architecture



Package: python-numpy
Version: 1:1.13.3-2
Severity: wishlist
Tags: patch upstream
User: debian-riscv@lists.debian.org
Usertags: riscv64

Hi,

We are in the process of bootstrapping a Debian port for the
riscv64 architecture (https://wiki.debian.org/RISC-V). It happens that
python-numpy needs a patch to support this architecture, which has just
been merged upstream:

  https://github.com/numpy/numpy/commit/718d9e866b8f49a6898d267ed45306c08410e86c

The patch doesn't apply cleanly on the version 1.13.3 which is in
Debian, so I have backported the patch. You'll find it attached.

Would it be possible to include it in the next upload?

Thanks,
Aurelien

-- System Information:
Debian Release: buster/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: riscv64

Kernel: Linux 4.15.0_riscv-linux-4.15_2b0aa1de4+ (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
--- a/numpy/core/include/numpy/npy_cpu.h
+++ b/numpy/core/include/numpy/npy_cpu.h
@@ -15,6 +15,7 @@
  *              NPY_CPU_ARMEB
  *              NPY_CPU_SH_LE
  *              NPY_CPU_SH_BE
+ *              NPY_CPU_RISCV64
  */
 #ifndef _NPY_CPUARCH_H_
 #define _NPY_CPUARCH_H_
@@ -76,6 +77,8 @@
     #define NPY_CPU_AARCH64
 #elif defined(__mc68000__)
     #define NPY_CPU_M68K
+#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
+    #define NPY_CPU_RISCV64
 #else
     #error Unknown CPU, please report this to numpy maintainers with \
     information about your platform (OS, CPU and compiler)
--- a/numpy/core/include/numpy/npy_endian.h
+++ b/numpy/core/include/numpy/npy_endian.h
@@ -45,7 +45,8 @@
             || defined(NPY_CPU_AARCH64) \
             || defined(NPY_CPU_SH_LE)   \
             || defined(NPY_CPU_MIPSEL)  \
-            || defined(NPY_CPU_PPC64LE)
+            || defined(NPY_CPU_PPC64LE) \
+            || defined(NPY_CPU_RISCV64)
         #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
     #elif defined(NPY_CPU_PPC)          \
             || defined(NPY_CPU_SPARC)   \

Reply to: