Skip to content

Commit bec181d

Browse files
committed
Standardize on using dune to build CodeHawk
Remove the Shake-based build (even though it's a great example!).
1 parent b7151cf commit bec181d

File tree

5 files changed

+27
-621
lines changed

5 files changed

+27
-621
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
# ocamlbuild working directory
1212
_build/
1313

14+
# local opam switch
15+
_opam/
16+
1417
# ocamlbuild targets
1518
*.byte
1619
*.native

CodeHawk/README.md

Lines changed: 24 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -8,166 +8,46 @@ Building codehawk requires the following applications and libraries:
88
- The Findlib / ocamlfind library manager
99
- The Zlib C library, version 1.1.3 or up
1010
- The Zarith library
11+
- goblint-cil, version 2.0.6
1112

1213
The CodeHawk Tool Suite contains three analyzers that can all be built
1314
individually. All three analyzers have an optional gui that can be built
1415
separately (and that requires additional dependencies to be installed).
16+
The gui is current out-of-date and will require additional work to revive.
1517

1618

17-
### Install dependencies: Ubuntu 16.04 or later (without gui)
19+
### Install Dependencies:
1820

19-
```
20-
sudo apt update -y
21-
sudo apt install software-properties-common pkg-config m4 zlib1g-dev libgmp-dev -y
22-
sudo add-apt-repository ppa:avsm/ppa -y
23-
sudo apt update -y
24-
sudo apt install opam
25-
git clone https://github.com/static-analysis-engineering/codehawk.git
26-
opam init --bare --no-setup --disable-sandboxing
27-
opam switch create codehawk-4.12.1 4.12.1 --no-switch
28-
eval $(opam env --switch=codehawk-4.12.1 --set-switch)
29-
opam install ocamlfind zarith camlzip extlib goblint-cil
30-
cd codehawk/CodeHawk
31-
```
32-
33-
Depending on which analyzer you want to build:
34-
- **Binary:** `./make_binary_analyzer.sh`
35-
- analyzer binary: CHB/bchcmdline/chx86_analyze
36-
- **C:** `./make_c_analyzer.sh`
37-
- parser binary: CHC/cchcil/parseFile
38-
- analyzer binary: CHC/cchcmdline/canalyzer
39-
- **Java:** `./make_java_analyzer.sh`
40-
- analyzer binary: CHJ/jchstac/chj_initialize
41-
- **all:** `./full_make_no_gui.sh`
42-
- analyzer/parser binaries: all of the above
43-
44-
45-
### Install dependencies and build: Ubuntu 16.04 or later (including gui)
21+
These commands should work for Ubuntu 22.04+:
4622

4723
```
4824
sudo apt update -y
49-
sudo apt install software-properties-common pkg-config m4 zlib1g-dev libgmp-dev liblablgtk2-ocaml-dev liblablgtksourceview2-ocaml-dev -y
50-
sudo add-apt-repository ppa:avsm/ppa -y
51-
sudo apt update -y
52-
sudo apt install opam
53-
git clone https://github.com/static-analysis-engineering/codehawk.git
54-
opam init --bare --no-setup --disable-sandboxing
55-
opam switch create codehawk-4.12.1 4.12.1 --no-switch
56-
eval $(opam env --switch=codehawk-4.12.1 --set-switch)
57-
opam install ocamlfind zarith camlzip extlib lablgtk lablgtk-extras goblint-cil
58-
cd codehawk/CodeHawk
59-
./full_make.sh
60-
```
61-
62-
# Building with shake
63-
64-
### High-level process:
65-
66-
1. Install dependencies
67-
2. Install the shake build system
68-
3. Install ocaml
69-
4. Build CodeHawk
70-
71-
The top-level dependencies needed to build CodeHawk are zlib for compression, the shake build
72-
system, and the ocaml package manager (opam). In addition to the commands below, use the `opam`
73-
setup above to get the dependencies.
74-
75-
### Generic Unix
76-
77-
Other dependencies: `pkg-config`, `m4`
78-
79-
```
80-
sudo apt update -y
81-
sudo apt install curl -y
82-
curl -sSL https://get.haskellstack.org/ | sh
83-
sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
84-
stack install shake
85-
git clone https://github.com/static-analysis-engineering/codehawk.git
86-
cd codehawk/CodeHawk
87-
stack runghc Shakefile.hs
88-
```
89-
90-
### Arch Linux
91-
92-
```
93-
sudo pacman -Syu opam haskell-shake lablgtk2
94-
git clone https://github.com/static-analysis-engineering/codehawk.git
95-
cd codehawk/CodeHawk
96-
shake
97-
```
98-
99-
### Fedora
100-
101-
```
102-
sudo yum install opam shake ghc-compiler ghc-shake-devel diffutils zlib-devel ocaml-lablgtk-devel -y
103-
git clone https://github.com/static-analysis-engineering/codehawk.git
104-
cd codehawk/CodeHawk
105-
shake
106-
```
107-
108-
### Homebrew
25+
sudo apt install --no-install-recommends software-properties-common \
26+
build-essential unzip \
27+
pkg-config m4 zlib1g-dev libgmp-dev bubblewrap -y
10928
110-
```
111-
brew install opam
112-
brew install cabal-install
113-
brew install lablgtk
114-
cabal update
115-
cabal install --lib shake
116-
cabal install --lib unordered-containers
117-
git clone https://github.com/static-analysis-engineering/codehawk.git
118-
cd codehawk/CodeHawk
119-
~/.cabal/bin/shake
120-
```
29+
# Run with sudo if you wish to install globally
30+
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh)"
31+
opam init --bare
12132
122-
### MacPorts
123-
124-
```
125-
sudo port install opam
126-
sudo port install hs-cabal-install
127-
sudo port install lablgtk2
128-
cabal update
129-
cabal install --lib shake
130-
cabal install --lib unordered-containers
13133
git clone https://github.com/static-analysis-engineering/codehawk.git
13234
cd codehawk/CodeHawk
133-
~/.cabal/bin/shake
35+
opam switch create . 5.2.0 && eval $(opam env)
36+
opam install dune ocamlfind zarith camlzip extlib goblint-cil.2.0.6
13437
```
13538

