How to build on Ubuntu Linux

This wiki page is not currently maintained. Please refer to https://github.com/openwall/john/blob/bleeding-jumbo/doc/INSTALL-UBUNTU instead.

Here's how to make an optimal build of latest bleeding-edge code on Ubuntu Linux. Most of it applies to other distros too (also works for Ubuntu on Windows https://msdn.microsoft.com/en-us/commandline/wsl/).

Install pre-requisites:

Required stuff
  sudo apt-get install git build-essential libssl-dev
  sudo apt-get install yasm libgmp-dev libpcap-dev libnss3-dev libkrb5-dev pkg-config libbz2-dev zlib1g-dev
If you have an NVIDIA GPU (OpenCL support)
  sudo apt-get install nvidia-opencl-dev
If you have an AMD GPU (OpenCL support)
  sudo apt-get install fglrx-updates-dev
  sudo apt-get install libopenmpi-dev openmpi-bin

Cmake needs to be 2.8.12 or above. Ubuntu 14.04 LTS has this.

  sudo apt-get install subversion cmake bison flex
  mkdir ~/src && cd ~/src
  svn checkout https://github.com/teeshop/rexgen.git rexgen
  cd rexgen/trunk/src/
  mkdir build && cd build
  cmake ..
  make && sudo make install
  cd ~/src

Clone latest bleeding-edge Jumbo and build:

Clone GIT repo
  git clone https://github.com/openwall/john
Build
  cd john/src
  # For MPI, use './configure --enable-mpi' below
  ./configure && make -s clean && make -sj4

Test your build:

  $ ../run/john --test=0 --format=cpu

To benchmark, drop the =0 argument to –test.

To test OpenCL formats, use –format=opencl.

To test specific format(s) just name them. Wildcards are OK, eg. –format=lotus*