Install Ajla from released source code

1. Determine operating system

  1. echo $HOME , if it prints /data/data/com.termux/files/home, then it's Termux in Android.
  2. lsb_release -a
  3. cat /etc/issue
  4. uname -a

2. Prevent failure on lengthy activities

If on a phone, remember to keep the compilation running in the foreground and prevent the display from turning off:

3. Install required and recommended software

3.1 Packages which have to be installed before the others

If you are on Termux on Android, install the tur-repo package (pkg in tur-repo).

3.2 Install main prerequisities

Consequences of missing packages

Operating System Package names required Package names recommended
Alma, CentOS, Oracle Linux, Red Hat Enterprise Linux (RHEL), Rocky gcc make tcc clang gmp-devel libffi-devel numactl-devel screen (if available)
Alpine gcc make tcc clang gmp-dev libffi-dev numactl-dev z3-dev screen (if available)
Android with Termux gcc-15 ldd make tcc clang libffi libgmp screen z3
Arch, Manjaro gcc make tcc clang gmp numactl screen z3
Debian, Edubuntu, Kali, Kubuntu, Lite, MX, Lubuntu, Mint, Trisquel, Ubuntu, Xubuntu, Zorin gcc make tcc clang libffi-dev libgmp-dev libnuma-dev libz3-dev screen
Fedora gcc make tcc clang gmp-devel libffi-devel numactl-devel screen z3-devel
FreeBSD tcc clang libffi gmp linux-c7-numactl-libs screen z3
GeckoLinux, OpenSUSE gcc make clang gmp-devel libffi-devel libnuma-devel screen z3-devel
Gentoo tcc clang libffi gmp numactl screen z3
iOS with iSH ed gcc make sed clang libffi-dev gmp-dev numactl-dev screen z3-dev
Linux From Scratch, Linux without a distribution TCC Clang (LLVM) GMP Libffi Screen
NetBSD gcc clang libffi gmp screen z3
OpenBSD gmake tcc clang libffi libgmp screen z3
Other GCC GNU Make TCC Clang GMP Libffi numactl GNU Screen Z3
Slackware, Zenwalk gcc make tcc clang libffi gmp screen
Windows with Cygwin gcc-core make clang libffi-devel libgmp-devel screen
Windows with WSL (Windows Subsystem for Linux) Refer to the Linux distribution installed in the WSL

4. Select the C compiler

4.1 Determine available compilers and their versions:

TAB means pressing the tab key to auto-complete the command name. Try these commands. If they are available, they will identify themselves whether they are GCC, Clang or TCC and which version:

4.2 Determine system RAM size

Determine RAM size by MemTotal from /proc/meminfo or from the top command and if that doesn't exist, web search technical spec of your device. If you can't figure it out, assume 1 GB.

4.3 Decide which compiler to use

Look up your system RAM size in the table below and take the first compiler from the list which is available on your system. It will produce the fastest running Ajla. You may end up having to install Clang or TCC.
System RAMList of compilers, the most recommended first
< 72 MB TCC. Ajla cannot be compiled without computer swapping. Risk the computer becomes unusable. Risk it will take unacceptably long time.
>= 72 MB < 265 MB TCC
>= 265 MB < 1.2 GB Clang, TCC
>= 1.2 GB GCC, Clang, TCC

4.4 Write down the CC= value

Remember to replace the CC=gcc later with CC=filename_of_your_compiler , for example with CC=clang-19 .

5. Download Ajla

  1. If your system allows it, make sure you are logged in as ordinary user and not root/administrator.
  2. Download and unpack the latest released ajla-0.3.1.tar.gz source code or an older .tar.gz version.

