Here's my most recent architecture-dependent .deb file, for download and installation:
This is an older .deb file:Compiling Macaulay 2 on ARM has gotten a lot easier in recent years, thanks to advances in the qemu emulator, which does a pretty good job of emulating an ARM processor.
qemu on Linux operates in one of two modes. It can do full virtual machine emulation, booting ARM Linux in a virtualized environment, or it can run individual ARM binaries on an Intel Linux host. The second mode is used during the installation process described below, and the virtual machine emulation is then used to compile Macaulay 2.
My most recent Macaulay 2 .deb files were built on Amazon's EC2 cloud. If you use EC2, I'd recommend an m4.large instance, since qemu's ARM emulator can't use multiple processors, so there's no point using anything larger, and an m3.medium instance doesn't provide enough memory (it swaps incessantly).
apt-get install qemu-system-arm qemu-user-static debootstrap
qemu-img create -f qcow2 ubuntu-arm-qemu.img 25G
sudo modprobe nbd
sudo qemu-nbd -c /dev/nbd0 ubuntu-arm-qemu.img
sudo mke2fs -t ext4 /dev/nbd0
mkdir mnt
sudo mount /dev/nbd0 mnt
I specify the armhf architecture because that's what matches my cell phone's ARMv7 processor, and I use Ubuntu wily 15.10 because xenial 16.04 won't run on my phone's older Linux kernel. The buildd variant selects packages like gcc needed for package builds.
The flash-kernel package is designed to install the Linux kernel on a flash partition, isn't needed when running under qemu, and causes constant errors from apt.
I install an ssh server for logging in to the virtual machine. I prefer this over logging in on its console since ssh does terminal type negotiation, while the console appears to the VM as nothing more than a UART.
sudo qemu-debootstrap --arch=armhf --variant=buildd --include=linux-generic,ubuntu-minimal,openssh-server --exclude=debfoster,flash-kernel wily mnt http://ports.ubuntu.com/
auto eth0
iface eth0 inet dhcp
sudo chroot mnt
passwd
exit
sudo umount mnt
sudo qemu-nbd -d /dev/nbd0
total 1.6G
-rw-r--r-- 1 root root 28M Aug 22 14:04 initrd.img
drwxr-xr-x 2 root root 4.0K Aug 22 13:58 mnt
-rw-r--r-- 1 baccala baccala 1.6G Aug 22 14:05 ubuntu-arm-qemu.img
-rw-r--r-- 1 root root 13K Aug 22 14:05 vexpress-v2p-ca15-tc1.dtb
-rw-r--r-- 1 root root 6.7M Aug 22 14:04 vmlinuz
QEMU_AUDIO_DRV=none qemu-system-arm -kernel vmlinuz -initrd initrd.img -M vexpress-a15 -m 1024 -append "root=/dev/mmcblk0 rw mem=1024M console=ttyAMA0,38400n8" -sd ubuntu-arm-qemu.img -dtb vexpress-v2p-ca15-tc1.dtb -nographic -net nic -net user,hostfwd=tcp::2222-:22
This should boot the emulated virtual machine, with a serial console on the tty and an ssh server listening on port 2222.
In case you're wondering, that .dtb file specifies things like what I/O ports and interrupts are used by the emulated UART and the SD controller, and needs to match the -M vexpress-a15 option to qemu. The dtc tool, provided in the device-tree-compiler package, can be used to decode .dtb files.
Host arm
Hostname localhost
Port 2222
User root
locale-gen en_US.UTF-8
--- a/M2/distributions/deb/Makefile.in
+++ b/M2/distributions/deb/Makefile.in
@@ -19,24 +19,7 @@ endif
############################## main targets
-ifeq (@ARCH@,x86_64)
-DEBARCH=amd64
-else
-ifeq (@ARCH@,i686)
-# libgc needs to be compiled with i686 to get multiple threads
-DEBARCH=i386
-else
-ifeq (@ARCH@,armv7l)
-DEBARCH=armel
-else
-ifeq (@ARCH@,armv6l)
-DEBARCH=armhf
-else
-$(error unrecognized architecture @ARCH@)
-endif
-endif
-endif
-endif
+DEBARCH=$(shell dpkg-architecture -q DEB_TARGET_ARCH)
PKG_DEB = @PACKAGE_TARNAME@-$(DIST_VERSION)-$(DEBARCH)-@OS@-@ISSUE@.deb
PKG_COM_DEB = @PACKAGE_TARNAME@-$(DIST_VERSION)-common.deb
apt-get install -y -q autoconf bison emacs flex g++ gcc gfortran libc6-dev libatomic-ops-dev libgc-dev libgdbm-dev liblapack-dev libmpfr-dev libncurses-dev libncurses5-dev libreadline-dev libxml2-dev liblzma-dev libz-dev make openssh-server patch subversion time unzip zlib1g-dev libtool pkg-config libmpc-dev fakeroot
Several packages required by Macaulay 2 are missing from Ubuntu 15.10 ARM: libcdd-dev libglpk-dev libgmp3-dev libntl-dev libpari-dev
These libraries might be present on a different OS distribution; otherwise the Macaulay 2 build scripts download and compile them with no problems.
./configure --enable-download --enable-build-libraries=pari FC=gfortran --enable-deb --disable-ulimits --prefix=/usr
#! /bin/sh
#
# find any Macaulay 2 process that's been running for more than 5 minutes, and unlimit its cpu time
for pid in `ps -e -o pid,time,comm | grep -v '00:0[0-4]' | grep M2 | cut -d ' ' -f2`; do
prlimit --pid $pid --cpu=unlimited
done
Save this script as unlimiter, make it executable, and set cron to run it every five minutes:
echo '0,5,10,15,20,25,30,35,40,45,50,55 * * * * $HOME/unlimiter' | crontab -