-
Notifications
You must be signed in to change notification settings - Fork 5
macOS
This page provides a tutorial on how to build the LLVM frontend for the Oberon programming language on macOS. Since this project uses CMake to manage its build process, it is recommended to use the CLion IDE under macOS, which uses CMakeLists.txt natively as its project model. Furthermore, the Apple Clang toolchain is assumed to be used to compile the frontend.
Before the Oberon LLVM frontend can be built, the Boost libraries (algorithm, convert, filesystem, and program-options components) and the LLVM Compiler Infrastructure (core libraries and tools) need to be installed. Using Homebrew is recommended to accomplish this. Note that this tutorial assumes that standard build tools such as git, make, and cmake are available on the system used to build the frontend. Otherwise, these tools can also be installed using Homebrew.
brew install boost
brew install llvm
brew install lld
pip3 install lit [--break-system-packages]
pip3 install filecheck [--break-system-packages]
pip3 install sphinx [--break-system-packages]
pip3 install sphinx_rtd_theme [--break-system-packages]
The LLVM frontend for the Oberon programming language on macOS can be built from the command line or using an IDE that supports CMake projects such as CLion.
Begin by cloning the project repository from GitLab.
git clone https://github.com/zaskar9/oberon-lang.git
-
Navigate to the
oberon-langdirectory and create a newbuilddirectory. Then, navigate to the newly createdbuilddirectory.cd oberon-langmkdir buildcd build -
Invoke CMake to set up the build toolchain and generate the required build files.
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -
As a result, CMake will create a generator that can be used to build the frontend.
make --build . --parallel
After the build successfully terminates, the oberon-lang binary can be found in the oberon-lang/build/olang subdirectory, whereas the standard library is located in the oberon-lang/build/stdlib subdirectory.
-
Start CLion and select
Openin the welcome dialog. -
Navigate to the
oberon-langdirectory to which you cloned the project repository and clickOpen. -
Once the project is open, build it using the
Build→Build Projectmenu.
After the build successfully terminates, the oberon-lang binary can be found in the oberon-lang/cmake-build-debug/olang or oberon-lang/cmake-build-release/olang subdirectory.
On systems based on Apple Silicon (e.g., M1 and M2), passing the command line argument -DCMAKE_OSX_ARCHITECTURES=arm64 to CMake may be required to ensure that an ARM64 binary is built.
Building the Frontend
Using the Compiler
Miscellaneous