Skip to content

Commit 55c7beb

Browse files
authored
Merge pull request #54 from brk/standardize-on-dune
Update README for dune-built CodeHawk
2 parents 9ee0aac + d63b2c0 commit 55c7beb

File tree

2 files changed

+18
-25
lines changed

2 files changed

+18
-25
lines changed

README.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,28 @@ Sound Static Analysis of C for Memory Safety (Undefined Behavior)
44
### Quick start
55

66
The CodeHawk-C Analyzer consists of two parts:
7-
- A python front end (this repository) through which all user interaction
7+
- A Python front end (this repository) through which all user interaction
88
is performed, and
9-
- An ocaml abstract-interpretation engine that powers the analysis.
9+
- An OCaml abstract-interpretation engine that powers the analysis.
1010

11-
To use the CodeHawk-C Analyzer first clone or download the ocaml application
11+
To use the CodeHawk-C Analyzer first clone or download the OCaml application
1212
from
1313
```
1414
https://github.com/static-analysis-engineering/codehawk
1515
```
16-
and build according to the accompanying instructions given there.
17-
Then copy the following files from that build:
18-
```
19-
codehawk/CodeHawk/CHC/cchcil/parseFile
20-
codehawk/CodeHawk/CHC/cchcmdline/canalyzer
21-
```
22-
to the following location in this repository:
23-
```
24-
CodeHawk-C/chc/bin/linux/
25-
```
26-
or
27-
```
28-
CodeHawk-C/chc/bin/macOS
29-
```
30-
depending on the platform where the executables were built.
31-
Alternatively, you can edit the path to these two executables directly
32-
in chc/util/Config.py or chc/util/ConfigLocal.py, so there is no need
33-
to copy them or update them with each new version of the ocaml analyzer.
16+
and build with `dune` according to the accompanying instructions given there.
17+
18+
You can either:
19+
- Copy `chc/util/ConfigLocal.template` to `chc/util/ConfigLocal.py`
20+
in this repository, and edit the latter file to set the paths for
21+
`config.canalyzer` and `config.cparser` to the `dune`-built binaries,
22+
which should be in `your-path-to-codehawk/CodeHawk/_build/install/default/bin/`.
23+
This allows CodeHawk-C to automatically use newly-built versions of the
24+
OCaml analyzer.
25+
- Or, you can copy the `canalyzer` and `parseFile` binaries from that location
26+
into `chc/bin/linux/` or `chc/bin/macOS` within this repository.
27+
To allow CodeHawk-C to use newly-built versions of the OCaml analyzer,
28+
you will have to re-copy the binaries after every build.
3429

3530
Set the python path and path:
3631
```
@@ -47,8 +42,8 @@ which should show something like:
4742
Analyzer configuration:
4843
-----------------------
4944
platform : linux
50-
parser : /home/user/codehawk/CodeHawk/CHC/cchcil/parseFile (found)
51-
analyzer : /home/user/codehawk/CodeHawk/CHC/cchcmdline/canalyzer (found)
45+
parser : /home/user/codehawk/CodeHawk/_build/install/default/bin/parseFile (found)
46+
analyzer : /home/user/codehawk/CodeHawk/_build/install/default/bin/canalyzer (found)
5247
5348
summaries: /home/user/CodeHawk-C/chc/summaries/cchsummaries.jar (found)
5449
```

chc/util/ConfigLocal.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,4 @@ def getLocals(config: chc.util.Config.Config) -> None:
4646
config.canalyzer = '/home/username/my-analyzer/canalyzer'
4747
config.cparser = '/home/username/my-parser/parseFile'
4848
config.summaries = '/home/username/my-summaries/cchsummaries.jar'
49-
config.bear = '/home/username/bear-home/bear'
50-
config.libear = '/home/username/bear-home/libear.so'
5149
'''

0 commit comments

Comments
 (0)