It is also recommended to use Docker to
automatically manage the dependences. We decide to adopt a hybrid style
of coding, tooling, and development, where this repo is located
in your physical machine, while the execution is in the docker virtual
machine (VM).
Still, before doing anything, make sure you have this repo fully initialized:
1
git submodule update --init --recursive
Build the Docker Image
Assuming you are at the root of this source tree:
1
docker build -t assassyn:latest .
Run the Docker Container
At least read point 3 below before typing your command!!!
-v <src>:<dst> mounts a physical source directory into the VM destination.
--name specifies the name of this VM container, which avoids a random <adj>_<noun> name.
-m specifies the memory limit of a container. However, this flag only works on Linux.
If you are using Docker client on Windows or Mac OS with UI, memory should be tuned in the client.
Click the bottom bar of the client .
A resource slide bar will pop up as shown .
Tune the memory usage before starting your VM container.
If it is the first time, the repo should be initialized using the command below.
1
docker exec -it ./init.sh
LLVM linkage is super memory consuming, while ninja build can only use fixed #thread
parallelization, which may overwhelm the memory. Feel free to tune your own parameters to have
a balance between performance and machine limit. If you see something like g++ is killed Signal 9
or truncated file, with high probability it is caused by out of memory (OOM).
Feel free to give a different parameter and run again.
Physical Machine
It can also be built on your physical machine. The instructions below are Ubuntu based:
Make sure you have all the repos propoerly cloned:
find scripts -name "*.inc" -type f -exec sed -i 's/make -j\b/make -j 8/g' {} +
Step 5:验证安装,跑一些测试
1 2 3 4
python -c 'import assassyn'# import this module echo $? # 0 is expected make test-all # Optional, runs all the tests. echo $?
你又会遇到一些问题,首先是:
1
error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Make sure you have pipx installed. See /usr/share/doc/python3.12/README.venv for more information. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. Failed to install CIRCT via pip. Fall back to building from source using PyCDE setup. /usr/bin/python: No module named build make: *** [scripts/init/circt.inc:23: install-circt] Error 1
× This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.
If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.12/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. Failed to install CIRCT via pip. Fall back to building from source using PyCDE setup. /usr/bin/python: No module named build make: *** [scripts/init/circt.inc:23: install-circt] Error 1
ImportError while importing test module '/home/zhuyihan/code/assassyn/python/unit-tests/test_ramulator2_combined.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ../../anaconda3/envs/assassyn/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ python/unit-tests/test_ramulator2_combined.py:14: in <module> from assassyn.utils import repo_path E ModuleNotFoundError: No module named 'assassyn'