Building Software Security Analysis Repo from scratch Python - SVF-tools/Software-Security-Analysis GitHub Wiki
These are instructions for building LLVM, SVF, and the assignments (Software-Security-Analysis) from scratch. This is useful if you like to work with your own editor or terminal or have trouble with Docker, the image, or VSCode (M1 Macs currently do). If you encounter some problem, please check this document Trouble-Shooting-for-IDE.
0 - Pre-requisites
These instructions are for UNIX systems like Linux or macOS. Windows Subsystem for Linux might do as well.
1 - Install Packages
Ubuntu/Debian
Install CMake through your package manager. Some possibilities (these commands may require use of sudo
):
- Debian and Ubuntu based systems
$ sudo apt-get update
$ sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install -y \
cmake gcc g++ nodejs doxygen graphviz lcov libncurses5-dev libtinfo6 libzstd-dev \
python3.10 python3.10-venv python3.10-dev
$ curl -sS https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.10 get-pip.py
rm get-pip.py
$ python3.10 -m pip install -U pip pybind11 setuptools wheel build
MacOS
- macOS using Homebrew. If you haven't installed Homebrew, run the following command in your terminal.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
If Homebrew is installed, run the following commands in your terminal (cmake version >=3.23 is required).
$ brew install cmake git [email protected]
$ python3.10 -m pip install -U pip pybind11 setuptools wheel build
SVF-Python
2 - BuildThis part is applicable to both Ubuntu/Debian and MacOS. Grab the SVF sources.
git clone https://github.com/SVF-Tools/SVF-Python.git
cd SVF-Python
Build. This should take a few minutes.
bash build.sh
Finally, install pysvf
python3.10 -m pip install dist/*
3 - Build Software-Security-Analysis
This part is applicable to both Ubuntu/Debian and MacOS. Grab the Software-Security-Analysis sources.
git clone https://github.com/SVF-tools/Software-Security-Analysis
cd Software-Security-Analysis
Congratulations! All built.
4 - Running and debugging your Lab-Exercises, Assignments
Lab Exercise
First install jupyter toolkit
python3.10 -m pip install jupyter notebook
And then go to Lab-Exercise-$i/Python
folder, $i
can be 1, 2 or 3. Then you can see *.ipynb
file.
To start Jupyter notebook, you can refer to any Lab Exercise document like Lab-Exercise-1-Python.
Assignments
Python files are under Assignment-$i/Python
folder, $i
can be 1, 2 or 3. You can use your python interpreter to run test.py
under these folders.
We highly recommend you to use VSCode or PyCharm, please refer to VSCode IDE for Python or PyCharm IDE