Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readme: add instructions to install package with opam #94

Merged
merged 2 commits into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ This interpreter consists of a single directory organized as follows
### Installing with Nix

ASLp can be installed as a Nix package from https://github.com/katrinafyi/pac-nix.
_asli_ provides the base ASLp and _aslp_ provides ASLp bundled with ARM's specifications.
The _aslp_ provides ASLp bundled with ARM's specifications.
If you don't plan on modifying the tool, this is a fast and easy way to get started.
If installed via Nix, the following installation steps are not necessary.

### Installing dependencies

Expand All @@ -95,9 +96,17 @@ Platform specific instructions:
sudo zypper install ocaml opam ocaml-ocaml-compiler-libs-devel
```

Platform independent instructions:
First-time only (if you have not previously set up an opam switch environment):

```bash
opam init # answer y/n depending on your preference
opam switch create ocaml.4.14.2 # or later
eval `opam env`
```

Platform-independent instructions:

```bash
# Install dependencies from asli.opam file
opam install --deps-only --with-test ./asli.opam

Expand All @@ -107,11 +116,9 @@ Platform independent instructions:

# On OSX, you may need to use this command to install zarith
env CFLAGS="-I$HOME/homebrew/include/" LDFLAGS="-L$HOME/homebrew/lib/" opam install zarith

eval `opam config env`
```

You also need to execute this command
You may also need to execute this command

```
MacOS: export DYLD_LIBRARY_PATH=`opam config var z3:lib`
Expand All @@ -130,6 +137,19 @@ To build the ASL lexer and ASL interpreter, execute this command.
If you get a lot of linker errors involving Z3, double-check that you installed
the right version.

### Building for use in other projects

If you need to use ASLp or libASL as a dependency in another OCaml project,
these steps will install the package in a location discoverable by opam and dune.

After installing dependencies and testing the build, run these commands in this directory:
```
opam pin . -k path
opam install .
```
Once complete, you can verify the package is installed by running `ocamlfind query asli`.


### Using ASL lexer

This displays a list of tokens in an ASL file including the indent
Expand Down