Skip to content

Platform specific notes for building liboqs

xvzcf edited this page Mar 25, 2020 · 14 revisions

OpenBSD

Install the dependencies using pkg_add:

pkg_add cmake ninja
pkg_add -r python
pip3 install pytest pytest-xdist

Then proceed with the remaining instructions here.

Building on Windows using MSYS2 and Mingw

  1. Install required components:

64 bit

Using the mingw64.exe shell:

pacman -S git \
          mingw-w64-x86_64-cmake \
          mingw-w64-x86_64-ninja \
          mingw-w64-x86_64-python-pytest \
          mingw-w64-x86_64-python-pytest-xdist \
          mingw-w64-x86_64-toolchain

32 bit

Using mingw32.exe shell:

pacman -S git \
          mingw-w64-i686-cmake \
          mingw-w64-i686-ninja \
          mingw-w64-i686-python-pytest \
          mingw-w64-i686-python-pytest-xdist \
          mingw-w64-i686-toolchain

and continue according to paragraph 2 of the quick-start instructions for building liboqs.

Cross-compiling on Linux for ARM

Binaries for ARM can be cross-compiled on Linux. In order to do so, you need to supply CMake with an appropriate toolchain file.

For example, to cross compile for a Raspberry Pi on an x86-64 Ubuntu Bionic machine:

apt install gcc-8-arm-linux-gnueabihf
mkdir build && cd build
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../.CMake/toolchain_rasppi.cmake -DOQS_USE_OPENSSL=OFF ..
ninja

At present, there is a known bug involving running qTESLA on ARM: see issue #578.

Cross-compiling on Debian/Ubuntu Linux for Windows

Binaries for Windows AMD64 can be cross-compiled on Linux. In order to do so, you need to supply CMake with an appropriate toolchain file. The following example shows how to use the toolchain for Windows AMD64 compilation. The subsequent section shows how build using a different approach.

apt install gcc-mingw-w64
mkdir build && cd build
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../.CMake/toolchain_windows-amd64.cmake ..
ninja

Cross-compiling on Arch Linux for Windows

  1. You need to enable the ownstuff repository.

  2. Install required components:

pacman -S git \
          mingw-w64-cmake \
          mingw-w64-openssl \
          mingw-w64-toolchain \
          ninja
  1. Get the source:
git clone -b master https://github.com/open-quantum-safe/liboqs.git
cd liboqs
  1. And build:

64 bit

mkdir build && cd build
x86_64-w64-mingw32-cmake .. -GNinja
ninja

32 bit

mkdir build && cd build
i686-w64-mingw32-cmake .. -GNinja
ninja

Clone this wiki locally