Skip to content
Benjamin Buchfink edited this page Mar 10, 2021 · 35 revisions

Requirements

DIAMOND compiles as generic C++ code and has no particular requirements on the hardware architecture, but it makes use of the SSE and AVX instruction sets of the Intel/AMD x86-64 platform if available and will run considerably faster on that platform. It runs on POSIX-compatible operating systems (Linux, FreeBSD, macOS) as well as on Microsoft Windows.

A high-memory server is recommended for better performance, but the program can be run on standard desktop computers or laptops.

Compiled binaries are available for download for Linux, macOS (via Bioconda), FreeBSD (via pkg) and Windows. For best performance, it is recommended to natively compile the software from source on the target system.

The software has been tested on Ubuntu 18.04 bionic, Ubuntu 14.04 trusty, CentOS 7, macOS 10.13 and Microsoft Windows 10.

Binary download

Linux

A precompiled binary is available for recent Linux systems and may be downloaded for immediate use:

wget http://github.com/bbuchfink/diamond/releases/download/v2.0.7/diamond-linux64.tar.gz
tar xzf diamond-linux64.tar.gz

This is a portable binary that contains three separate code paths for systems that support AVX2, systems that support SSE4.1, SSSE3 and POPCNT, as well as generic x86-64 systems that only support SSE2.

If the binary does not work on your system, i.e. you are getting error messages like Kernel too old, please try another installation method or compile the software from source.

Linux/macOS (via Bioconda)

Install Bioconda on your system if not already present, then install DIAMOND using this shell command:

conda install -c bioconda diamond

Regularly updating to the latest version is also recommended:

conda update diamond

Linux (via Docker)

To pull the latest version of the official Docker container:

docker pull buchfink/diamond

To pull a specific version:

docker pull buchfink/diamond:version2.0.7

FreeBSD

On FreeBSD, you can use pkg install diamond to install the software.

Windows

A binary executable for Windows can be downloaded at the GitHub Releases page. You also need to install the Visual C++ Redistributable.

Compiling from source

Compilation requires GCC 4.8.1 or later, CMake 2.6 or later as well as libpthread and zlib including development headers. To compile DIAMOND from source, invoke the following commands on the shell:

wget http://github.com/bbuchfink/diamond/archive/v2.0.7.tar.gz
tar xzf v2.0.7.tar.gz
cd diamond-2.0.7
mkdir bin
cd bin
cmake ..
make -j4
sudo make install

Note:

  • The typical time for compilation is 3-4 minutes using one core.
  • Use cmake -DCMAKE_INSTALL_PREFIX=... to install to a different prefix.
  • Use cmake -DCMAKE_BUILD_MARCH=native to perform a native compile.
  • By default, a portable binary will be created that contains three separate code paths for systems that support AVX2, systems that support SSE4.1, SSSE3 and POPCNT, as well as generic x86-64 systems that only support SSE2.
  • You can use cmake -DSTATIC_LIBGCC=ON -DSTATIC_LIBSTDC++=ON to create a more easily portable binary.

BLAST database support

Support for using BLAST databases in not included by default and needs to be enabled by linking against the libraries from the NCBI toolkit. This can either be done by using shared libraries provided by the operating system, or by using self-compiled libraries.

OS libraries

First, install BLAST on your system using the package manager. For example, on Debian-based systems this can be done by running sudo apt install ncbi-blast+. Check the BLAST version by running blastp -version. If the system's BLAST version is lower than 2.9.0, it is instead recommended to use self-compiled libraries due to a lack of support for the version 5 database format in older BLAST versions. Using a BLAST version lower than 2.9.0 is also untested.

While we are linking against shared system libraries, the header files needed for compilation are not included in any Debian package at this time, so you will need to download these separately and go through the BLAST build process to get usable headers. For this, download the BLAST sources that correspond to your operating system's BLAST version here: https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/

This is an example for the complete procedure tested on Ubuntu 20.04:

sudo apt install ncbi-blast+