Skip to content

Commit

Permalink
Update installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed May 17, 2019
1 parent 1d141e3 commit 55bb7a1
Showing 1 changed file with 46 additions and 33 deletions.
79 changes: 46 additions & 33 deletions doc/src/installation.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,44 @@
# Installation

## Dependencies
## From a Tarball Using Pip

End users (and distributions) are encouraged to use the tarball, which only
depends on Python and a few Python packages (`llvmlite`, `pytest`,
`prompt_toolkit` and `antlr4-python3-runtime`). The LFortran standard library
needs to be compiled and it needs a C compiler. Down the road (see our
[roadmap](index.md)), LFortran will be gradually rewritten in C++, so it will
also depend on a C++ compiler.

The tarball is generated automatically by our CI (continuous integration) and
contains some autogenerated files: the parser, which is generated by ANTLR4
(requires Java) and the AST and ASR nodes, which is generated by an ASDL
translator (requires Python). The Java requirement is only needed when using
git directly, the tarball does not depend on Java in any way.

## From a Tarball

This is the easiest way.
Download the latest tarball from
[https://lfortran.org/download/](https://lfortran.org/download/).

Install prerequisites and LFortran (works on Linux, macOS and Windows):
The easiest way is to simply `pip` install LFortran. An example:
```bash
conda create -n lfortran python=3.7 pytest llvmlite prompt_toolkit cmake make
conda create -n lfortran python=3.7
conda activate lfortran
pip install antlr4-python3-runtime scikit-build
wget https://lfortran.github.io/tarballs/release/lfortran-0.1.12.tar.gz
tar xzf lfortran-0.1.12.tar.gz
cd lfortran-0.1.12
pip install .
pip install lfortran
```
This works on Linux, macOS and Windows. Pip will automatically download all
build and run time dependencies, compile and install LFortran. The only
prerequisite that you have to have is a working C compiler.

Now the `lfortran` environment has the `lfort` compiler available, you can
start the interactive prompt by executing `lfort`, or see the command line
options using `lfort -h`.

Note: besides the above prerequisites installed by `conda`, you also have to
have a C compiler.

Note on macOS: if `wget` is not present, use `curl -O` instead.

Optional: run tests:
```bash
pytest --pyargs lfortran
```

You can also install any tarball from
[https://lfortran.org/download/](https://lfortran.org/download/) directly,
e.g.:
```bash
pip install https://lfortran.github.io/tarballs/release/lfortran-0.1.14.tar.gz
```
or equivalently by:
```bash
wget https://lfortran.github.io/tarballs/release/lfortran-0.1.14.tar.gz
tar xzf lfortran-0.1.14.tar.gz
cd lfortran-0.1.14
pip install .
```


## From Git

This works both on Linux, macOS and Windows:
This works on Linux, macOS and Windows:
```bash
conda create -n lfortran python=3.7 pytest llvmlite prompt_toolkit cmake make
conda activate lfortran
Expand All @@ -58,6 +48,11 @@ Install Java and then ANTLR, say, into `~/ext`:
```bash
export CLASSPATH="$HOME/ext/antlr-4.7-complete.jar:$CLASSPATH"
```
Clone the LFortran git repository:
```
git clone https://gitlab.com/lfortran/lfortran
cd lfortran
```
Build:
```bash
./build.sh
Expand All @@ -70,3 +65,21 @@ Run an interactive prompt:
```bash
./lfort
```

## Note About Dependencies

End users (and distributions) are encouraged to use the tarball
from [https://lfortran.org/download/](https://lfortran.org/download/),
which only depends on Python and a few Python packages (`llvmlite`, `pytest`,
`prompt_toolkit` and `antlr4-python3-runtime`). The LFortran standard library
needs to be compiled and it needs a C compiler. Down the road (see our
[roadmap](index.md)), LFortran will be gradually rewritten in C++, so it will
also depend on a C++ compiler.

The tarball is generated automatically by our CI (continuous integration) and
contains some autogenerated files: the parser, which is generated by ANTLR4
(requires Java) and the AST and ASR nodes, which is generated by an ASDL
translator (requires Python). The Java requirement is only needed when using
git directly, the tarball does not depend on Java in any way.

The same tarball is accessible from our Downloads page as well as from PyPI.

0 comments on commit 55bb7a1

Please sign in to comment.