6. Compile Ajla

  1. If on SSH, iOS iSH or Android Termux, start the command screen (if available). If network disconnects, reattach with screen -dr. It also helps with lack of terminals.
  2. Enter the directory ajla-* that was created by unpacking the archive
  3. Determine what to replace ./configure with. Take one row of the table after another until it tells you what:
    StepTestReplace ./configure with
    1Are you on Termux in Android?./configure --prefix=/data/data/com.termux/files/usr
    2Do you know the root or administrator password?./configure
    3Are you entitled to run sudo?./configure
    4Are you already running as root or administrator?./configure
    5Otherwise./configure --prefix="$HOME"/.local
  4. According to your compiler version, select column 1-7 in the table below. Then, according to your RAM size, select a row.
  5. Make sure you will have 100 MB free disk space during the whole compilation.
  6. Close as many web browser tabs and memory hungry programs as reasonably possible. We let Ajla compilation take up to 75% RAM.
  7. Copy-paste the command from the rightmost column in the selected table row, replace CC=gcc according to 4.4, replace ./configure according to 6.3. and run it. If your computer becomes unresponsive, try to break the compilation with CTRL-C, if it doesn't break try reboot with Ctrl-Alt-Del, with Alt-Sysrq-U, Alt-Sysrq-S, Alt-Sysrq-B, with turning the power off. After breaking the compilation rerurn ./clean && ./autogen.sh and select the command again for the next smaller RAM category and run it. Do not select empty cells with dashes!
    RAM size for TCC RAM size for Clang <= 16 RAM size for Clang 17-20 RAM size for Clang >= 21 RAM size for GCC <=13 RAM size for GCC 14,15 RAM size for GCC >= 16 Command to run
    < 73 MB. Under 72 MB may fail, PC may become unusable, may take unacceptably long. - - - >= 324 MB < 497 MB >= 409 MB < 705 MB >= 404 MB < 707 MB
    CC=gcc CFLAGS="-O1 --param ggc-min-expand=1 --param ggc-min-heapsize=1000" ./configure --enable-reduce-nodes=2 --disable-computed-goto && make -j1 ipret.o ipretc.o && make -j2
    
    >= 73 MB < 87 MB >= 252 MB < 685 MB - >= 213 MB < 300 MB >= 497 MB < 651 MB >= 705 MB < 801 MB >= 707 MB < 1.2 GB
    CC=gcc CFLAGS="-O2 --param ggc-min-expand=5 --param ggc-min-heapsize=5000" ./configure --enable-reduce-nodes=2 --disable-computed-goto && make -j1 ipret.o ipretc.o && make -j2
    
    >= 87 MB < 193 MB - >= 265 MB < 497 MB - >= 651 MB < 1.97 GB >= 801 MB < 2.58 GB >= 1.2 GB < 6.12 GB
    CC=gcc CFLAGS="-O2 --param ggc-min-expand=10 --param ggc-min-heapsize=8000" ./configure --enable-reduce-nodes=2 && make -j1 ipret.o ipretc.o && make -j2
    
    >= 193 MB < 276 MB - - - >= 1.97 GB < 4.11 GB >= 2.58 GB < 5.05 GB >= 6.12 GB < 7.72 GB
    CC=gcc CFLAGS="-O2 --param ggc-min-expand=15 --param ggc-min-heapsize=12000" ./configure --enable-reduce-nodes=1 && make -j1 ipret.o ipretc.o && make -j4
    
    >= 276 MB < 552 MB >= 685 MB < 1.37 GB >= 497 MB < 995 MB >= 300 MB < 600 MB >= 4.11 GB < 8.21 GB >= 5.05 GB < 10.1 GB >= 7.72 GB < 15.5 GB
    CC=gcc CFLAGS="-O2 --param ggc-min-expand=20 --param ggc-min-heapsize=16000" ./configure && make -j1 ipret.o ipretc.o && make -j8
    
    >= 552 MB < 646 MB >= 1.37 GB < 1.6 GB >= 995 MB < 1.16 GB >= 600 MB < 703 MB >= 8.21 GB < 9.61 GB >= 10.1 GB < 11.8 GB >= 15.5 GB < 18.1 GB
    CC=gcc CFLAGS="-O2 --param ggc-min-expand=20 --param ggc-min-heapsize=16000" ./configure && make -j2 ipret.o ipretc.o && make -j8
    
    >= 646 MB >= 1.6 GB >= 1.16 GB >= 703 MB >= 9.61 GB >= 11.8 GB >= 18.1 GB
    CC=gcc CFLAGS="-O2 --param ggc-min-expand=20 --param ggc-min-heapsize=16000" ./configure && make -j8
    

6. Copy Ajla to permanent location

What did you replace ./configure with?Action to do
./configure Run sudo make install . If it says “sudo: (command) not found”, run su root -c "make install"
./configure --prefix="$HOME"/.localRun make install
./configure --prefix=/data/data/com.termux/files/usrRun make install

7. Set search path for the ajla command

7.1 Determine the search path

What did you replace ./configure with?Search path
./configureSkip to 8. Test Ajla
./configure --prefix="$HOME"/.local/home/user/.local/bin, where “user“ is your username
./configure --prefix=/data/data/com.termux/files/usr/data/data/com.termux/files/usr/bin

7.2 Set the search path

Run echo $PATH and check whether it already contains the search path. If not, do this procedure: Apped this line to ~/.profile:
PATH=~/.local/bin:"$PATH"
and try these actions one by one until what echo $PATH prints contains the search path:
  1. Log out from all consoles, terminal emulators (xterm,...), and SSH's and log in again
  2. Reboot the system

8. Test Ajla

Test Ajla. If it fails, check that you didn't make a mistake during the installation and if not, then the installation procedure is defective and contact support at [email protected] You can also optionally mention the problem at the mailing list https://www.freelists.org/list/ajla.

9. Clean up

You can optionally delete the ajla-*.tar.gz file ane ajla-* directory that was created by unpacking it, which you just used to compile Ajla, and you are currently in. It saves about 25 MB.