Build Requirements

Daffodil's build requirements include:

  • JDK 8 or higher
  • SBT 0.13.8 or higher
  • C compiler C99 or higher
  • Mini-XML Version 3.0 or higher

You will need the Java Software Development Kit (JDK) and the Scala Build Tool (SBT) to build Daffodil, run all tests, create packages, and more. You can install the latest Java 11 LTS version and the latest SBT version following their websites' instructions or install them using your operating system's package manager.

Since Daffodil now has a C backend as well as a Scala backend, you will need a C compiler supporting the C99 standard or later and the Mini-XML library. You can install either gcc or clang using your operating system‘s package manager. If you can’t install the Mini-XML library using your operating system‘s package manager, you’ll have to build it from source. We'll tell you how to do that on Windows but the commands should work on other operating systems too.

You can set your environment variables CC and AR to the correct commands (or set them to true to disable C compilation altogether) if you don't want sbt compile to call your C compiler with cc and ar as the default commands.

Fedora/CentOS/RHEL

When building on CentOS or RHEL, the EPEL repository must be enabled by following its website's instructions. This is necessary to install the libmxml-devel package.

You can use the dnf package manager to install most of the tools needed to build Daffodil:

sudo dnf install clang gcc git java-11-openjdk-devel llvm make mxml-devel pkgconf

If you want to use clang instead of gcc, you‘ll have to set your environment variables CC and AR to the clang binaries’ names:

export CC=clang AR=llvm-ar

However, Fedora has no sbt package in its own repositories. You‘ll have to install the latest SBT version following its website’s instructions.

Now you can build Daffodil from source and the sbt and daffodil commands you type will be able to call the C compiler.

Ubuntu 20.04

You can use the apt package manager to install most of the tools needed to build Daffodil:

sudo apt install build-essential clang-10 clang-format-10 default-jdk git libmxml-dev

If you want to use clang instead of gcc, you‘ll have to set your environment variables CC and AR to the clang binaries’ names:

export CC=clang-10 AR=llvm-ar-10

However, Ubuntu has no sbt package in its own repositories. You‘ll have to install the latest SBT version following its website’s instructions.

Now you can build Daffodil from source and the sbt and daffodil commands you type will be able to call the C compiler.

Windows 10

Install the latest Java 11 LTS version and the latest SBT version following their websites' instructions.

Install MSYS2 following its website‘s instructions and open a new “MSYS2 MSYS” window. We’ll need its collection of free programs and libraries.

You can use the pacman package manager to install most of the tools needed to build Daffodil:

pacman -S clang diffutils gcc git make pkgconf

If you want to use clang instead of gcc, you‘ll have to set your environment variables CC and AR to the clang binaries’ names:

export CC=clang AR=llvm-ar

However, MSYS2 has no libmxml-devel package so you'll have to build the Mini-XML library from source:

git clone -b v3.3 https://github.com/michaelrsweet/mxml.git
# some daffodil tests fail if you build mxml with clang
unset CC AR
cd mxml
./configure --prefix=/usr --disable-shared --disable-threads
make
make install

Define an environment variable with the name MSYS2_PATH_TYPE and the value inherit using Windows' control panel for editing environment variables.

Now when you open a new “MSYS2 MSYS” window from the Start Menu to build Daffodil from source, the sbt and daffodil commands you type will be able to call the C compiler.