Skip to content

Developer Installation

Jeffrey Barrick edited this page May 19, 2024 · 1 revision

Developing with Command-Line Compilation

To compile the repository version of the breseq source code, you must have a C/C++ compiler, autotools, autoconf, m4, and several other GNU tools installed on your system. You can use conda with the included dev-environment.yml file to install packages needed for building breseq in an environment named breseq-dev.

conda env create -f dev-environment.yml
conda activate breseq-dev

# These commands set things up so compilation can find the installed libraries
conda env config vars set CFLAGS=-I${CONDA_PREFIX}/include
conda env config vars set CPPFLAGS=-I${CONDA_PREFIX}/include
conda env config vars set LDFLAGS=-L${CONDA_PREFIX}/lib
conda activate breseq-dev
conda env config vars list

Note

This DOES NOT install a C/C++ compiler. One must be installed outside of conda.

Building requires running the ./bootstrap script when you have a fresh version from the repository or whenever the autoconf configuration files have changed, for example when a new source file has been added to the project.

./bootstrap
./configure
make
make install

A special script exists for building a new breseq release package on the current system. If you are working on Linux, you can run this directly in this setup. If you are making a MacOSX release, you must use MacPorts to install universal versions of the libraries using the alternative instructions below.

./binarydist.sh

Consistency Test Instructions

The output of the consistency tests varies depending on different versions of bowtie2 and R. You can use conda with the included runenvironment.yml file to install the current versions used for the consistency tests in an environment named breseq-run.

conda env create -f run-environment.yml
conda activate breseq-test
make test

Note that conda installs a compiler in this environment that will interfere with building breseq in this environment, so only use it for the tests or running breseq on your samples!

Building MacOSX Universal Binaries and Documentation

For compiling a universal binary, breseq needs a universal library (compiled for both arm64 and x86_64). XCode expects this to be installed in /opt/local/lib.

Install MacPorts then use it to install this:

sudo port install zlib +universal

Next, you will need to change your environment to find these library and header files by adding these lines to your shell config file (Example: ~/.zshrc)

export CFLAGS="$CFLAGS -I/opt/local/include"
export CPPFLAGS="$CPPFLAGS -I/opt/local/include"
export LDFLAGS="$LDFLAGS -L/opt/local/lib"

At this point, you can compile a release with MacOSX universal binaries.

./binarydist.sh

Developing with XCode on MacOSX

Open the included project file: src/c/breseq.xcodeproj

For compiling a universal binary, breseq needs a universal library (compiled for both arm64 and x86_64). XCode expects this to be installed in /opt/local/lib. Install MacPorts then use it to install these:

sudo port install zlib +universal

Before compiling and debugging in in XCode, you need to run the first few commands of the command-line instructions to generate Makefiles for building samtools external libraries.

./bootstrap
./configure

To run breseq with the XCode debugger, you must set the environmental variable $PATH, within the "executable" or "scheme" options, include the locations where you have R and bowtie2 installed. You can find these with the 'which' shell command. Then set up a new Environment Variable within XCode like this (it can be to where the breseq-run conda environment installed these tools):

PATH     /Users/myusername/local/bin:$PATH

You may also want to set the working directory, and will definitely want to set the command line options (which are the same as the command you would type in the shell, but omitting the initial "breseq")

breseq -r reference.gbk reads.fastq

becomes Arguments: -r reference.gbk reads.fastq