Skip to content

Commit

Permalink
Issue #425: Improving the build documentation for deepstate.
Browse files Browse the repository at this point in the history
  • Loading branch information
shaynesellner committed Apr 27, 2023
1 parent 5c68312 commit 0ddcb5d
Showing 1 changed file with 72 additions and 1 deletion.
73 changes: 72 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ deterministic settings such as regression testing or CI.

DeepState currently targets Linux, Windows, with macOS support in progress
(the fuzzers work fine, but symbolic execution is not well-supported
yet, without a painful cross-compilation process).
yet, without a painful cross-compilation process). No current support for ARM64 architecture,
this includes Apple Silicon processors, as there is no support for multilib compilers.

### Dependencies

Expand All @@ -125,6 +126,7 @@ Runtime:

First make sure you install [Python 3.6 or greater](https://askubuntu.com/a/865569). Then use this command line to install additional requirements and compile DeepState:

**Building Deepstate**
```shell
sudo apt update && sudo apt-get install build-essential gcc-multilib g++-multilib cmake python3-setuptools python3-dev libffi-dev z3
sudo apt-add-repository ppa:sri-csl/formal-methods
Expand All @@ -137,6 +139,47 @@ make
sudo make install
```

### Changing file permissions
```shell
cd deepstate
sudo chmod -R 755 .
sudo chown -R username:groupname .
```

### Installing Dependencies on Ubuntu if issues arise
**CMake:**
```shell
sudo apt install cmake
```

**GCC & G++ with multilib support:**
```shell
sudo apt-get install gcc-multilib
sudo apt-get install g++-multilib
```

**Installing the latest version of Python via CLI:**
```shell
sudo apt-get update && sudo apt upgrade
sudo apt install wget build-essential libncursesw5-dev libssl-dev \
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.11
```

**Setup Tools:**

Skip the first command below if pip is already installed.
```shell
sudo apt install python3-pip
pip3 install setuptools
```

**Z3:**
```shell
sudo apt install z3
```

### Building on Windows 10
If you want to compile DeepState on Windows make sure to install MinGW with MSYS2 by following the [installation instructions](https://www.msys2.org/#installation). After the installation is finished, select an environment and launch that version of the environment from the Windows programs menu(if in doubt, choose MINGW64 or UCRT64). Then, use the command below to install all of your environment's dependencies and compile DeepState:
```shell
Expand Down Expand Up @@ -221,7 +264,19 @@ to get all the fuzzers and tools up and running on any system.
The build may take about 40 minutes, because some fuzzers require us
building huge projects like QEMU or LLVM.

**Ensure that docker is installed:**

- Check out the docker website [here](https://docs.docker.com/engine/install/) for installation instructions.

**Check if docker is installed correctly:**
```bash
docker run hello-world
```

**Run these commands to install deepstate via docker:**
```bash
git clone https://github.com/trailofbits/deepstate deepstate
$ cd deepstate
$ docker build -t deepstate-base -f docker/base/Dockerfile docker/base
$ docker build -t deepstate --build-arg make_j=6 -f ./docker/Dockerfile .
$ docker run -it deepstate bash
Expand All @@ -236,6 +291,22 @@ user@a17bc44fd259:~/deepstate/build_afl/examples$ $AFL_HOME/afl-fuzz -i foo -o a
user@a17bc44fd259:~/deepstate/build_afl/examples$ deepstate-afl -o afl_Runlen2 ./Runlen_AFL --fuzzer_out
```

**How to use docker without sudo:**
```bash
sudo groupadd docker
sudo gpasswd -a $USER docker
newgrp docker
```

**If this error occurs:**
```bash
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
```
**Run this command:**
```bash
systemctl start docker
```

## Documentation

Check out [docs](/docs) folder:
Expand Down

0 comments on commit 0ddcb5d

Please sign in to comment.