# Environment * PYNQ-Z1 (v2.4) (Release 2019_02_21) * PYNQ Linux, based on Ubuntu 18.04 * Python 3.6.5 To confirm, ``` 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 ``` 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)] ``` # C++ solver ## Setup ``` make # g++ ``` or ``` make -f Makefile.arm ## arm-linux-gnueabihf-g++ ``` ## Run ``` ./sim -p input-Q-file(.txt) [-s seed-value] [-o output-A-file(.txt)] ``` # 実行時間比較 例題(sample_Q.txt),シード値デフォルト(214) **TODO**