libmceliece

Prerequisites:

For sysadmins

To install in /usr/local/{include,lib,bin,man}:

./configure && make -j8 install

For developers with an unprivileged account

Typically you'll already have

export LD_LIBRARY_PATH="$HOME/lib"
export LIBRARY_PATH="$HOME/lib"
export CPATH="$HOME/include"
export PATH="$HOME/bin:$PATH"

in $HOME/.profile. To install in $HOME/{include,lib,bin,man}:

./configure --prefix=$HOME && make -j8 install

For distributors creating a package

Run

./configure --prefix=/usr && make -j8

and then follow your usual packaging procedures for the build/0/package files:

build/0/package/include/mceliece.h
build/0/package/lib/libmceliece*
build/0/package/bin/mceliece*
build/0/package/man/man3/*.3
build/0/package/man/man1/*.1

The libcpucycles and librandombytes packages are build-time and run-time prerequisites; the python3 and compiler packages are only build-time prerequisites.

More options

You can run

./configure --host=amd64

to override ./configure's guess of the architecture that it should compile for. The architecture controls which implementations to try (see crypto_*/*/*/architectures) and which compilers to try (see compilers/*).

Inside the build directory, 0 is symlinked to amd64 for --host=amd64. Running make clean removes build/amd64. Re-running ./configure automatically starts with make clean.

A subsequent ./configure --host=arm64 will create build/arm64 and symlink 0 -> arm64, without touching an existing build/amd64. However, cross-compilers aren't yet selected automatically.

You can run

./configure --valgrind

to set up a version of libmceliece suitable for tests under valgrind. After compilation and installation,

env valgrind_multiplier=1 \
valgrind -q \
--max-stackframe=16777216 \
--error-exitcode=99 \
mceliece-test

will run those tests. This takes a while. To run tests in parallel on many cores:

ls -d crypto_*/*/* |
( while read opi
  do
    op=`dirname $opi`
    o=`dirname $op`
    p=`basename $op`
    i=`basename $opi`
    o=`echo $o | sed 's/crypto_//'`
    ( mceliece-test $o $p $i
      echo $? ) > test-${o}-${p}-${i}.out &
    ( env valgrind_multiplier=1 valgrind -q \
      --max-stackframe=16777216 --error-exitcode=99 \
      mceliece-test $o $p $i
      echo $? ) > test-valgrind-${o}-${p}-${i}.out 2>&1 &
  done
  wait
)

Version: This is version 2024.05.08 of the "Install" web page.