From aa8bdf2072536f49fc07a5800068d3df0666dfcb Mon Sep 17 00:00:00 2001 From: "kazushi.kawamura" Date: Thu, 22 Aug 2019 16:16:10 +0900 Subject: [PATCH] Update README.md --- solver_python/README.md | 58 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/solver_python/README.md b/solver_python/README.md index 1189de2..9f1a2fb 100644 --- a/solver_python/README.md +++ b/solver_python/README.md @@ -1,12 +1,58 @@ -# Setup +# Environment +* PYNQ-Z1 (v2.4) (Release 2019_02_21) +* PYNQ Linux, based on Ubuntu 18.04 +* Python 3.6.5 +To confirm, ``` -cd solver_python -(sudo) python3 setup.py install -python3 main.py -p input-Q-file(.txt) [-s seed-value] [-o output-A-file(.txt)] +cat REVISION +cat /etc/lsb-release +python3 --version +``` + +# Python solver based on C++ programs + +C/C++ wrapper for python + +[Reference] +* https://docs.python.org/ja/3/c-api/index.html +* https://cpp-learning.com/python_c_api_step1/ (勉強になる) +* https://cpp-learning.com/python_c_api_step2/ (勉強になる) +* http://codeit.blog.fc2.com/blog-entry-9.html (numpy) + +## Setup + +Check include file in `py_wrapper.hpp` & `solver.hpp` (python version) + +``` +#include "/usr/include/python3.6m/Python.h" +#include "/usr/include/python3.6m/numpy/arrayobject.h" +#include "/usr/include/python3.6m/numpy/arrayscalars.h" ``` +If there exist no files in `/usr/include/python3.6m`, type commands as follows: + +``` +sudo apt-get install python3-dev +sudo apt-get install python3-numpy ``` -(sudo) rm -rf build -(sudo) pip3 uninstall mySolverModule + +Type command as follows: + +``` +sudo python3 setup.py install +``` + +To confirm, type `pip3 freeze`. `mySolverModule==1.0.0` will be listed. + +[Uninstall] +``` +sudo rm -rf build +sudo pip3 uninstall mySolverModule +``` + +## Run + +``` +python3 main.py -p input-Q-file(.txt) [-s seed-value] [-o output-A-file(.txt)] ``` \ No newline at end of file -- 2.22.0