Common Build Environment for Linux Platform - magic-lantern-studio/mle-documentation GitHub Wiki

This page identifies the common build environment configuration for developing Magic Lantern components on a Linux platform.

Table of Contents


Set bash Shell

Make sure that /bin/sh is linked to the bash shell. The dash shell default does not work with Magic Lantern scripts.

$ sudo ln -sf bash /bin/sh

Install Git

Git is used for source code management. To install, use:

$ sudo apt-get install git

Install Toolchain

The following build toolchain is required:

$ sudo apt-get install build-essential g++ automake autoconf gnu-standards autoconf-doc libtool gettext autoconf-archive gawk libxt-dev curl python

[!NOTE] On Ubuntu 22.04.3 LTS, python should be replaced by python3


Install Google repo

The Magic Lantern git repositories are retrieved using the Google 'repo' command. Use the following commands to install 'repo':

$ mkdir $HOME/bin/
$ export PATH=$PATH:$HOME/bin >> $HOME/.profile
$ curl https://storage.googleapis.com/git-repo-downloads/repo > $HOME/bin/repo
$ chmod a+x $HOME/bin/repo

Install Java SDK

The Java Development Kit is required to run the Eclipse IDE. These instructions may be used to install the JDK on an Ubuntu 22.04 LTS platform.

Install JDK 24

Instructions for downloading and installing the current JDK (24) can be found on the java.org web site.

[!NOTE] We are currently running with jdk-24_linux-x64_bin.tar.gz for 64-bit platform.

JDK 8u22 (Deprecated)

Download JDK 8u221 from Oracle:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Quick Installation

Execute the following commands to reference the new JDK environment:

$ sudo mkdir /opt/java
$ sudo tar zxvf jdk-24_linux-x64_bin.tar.gz -C /opt/java
$ sudo update-alternatives --install /usr/bin/java java /opt/java/jdk-24.0.1/bin/java 0
$ sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk-24.0.1/bin/javac 0
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java

Update the environment by appending the following to "~/.bashrc":

export JAVA_HOME=/opt/java/jdk-24.0.1
export PATH=$JAVA_HOME/bin:$PATH

Install Ant

Execute the following commands to install ant:

$ sudo apt-get update
$ sudo apt-get install ant
$ sudo apt-get install ant-contrib

Install Python

Python is a requirement for the Magic Lantern mastering tools, replacing the legacy TCL requirement.

See the wiki page Python Development Environment for more information on how to install Python 3.


Install Active TCL [Deprecated]

[!NOTE] The Tcl requirement is being deprecated. Instead, the mastering toolchain will be using Python in the future. See the wiki page Python Development Environment for more information on how to install Python 3.

TCL is a requirement for the Magic Lantern mastering tools.

  1. tar -xvzf ActiveTcl8.6.4.1.299124-linux-x86_64-threaded.tar.gz -C ~/bin
  2. cd ~/bin/ActiveTcl8.6.4.1.299124-linux-x86_64-threaded
  3. sudo ./install.sh
  4. Follow the instructions in the installation dialogs.