Install ML/I on Apple Silicon from LOWL Source

Assembled ML/I Using LLVM

Published on 02 December 2024 by Jing Huang.

1. Background

ML/I is a general purpose macro processor, which is good at processing any kind of text. There is an Intel Mac implementation available on the official website, and I guess the C-map process will also work on my Silicon machine, but it might not be as efficient as an LOWL-map could be.

Fortunately there is a LOWL-to-LLVM available, so that we can install an assembled one rather than the compiled one.

2. Get LLVM Installed

ml1-llvm requires LLVM to be installed on your system, as it utilizes llc, opt and llvm-as. To build LLVM without other subprojects, these commands will do:

  |git clone --depth 1 https://github.com/llvm/llvm-project.git
  |cd llvm-project
  |cmake -S llvm -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
  |cd build
5 |sudo make install -j

You can also build a standalone version, so that you don’t have to install LLVM on your system.

3. Make ML/I

Fetch the LOWL sources and extract ml1ajb.lwl:

  |curl -O "http://www.ml1.org.uk/tgz/lowlml1.tar.gz"
  |unar lowlml1.tar.gz

Then clone the ml1-llvm and make the executable.

  |git clone [email protected]:glguida/ml1-llvm.git
  |cd ml1-llvm
  |make ML1SRC=../lowlml1/ml1ajb.lwl
  |sudo install -s -m 755 ml1 /usr/local/bin/ml1

Enjoy.