We will be hosting a mothur workshop in the Detroit area August 27-29. Please contact Pat Schloss for more details

Makefile options

From mothur

Jump to: navigation, search

If you are building mothur instead of downloading one of our executables, there are several options for you to consider.

Contents

Setting a default location

You can set a default location for mothur to look for input files, if they are not found. This will allow you to keep your reference files in one location and save time typing lengthy filenames. This location can be overridden using the set.dir command at run time.

To do this: change Enter_your_default_path_here to the location you would like to use as a default.

MOTHUR_FILES = "\"Enter_your_default_path_here\""
ifeq  ($(strip $(MOTHUR_FILES)),"\"Enter_your_default_path_here\"")
else
	CXXFLAGS += -DMOTHUR_FILES=${MOTHUR_FILES}
endif

Using cygwin to build

If you are using cygwin to build you will want to include the appropriate flags, so change the "no" to a "yes" below.

CYGWIN_BUILD ?= no
ifeq  ($(strip $(CYGWIN_BUILD)),yes)
    CXXFLAGS += -mno-cygwin
    LDFLAGS += -mno-cygwin 
endif


Building a 64bit version

In order to take advantage of your 64bit architecture, you want to build a 64 version of mothur. You do this by changing the "no" to a "yes" below. Note: if you are a linux user, comment out the TARGET_ARCH line and uncomment the CXXFLAGS line.

64BIT_VERSION ?= yes

 ifeq  ($(strip $(64BIT_VERSION)),yes)
 	 #if you are using centos uncomment the following lines
	#CXX = g++44
	
	#if you are a mac user use the following line
	TARGET_ARCH += -arch x86_64
	
	#if you using cygwin to build Windows the following lines
	#CXX = x86_64-w64-mingw32-g++
	#CC = x86_64-w64-mingw32-g++
	#FORTAN_COMPILER = x86_64-w64-mingw32-gfortran
 	#TARGET_ARCH += -m64 -static

	#if you are a linux user use the following line
	#CXXFLAGS += -mtune=native -march=native -m64
	
	 CXXFLAGS += -DBIT_VERSION
        FORTRAN_FLAGS = -m64
 endif

Readline Library

The readline library is not required to run mothur, but it will allow you to scroll through the commands you have entered if you are running mothur in interactive mode. If you do not want to use the readline library, change the yes to no below. If you are going to use it, make sure you have the readline library and ncurses library installed on your machine.


USEREADLINE ?= yes

ifeq  ($(strip $(USEREADLINE)),yes)
    CXXFLAGS += -DUSE_READLINE
    LDFLAGS += \
      -lreadline\
      -lncurses
endif

MPI Version

If you would like to build a mpi-enabled version of mothur, you will want to change the no to yes below. If you are running mothur on a single machine and not a cluster, the mpi-enabled version is slower than using the non-mpi enabled version.

USEMPI ?= no

ifeq  ($(strip $(USEMPI)),yes)
    CXX = mpic++
    CXXFLAGS += -DUSE_MPI
endif


Use Compression

If you would like mothur to compress distance files after dist.seqs creates them, then you will need to set USECOMPRESSION ?= yes.

USECOMPRESSION ?= no

ifeq  ($(strip $(USECOMPRESSION)),yes)
 CXXFLAGS += -DUSE_COMPRESSION
endif

Fortran compiler

You will need a fortran compiler to compile some of mothur's source code. By default the makefile looks for gfortran, but if you would like to use another compiler you must set the FORTAN_COMPILER option.

FORTAN_COMPILER = yourCompiler
Personal tools