-
Notifications
You must be signed in to change notification settings - Fork 23
Building Software Security Analysis Repo from scratch Python
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.
These instructions are for UNIX systems like Linux or macOS. Windows Subsystem for Linux might do as well.
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 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
2 - Build SVF-Python
This 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/*
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.
Python files are under Assignment-$i/Python
folder, $i
can be 1, 2 or 3. You can use your python interpreter to run Main.py
under these folders.
We highly recommend you to use VSCode or PyCharm, please refer to Python-Configure-IDE.
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.