Skip to content

MSYS2 Clang

Michael Grossniklaus edited this page Mar 30, 2024 · 1 revision

This page provides a tutorial on how to build the LLVM frontend for the Oberon programming language on MSYS2 (Windows) using the CLANG64 toolchain. The resulting compiler can follow the same usage description for clang on the Apple platform.

[[TOC]]

Prerequisites

Before the Oberon LLVM frontend can be built, the MSYS2 installer need to be downloaded and installed.

Building the Frontend

Open the clang64.exe shell in the MSYS2 installation folder.

Build

pacman -S make
pacman -S mingw-w64-clang-x86_64-toolchain
pacman -S mingw-w64-clang-x86_64-boost
pacman -S mingw-w64-clang-x86_64-cmake
git clone https://github.com/zaskar9/oberon-lang.git
cd oberon-lang/
mkdir build
cd build
cmake .. -G "MSYS Makefiles"
make
cd ../liboberon
make install

The resulting executable is in the oberon-lang/build/src folder. The runtime is placed in oberon-lang/test/oberon/{lib,include}.

Run unittests

pacman -S mingw-w64-clang-x86_64-python
pacman -S mingw-w64-clang-x86_64-python-pip
pip3 install --user lit
pip3 install --user filecheck
cd oberon-lang/build
make test

Note that the lit.exe and filecheck.exe needs to be placed in the PATH.