Skip to content
Chun Tian edited this page Nov 22, 2018 · 4 revisions

How to build the MCL application from the repository.

Introduction

The rmcl-notes document in the repository provides detailed information about how to compile and build the MCL application from the sources.

Xcode and Apple's Developer tools are NOT required to build MCL.

Summary

To build a new version of MCL:

  1. Download the repository.
  2. Compile the source code.
  3. (optionally) rebuild pmcl-OSX-kernel.
  4. Build a ppc-boot bootstrapping application.
  5. Load the rest of the compiled sources.
  6. Save the new application.
  7. Gather the distribution.

Download the Repository

After installing Git, download a clone of the repository using the Terminal (or your Git GUI of choice):

$ git clone https://github.com/binghe/mcl.git mcl

Next, execute the post-checkout in the repository clone:

$ cd mcl
$ sh post-checkout.sh

Compile the Sources

Launch PPCCL (give it plenty of time to start):

$ open ./PPCCL

In the Listener of PPCCL, optionally evaluate the following to reset eventual preferences:

? (dolist (cat *env-categories*) (dolist (spec (cdr cat)) (set (first spec) (third spec))))

In the Listener of PPCCL, do:

? (compile-ccl t)

Consider taking a break: Compiling the sources may take some time to complete. There might be several warnings, but it should finish without errors.

Build the Bootstrapping Image

In PPCCL do:

? (xload-level-0 :force)

This creates an application called ppc-boot. Note that it is crucial that this step happens after compile-ccl.

Quit the PPCCL application:

? (quit)

Rebuild pmcl-OSX-kernel (optional)

In case you just cannot run ppc-boot in next step - it crashes without loading any fasls. The problem may be resolved by rebuilding pmcl-OSX-kernel, because ppc-boot internally calls pmcl-OSX-kernel. Xcode 3.x or earlier version is required here:

$ cd pmcl/OSX
$ make
$ make install

Run the Bootstrapping Image

Launch ppc-boot to get a menu and a Listener:

$ open ./ppc-boot

**If you have problems launching ppc-boot from the Terminal, start it from the Finder by double-clicking the ppc-boot file. Alternatively use

/System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp ./ppc-boot

(Above command works on Mac OS X 10.5; in Mac OS X 10.6, it seems that full path of ppc-boot is required, otherwise you get the following error message: (-2856 stands for "Resource fork could not be opened.")

/System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp[78995] Launch failed with error code -2856 (cfragRsrcForkErr) for application ./ppc-boot

from the Terminal. If ppc-boot still doesn't run, transfer the repository to a another Intel Mac (alternatively a PPC with OSX 10.4 or newer), then open ./PPCCL and rebuild the bootstrapping image before continuing. The current suspicion is that Apple's Developer tools with Xcode 4 is a potential culprit (building a running ppc-boot is verified to succeed on an Intel Mac with OSX 10.6.7 and Xcode 3.2 yet fails on another Intel Mac with the same OSX version but Xcode 4.0.1) - please share if you have evidence to the contrary.**

Evaluate the following to load the remaining files (you may not be allowed to paste into the ppc-boot Listener, in which case you'll have to type it):

? (require "PPC-INIT-CCL")

Save the MCL Application

To prepare the MCL application, do:

? (require "PREPARE-MCL-ENVIRONMENT")

Optionally upgrade to the MCL 6 preview by loading the latest enhancements:

? (require "MCL6" #p"ccl:Mods;mcl6")

To save the application, do:

? (save-application "MCL" :size (ash 1 26))

Adjust the size as you see fit. Note that unless you provide a size, save-application will by default allocate about 1GB memory for the application. This may cause MCL to take a very long time to start on computers with insufficient memory.

Gather the Distribution

Start the saved application:

$ open ./MCL

Then evaluate:

? (load "gather-distribution")
? (ccl::gather-distribution)
? (quit)

After completion, there will be a new folder in the repository clone containing the distribution:

$ open .