Skip to content

Commit

Permalink
[GR-13852] Update Sulong Setup Documentation.
Browse files Browse the repository at this point in the history
PullRequest: graal/2907
  • Loading branch information
Jacob Kreindl committed Feb 12, 2019
2 parents 76b5d00 + 3d6787b commit 64a6474
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions sulong/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,17 @@ Build Dependencies
Sulong is mostly implemented in Java. However, parts of Sulong are
implemented in C/C++ and will be compiled to a shared library or a bitcode
file. For a successful build you need to have LLVM (incl. `CLANG` and `OPT`
tool) v3.8 - v7.0 installed.
tool) in one of the supported versions (v3.8 - v7.0) installed. For best
experience we suggest to install either LLVM 4 or LLVM 6.

MacOS: Apple's default LLVM does not contain the `opt` tool, which a Sulong
build needs. We recommend installing LLVM via `homebrew` and appending the
bin path to the `PATH`. For best experience we suggest to install LLVM 4.0.
On a Linux-based operating system you can usually use its included package
manager to install a supported version. Note, however, that the LLVM that
is shipped with MacOS does not contain the `opt` tool, which a Sulong
build needs. On MacOS, we recommend installing LLVM via `homebrew` and
appending the bin path to the `PATH`.

To install Clang and LLVM 4 on MacOS using `homebrew` you can use the
following command:

brew install llvm@4
export PATH="/usr/local/opt/llvm@4/bin:$PATH"
Expand Down Expand Up @@ -144,11 +150,11 @@ Next, you need to download a recent
[labsjdk](http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html).
Extract it inside the `sulong-dev` directory:

tar -zxf labsjdk-8u172-jvmci-0.47-linux-amd64.tar.gz
tar -zxf labsjdk-8u172-jvmci-0.54-linux-amd64.tar.gz

Set `JAVA_HOME` to point to the extracted labsjdk from above:

echo JAVA_HOME=`pwd`/labsjdk1.8.0_172-jvmci-0.47 > graal/sulong/mx.sulong/env
echo JAVA_HOME=`pwd`/labsjdk1.8.0_172-jvmci-0.54 > graal/sulong/mx.sulong/env

Sulong partially consists of C/C++ code that is compiled using `make`. To speed
up the build process you can edit the `MAKEFLAGS` environment variable:
Expand All @@ -168,8 +174,8 @@ Now, Sulong is ready to start. You can for example compile a C file named
clang -c -emit-llvm -o test.bc test.c
mx lli test.bc

For best experience we suggest to use clang 3.8, though versions 3.2, 3.3 and
3.8 to 7.0 should also work. Additionally, if you compile with the `-g` option
For best experience we suggest to use clang 4.0 or 6.0, though all versions between
3.8 and 7.0 should also work. Additionally, if you compile with the `-g` option
Sulong can provide source-file information in stacktraces.

You can specify additional libraries to load with the `-Dpolyglot.llvm.libraries`
Expand Down Expand Up @@ -205,10 +211,8 @@ command instead:

mx intellijinit

If you also want to edit the mx configuration files from within Idea, you can
append the `--mx-python-modules` argument to this. Since the configuration files
consist of Python code, you will probably want to install the
[Python Language Support Plugin](https://plugins.jetbrains.com/plugin/631-python).
Since Sulong's configuration files for `mx` consist of Python code, you will
probably want to install the [Python Language Support Plugin](https://plugins.jetbrains.com/plugin/631-python).

You can also develop Sulong in Netbeans. The following command will generate the
project files and print instructions on how to import them into the IDE:
Expand Down Expand Up @@ -236,7 +240,7 @@ LLVM is an umbrella project for a modular and reusable compiler
infrastructure written in C++. It includes a compiler frontend `clang`
for compiling C, C++, Objective C and Objective C++ to LLVM bitcode IR.
Many of the other tools such as the optimizer `opt`, assembler,
linker, and backends then operate on the LLVM bitcode, to finally produce
linker, and back-ends then operate on the LLVM bitcode, to finally produce
machine code. LLVM envisions that transformations and analyses can be
applied during compile-time, link-time, runtime, and offline.

Expand Down

0 comments on commit 64a6474

Please sign in to comment.