136-
### Ubuntu 19.04 or later, Debian Buster or later
137-
138-
```
139-
sudo apt update -y
140-
sudo apt install cabal-install pkg-config m4 zlib1g-dev opam liblablgtk2-ocaml-dev liblablgtksourceview2-ocaml-dev -y
141-
cabal update
142-
cabal install shake
143-
git clone https://github.com/static-analysis-engineering/codehawk.git
144-
cd codehawk/CodeHawk
145-
~/.cabal/bin/shake
146-
```
147-
148-
### Ubuntu 16.04 or later
149-
150-
```
151-
sudo apt update -y
152-
sudo apt install software-properties-common cabal-install pkg-config m4 zlib1g-dev liblablgtk2-ocaml-dev liblablgtksourceview2-ocaml-dev -y
153-
sudo add-apt-repository ppa:avsm/ppa -y
154-
sudo apt update -y
155-
sudo apt install opam
156-
cabal update
157-
cabal install shake
158-
git clone https://github.com/static-analysis-engineering/codehawk.git
159-
cd codehawk/CodeHawk
160-
~/.cabal/bin/shake
161-
```
39+
Depending on which analyzer you want to build:
40+
- **Binary:** `dune build CHB`
41+
- **C:** `dune build CHC`
42+
- **Java:** `dune build CHJ`
43+
- **all:** `dune build`
16244

163-
### Manually configured opam
45+
These targets can be combined, e.g. `dune build CHB CHC`.
16446

165-
Before the final "shake" command in one of the above instructions:
47+
The Makefiles in the repository are to help CodeHawk's developers
48+
debug circular module dependencies, they are not intended for users.
16649

167-
```
168-
opam init --bare --no-setup --disable-sandboxing
169-
opam switch create codehawk-4.12.1 4.09.0 --no-switch
170-
eval $(opam env --switch=codehawk-4.12.1 --set-switch)
171-
opam install ocamlfind zarith camlzip extlib lablgtk lablgtk-extras
172-
/path/to/shake
173-
```
50+
Dependencies for other OS flavors:
51+
- Arch Linux: `sudo pacman -Syu opam`
52+
- Fedora: `sudo yum install opam diffutils zlib-devel ocaml-lablgtk-devel -y`
53+
- macOS: `brew install opam`

0 commit comments

Comments
 (0)