diff --git a/Lama.opam b/Lama.opam new file mode 100644 index 000000000..1f7af5948 --- /dev/null +++ b/Lama.opam @@ -0,0 +1,27 @@ +opam-version: "2.0" +version: "1.10" + +synopsis: "Lama programming system" +maintainer: "dboulytchev@gmail.com" +authors: "dboulytchev@gmail.com" +homepage: "https://github.com/JetBrains-Research/Lama" +bug-reports: "https://github.com/JetBrains-Research/Lama/issues" + +depends: [ + "ocaml" { >= "4.07.1" } + "ocamlfind" { build } + "camlp5" { >= "8.00"} + "ostap" { >= "0.5"} + "GT" { >= "0.4.0"} +] + +build: [ + [make] + [make "regression"] {with-test} +] +install: [make "install"] + +dev-repo: "git+https://github.com/JetBrains-Research/Lama.git" +url { + src: "git+https://github.com/JetBrains-Research/Lama.git#1.10+ocaml4.10" +} diff --git a/README.md b/README.md index 0dc90f05a..000e7b1c6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Lama +# Lama ![lama](lama.png) is a programming language developed by JetBrains Research for educational purposes as an exemplary language to introduce the domain of programming languages, compilers and tools. Its general characteristics are: @@ -38,21 +38,52 @@ The language specification can be found [here](lama-spec.pdf). ## Installation -Prerequisites: +Windows users should get Windows Subsystem for Linux a.k.a WSL (recommended) or cygwin. Ubuntu-based variant of WSL is recommended. -* gcc-multilib -* ocaml (4.07.1 <= . < 4.10) [http://ocaml.org] -* opam (>= 2.0.4) [http://opam.ocaml.org] +* System-wide prerequisites: -Installing: + - `sudo apt install gcc-multilib` (in Debian-based GNU/Linux) + - [opam](http://opam.ocaml.org) (>= 2.0.4) + - [OCaml](http://ocaml.org) (>= 4.10.1). *Optional* because it can be easily installed through opam. Compiler variant with `flambda` switch is recommended -* `opam pin add -n ostap https://github.com/dboulytchev/ostap.git#memoCPS` (remember of "#" being a comment character in bash) -* `opam pin add -y lama https://github.com/JetBrains-Research/Lama.git` +* Check that `opam` is installed (using commands `which opam` or `opam --version`) -Smoke-testing: +* Install right switch for OCaml compiler -* `pushd tutorial` -* `make` -* `popd` + `opam switch create lama ocaml-variants.4.10.1+fp+flambda` + In above command: + - `opam switch create` is a subcommand to create a new switch + - `ocaml-variants.4.10.1+fp+flambda` is name of a standart template for the switch + - `lama` is an alias for the switch being created; on success a directory `$(HOME)/.opam/lama` should be created + +* Update PATH variable for the fresh switch. (You can add these commands to your `~/.bashrc` for convenience but they should be added by `opam`) + + ``` + export OPAMSWITCH=lama + eval $(opam env) + ``` + + Check that OCaml compiler is now available in PATH: running `which ocamlc` should give `/home/user/.opam/lama/bin/ocamlc` (or similar) and `ocamlc -v` should give + + ``` + The OCaml compiler, version 4.10.1 + Standard library directory: /home/user/.opam/lama/lib/ocaml + ``` + +* Pin Lama package using `opam` and right URL (remember of "#" being a comment character in bash) + + `opam pin add Lama https://github.com/JetBrains-Research/Lama-devel.git\#1.10+ocaml4.10 -y` + + The `-y` switch meands "reply always 'yes'". + +* Check that `lamac` exectuable was installed: `which lamac` should give + + ``` + /home/user/.opam/lama/bin/lamac + ``` + +### Smoke-testing: + +Install `lama` system-wide, clone the repository and run `make -C tutorial` diff --git a/opam b/opam deleted file mode 100644 index 4c4723efa..000000000 --- a/opam +++ /dev/null @@ -1,32 +0,0 @@ -opam-version: "2.0" -name: "Lama" -version: "1.0" - -synopsis: "Lama programming system" -maintainer: "dboulytchev@gmail.com" -authors: "dboulytchev@gmail.com" -homepage: "https://github.com/JetBrains-Research/Lama" -bug-reports: "https://github.com/JetBrains-Research/Lama/issues" - -depends: [ - "ocaml" { >= "4.07.1" } - "ocamlfind" { build } - "camlp5" { >= "7.05"} - "ostap" { >= "0.3"} - "GT" { >= "0.2"} -] - -build: [ - [make "-f" "Makefile"] - [make "-f" "Makefile" "regression"] {with-test} -] -install: [make "install"] - -#remove: ["ocamlfind" "remove" "compiler-workout"] -#flags: light-uninstall - -dev-repo: "git+https://github.com/JetBrains-Research/Lama.git" -url { - src: "git+https://github.com/JetBrains-Research/Lama.git#1.00" -} -