« Previous - Version 3/5 (diff) - Next » - Current version
Joël Brogniart, 12/07/2017 01:51 pm


Installing AMC development version on macOS with a non MacPorts LaTeX installation

This is a translation of the French entry wiki.

(This installation - AMC version 1.3.0 revision hg:eb15ba78bfe7 4/11/2017 - was tested with
  • macOS 10.12.4 (MacPorts 2.4.1, Xcode 8.3.1).

Auto Multiple Choice (AMC) is a software to manage questionnaires and multiple choice exams. It allows, from the definition of the multiple choice questions to generate sheets of questionnaires. The question types can be one only choice, multiple choices, question, right/wrong answers etc. Once the completed questionnaires are digitized, AMC automatically corrects the questionnaires. This software runs in a graphical environment X Window System on Linux and macOS. Linux is used as the develop environment, so it probably runs best there. Your mileage may vary.

This document briefly describes the installation of Auto Multiple Choice using a LaTeX installation external to MacPorts. The version of AMC installed is a recent development version. The files and installation procedure described here are different from Installing the AMC development version using the LaTeX installation from MacPorts. Apart from this aspect, AMC, works in the same way. Also only the installation part is described here.

The installation described here requires some knowledge of Unix tools, the use of command lines, an understanding of the MacPorts ports architecture, a little understanding of the dependencies between different tools (Subversion, MacPorts, PERL, X11, ports ...) and the macOS architecture. It is also necessary to have administrative rights on the computer.

For this installation you will create a local MacPort repository. In this repository you will add macports description for AMC and possibly files for additional ports. Once these files are installed, the installation of AMC can be started.

Prerequisites

To work with the interface, AMC requires the graphical environment X Window System and X11, the Linux Libertine font, the DejaVu font family and the MacPorts installation system. A LaTeX installation (i.e. MacTeX) should also be available.

The X Window Environment

MacOS does not contain the standard X11 graphical environment. It is possible to fill this gap by installing XQuartz, an X Windows System environment running macOS. You can download the application on the XQuartz site. XQuartz.

Linux Libertine font

Linux Libertine font is a free font that covers code pages for Latin languages​​, Greek, Cyrillic languages​​, Hebrew, the International Phonetic Alphabet (and other). You need to download the package "OTF" on LinuxLibertine.org site.

Caution : XQuartz does not recognize the fonts installed in the user's folder. You must install the fonts by moving them in the "/Library/Fonts" folder.

DejaVu font family

DejaVu fonts are used for japanese documentation generation. You need to download the fonts on dejavu-fonts.org site.

Caution : The current version of XQuartz (2.7.11) does not recognize the fonts installed in the user's folder. You must install the fonts by moving them in the "/Library/Fonts" folder.

MacPorts

MacPorts is a system to build, install and manage open source software. You need to download the macOS Yosemite installation package on the site MacPorts and install MacPorts.

MacPorts and non MacPorts LaTeX installation

To build AMC with a non MacPorts LaTeX installation you need several things.

First, MacPorts build tools must be able to access external LaTeX tools. For example, with the MacTeX 2016 installation, these tools are available in the "/Library/TeX/texbin" folder. MacPorts configuration must be changed so that this folder is included in the path of MacPorts.

Caution, as explained in the MacPorts documentation, editing the MacPorts' path can have unpredictable effects and consequences for others tools. It should be avoided.

Edit the "/opt/local/etc/macports/macports.conf" file to add the following line.

binpath               /opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/Library/TeX/texbin

If you use a tool other than MacTeX, you must replace the last part of the path with the folder containing the binaries of your LaTeX tool.

The dblatex tool should also be build for this external LaTeX installation.

MacPorts installation (port) files

The MacPorts port file contains information that allows a program to be installed into the MacPorts system. It shows what tools are needed for installation and operation of the program and how to install the program.
MacPorts contains many ports but it does not contain a port describing the AMC installation from the source code of the program. So we have to create the file port for the development version of AMC.

To avoid conflicts with ports already described in MacPorts, new ports will be installed in the folders of the user who installs, instead of being installed in folders directly managed by MacPorts.

Local MacPorts repository

For MacPorts to use a local folder, you must create that local folder.

mkdir -p ~/nix

You should then tell MacPorts to take the local folder into account, before considering the standard MacPorts' hierarchy. To do this you must edit the file "/opt/local/etc/macports/sources.conf" and add a URL to the local file before the URL of the repository rsync MacPorts.

file:///Users/julesvernes/nix/macports
rsync://rsync.macports.org/release/tarballs/ports.tar [default]

Port Files

Two archives containing the port files are available for download:
  • for installation on macO 10.9 and 10.10 attachment:macports-10.10.zip,
  • for installation on macOS 10.11 and 10.12 attachment:macports-10.12.zip.

First archive contains the description for the auto-multiple-choice-devel port and an adaptation of the dblatex port that works also with a non MacPorts LaTeX installation. Archive for macOS 10.11 and 10.12 also includes an adaptation of ports gcc5 and pdftk to make them working under these versions of macOS.

Download and uncompress the archive then move the "macports" folder inside the previously created folder.

The ports are grouped by categories and the port file organization reflects this grouping. Each port is in a main category and has its own folder. The main category of AMC in MacPorts is X11, so the port folder for AMC will be inside an x11 folder.

Each directory must contain a port document named Portfile. This document is a text document containing a description for the MacPorts installation tool.

Installing AMC

Once the port files set up, generate the index of the new port.

cd ~/nix/macports
portindex

Then, install the dblatex port without its dependencies to a MacPorts' LaTeX installation.

sudo port install dblatex -latex

And finally, it is necessary to launch in the same way the installation of the development version of AMC.

sudo port install auto-multiple-choice-devel -latex

The installation may take a while. When it is complete and if there is no error, Auto Multiple Choice is ready to be used.

Links