# Installation

## Compiling

CMake, Make, a C++17 compatible compiler (GCC >= 7), and an assembler that uses AT\&T syntax are required.

Run the following commands to build the compiler:

```
$ mkdir build && cd build
$ cmake ..
$ make
```

Then use the compiler to bootstrap the standard library:

```ruby
$ cd .. # in the root directory now
$ make  # forthc needs to be located in build/forthc
```

You should now be ready to compile your first program! Write the following in a forth file

{% code title="hello.forth" %}

```ruby
: main
    "Ciao, Mondo!\n" puts 
;
```

{% endcode %}

And build it with the following commands:

```bash
$ forthc hello.forth | as -o hello.o -
$ ld hello.o /usr/lib/forth/libfstd.a -o hello
$ ./hello
Ciao, Mondo!
```
