I have been trying to run a Python program on a system with RISC-V architecture. The program involves runs a simple artificial neural network model, and involves the use of numpy.
However, the operating system running on the RISC-V archtecture (currently running on an FPGA) is a very basic Linux system that cannot install software such as Python3 or Pip. But it can compile C/C++ programs and run them. So I thought there could still be a way to run my Python program on this system, by converting it to C/C++ on my host system, transferring it to the RISC-V system, and compile it there.
The problem is that I am not able to find a good Python to C/C++ converter software anywhere. I found that there are some software tools available to convert Python code to binary executables, such as py2exe and pyinstaller. However, it is irrelevant if I am trying to run machine code, only compatible only with my host system architecture, using RISC-V architecture.
I also came across Nuitka, which does convert Python code into C/C++ and stores it in a portable distribution folder, but then also generates shared object files (.so) for libraries which I have imported in my program, which again can't be executed on the RISC-V system. Furthermore, based on what I have seen in the Nuitka documentation, there are no guidelines for compiling of the C/C++ code in the distribution.
So I have a couple of questions :
- Based on the constraints I have mentioned regarding my RISC-V system, is there any other procedure I could follow to run my Python program on the system?
- If not, is there any software tools that I could use to convert Python to C/C++, other than Nuitka?
- If not, can you provide a clear procedure as to how to convert Python code to C/C++ using Nuitka, and then compiling the given C/C++ code on the RISC-V system?