Skip to content
command tool for creating NeXML from other file formats
Shell C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

This repo contains an NCL-dependent file format conversion tool written in C++ to be used within the Open Tree of Life project for creating NeXML docs.

Why another NEXUS to NeXML conversion when there are already options (see ) in existence? Because NCL has had some NeXML output for quite a while, so this is not really new.

Installation of NCL and 2nexml


  • make
  • a C++ compiler
  • autoconf (tested on version 2.69)
  • automake (tested on version 1.11.5)

(1) Choose an installation prefix that will serve as the root of tools installed. In the docs below this will be called OPEN_TREE_TOOL_DIR, but you can actually choose any variable name that you like. Here we assume that you are using bash:

export OPEN_TREE_TOOL_DIR="${HOME}/opentree-tools"

(2) Download and install NCL. Note that these commands should probably be executed from some directory that is not under $OPEN_TREE_TOOL_DIR

Option A: use git:

cd my-build-dir
git clone
cd ncl
mkdir build
../configure --prefix="${OPEN_TREE_TOOL_DIR}" --with-constfuncs=yes --disable-shared --with-reserveid
make -j2 && make check && make install && make installcheck

Option B: build NCL from a posted source archive. Instructions coming soon.

Option C: download the NCL libraries. Coming soon.

In addition to putting the libraries you need in $OPEN_TREE_TOOL_DIR/lib, this set of commands will add 3 executables to $OPEN_TREE_TOOL_DIR/bin. These will be named NCLconverter, NEXUSnormalizer, NEXUSvalidator. They can be deleted, if you do not want them.

(3) Create a build directory, configure, build and install 2nexml.

mkdir build
cd build
../configure --prefix="${OPEN_TREE_TOOL_DIR}" --with-ncl="${OPEN_TREE_TOOL_DIR}"
make -j2 && make check && make install && make installcheck

If all goes well, you should have a 2nexml commandline tool in ${OPEN_TREE_TOOL_DIR}/bin


You can invoke the 2nexml tool with -h to see command line flags to alter the behavior of the tool. The basic usage is

2nexml in.nex > out.xml

To produce a NeXML file called out.xml by redirecting the standard output of the 2nexml program.

Bug reports

Please report bugs via the github issue tracker at

You can’t perform that action at this time.