Problems Compiling Mothur on 64-bit CentOS

Hello,

I am having a bit of trouble compiling the mothur source code. After I use the make command I get the following output:

g++  -O3  -DUSE_READLINE sharedutilities.cpp -c -I. -o ./sharedutilities.o
In file included from sharedutilities.h:12,
                 from sharedutilities.cpp:10:
mothur.h:60:33: error: readline/readline.h: No such file or directory
mothur.h:61:32: error: readline/history.h: No such file or directory
make: *** [sharedutilities.o] Error 1

Let me know if you have any ideas/suggestions! Thank you very much!

It appears mothur can’t find the readline library. Do you have the readline library installed? If not, you will want to either install it or modified the make file so that the line:

USEREADLINE ?= yes

is

USEREADLINE ?= no

Well that worked for one of the errors (installing readline, that is) but now I am getting:

/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [mothur] Error 1

Any more ideas?

p.s. thank you very much!

Glad I could help. Ncurses is another library package. I suspect you will need to install that as well.

Well I thought that the problems were solved but I guess not. I am now getting this error:

./mothur: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory

I have tried to install libreadline.so.6 via:

yum install libreadline.so.6

Any suggestions? Thanks again!

Mothur can’t find the compiled library. You can search for the .dylib file to see if the library was installed properly.

Which .o file should I look for specifically? Also, how do I install the missing file if it is in fact missing?

Sorry for being difficult, I’m a noob at linux and mothur. :expressionless:

It’s no problem. I am not too familiar with centos, but I will try my best to help. When you installed the readline library it should have made a .dylib file. It would be called libreadline.dylib. If you did indeed get it installed, mothur needs to be able to find it. It should be located with your other standard libraries, in /usr/lib.

The readline library is not required to to run mothur. It allows you to scroll through previous commands you have entered if you are running mothur in interactive mode.

I wasn’t able to find it, though libreadline is installed (I think). I have only found libreadline.so.5 and libreadline.so.5.1 in /usr/lib and I couldn’t compile either of them. Do I need to install a package or what?

You don’t need to install it to run mother. If you set the USEREADLINE ?= no in the makefile, mothur will compile without the library.

How do I do that?

In the folder containing your mothur source files there is a file called makefile. You can open it in any text editor and you will see:

###################################################

Makefile for mothur

Creator [Xcode -> Makefile Ver: Feb 14 2007 09:18:41]

Created: April 16, 2010

###################################################

Macros

CC = g++
CC_OPTIONS = -O3

if you do not want to use the readline library set to no, default yes.

make sure you have the library installed

64BIT_VERSION ?= no

ifeq ($(strip $(64BIT_VERSION)),yes)
CC_OPTIONS += -arch x86_64
LNK_OPTIONS += -arch x86_64
endif

USEREADLINE ?= yes

ifeq ($(strip $(USEREADLINE)),yes)
CC_OPTIONS += -DUSE_READLINE
LNK_OPTIONS +=
-lreadline
-lncurses
-L…/readline-6.0
endif

You want to change the USEREADLINE ?= yes to USEREADLINE ?= no. Since you are running a 64bit OS you should also change 64BIT_VERSION ?= no to 64BIT_VERSION ?= yes. Then save the file and run “make clean”, followed by “make”.

When I run make clean I get the following:

rm: cannot remove `./sharedutilities.o': No such file or directory
rm: cannot remove `./treegroupscommand.o': No such file or directory
rm: cannot remove `./bootstrapsharedcommand.o': No such file or directory
rm: cannot remove `./matrixoutputcommand.o': No such file or directory
rm: cannot remove `./getoturepcommand.o': No such file or directory
rm: cannot remove `./screenseqscommand.o': No such file or directory
rm: cannot remove `./chimera.o': No such file or directory
rm: cannot remove `./decalc.o': No such file or directory
rm: cannot remove `./readotucommand.o': No such file or directory
rm: cannot remove `./readdistcommand.o': No such file or directory
rm: cannot remove `./commandfactory.o': No such file or directory
rm: cannot remove `./alignment.o': No such file or directory
rm: cannot remove `./alignmentcell.o': No such file or directory
rm: cannot remove `./gotohoverlap.o': No such file or directory
rm: cannot remove `./overlap.o': No such file or directory
rm: cannot remove `./needlemanoverlap.o': No such file or directory
rm: cannot remove `./blastalign.o': No such file or directory
rm: cannot remove `./noalign.o': No such file or directory
rm: cannot remove `./suffixdb.o': No such file or directory
rm: cannot remove `./suffixnodes.o': No such file or directory
rm: cannot remove `./suffixtree.o': No such file or directory
rm: cannot remove `./blastdb.o': No such file or directory
rm: cannot remove `./nast.o': No such file or directory
rm: cannot remove `./nastreport.o': No such file or directory
rm: cannot remove `./boneh.o': No such file or directory
rm: cannot remove `./efron.o': No such file or directory
rm: cannot remove `./solow.o': No such file or directory
rm: cannot remove `./unifracweightedcommand.o': No such file or directory
rm: cannot remove `./weighted.o': No such file or directory
rm: cannot remove `./unweighted.o': No such file or directory
rm: cannot remove `./unifracunweightedcommand.o': No such file or directory
rm: cannot remove `./getsabundcommand.o': No such file or directory
rm: cannot remove `./getrabundcommand.o': No such file or directory
rm: cannot remove `./bellerophon.o': No such file or directory
rm: cannot remove `./pintail.o': No such file or directory
rm: cannot remove `./sharedanderbergs.o': No such file or directory
rm: cannot remove `./venncommand.o': No such file or directory
rm: cannot remove `./venn.o': No such file or directory
rm: cannot remove `./fullmatrix.o': No such file or directory
rm: cannot remove `./heatmap.o': No such file or directory
rm: cannot remove `./heatmapcommand.o': No such file or directory
rm: cannot remove `./libshuffcommand.o': No such file or directory
rm: cannot remove `./nocommands.o': No such file or directory
rm: cannot remove `./sharedbraycurtis.o': No such file or directory
rm: cannot remove `./sharedkulczynski.o': No such file or directory
rm: cannot remove `./sharedlennon.o': No such file or directory
rm: cannot remove `./sharedkulczynskicody.o': No such file or directory
rm: cannot remove `./sharedmorisitahorn.o': No such file or directory
rm: cannot remove `./sharedochiai.o': No such file or directory
rm: cannot remove `./readcolumn.o': No such file or directory
rm: cannot remove `./readotu.o': No such file or directory
rm: cannot remove `./readphylip.o': No such file or directory
rm: cannot remove `./consensuscommand.o': No such file or directory
rm: cannot remove `./heatmapsimcommand.o': No such file or directory
rm: cannot remove `./heatmapsim.o': No such file or directory
rm: cannot remove `./optionparser.o': No such file or directory
rm: cannot remove `./filterseqscommand.o': No such file or directory
rm: cannot remove `./goodscoverage.o': No such file or directory
rm: cannot remove `./sequencedb.o': No such file or directory
rm: cannot remove `./sharedjackknife.o': No such file or directory
rm: cannot remove `./sharedmarczewski.o': No such file or directory
rm: cannot remove `./aligncommand.o': No such file or directory
rm: cannot remove `./treemap.o': No such file or directory
rm: cannot remove `./parsimonycommand.o': No such file or directory
rm: cannot remove `./parsimony.o': No such file or directory
rm: cannot remove `./seqsummarycommand.o': No such file or directory
rm: cannot remove `./chimeraccodecommand.o': No such file or directory
rm: cannot remove `./chimerabellerophoncommand.o': No such file or directory
rm: cannot remove `./chimeracheckcommand.o': No such file or directory
rm: cannot remove `./chimeraslayercommand.o': No such file or directory
rm: cannot remove `./chimerapintailcommand.o': No such file or directory
rm: cannot remove `./chimeraseqscommand.o': No such file or directory
rm: cannot remove `./sharedlistvector.o': No such file or directory
rm: cannot remove `./tree.o': No such file or directory
rm: cannot remove `./readtree.o': No such file or directory
rm: cannot remove `./sharedsobscollectsummary.o': No such file or directory
rm: cannot remove `./deconvolutecommand.o': No such file or directory
rm: cannot remove `./listseqscommand.o': No such file or directory
rm: cannot remove `./getseqscommand.o': No such file or directory
rm: cannot remove `./removeseqscommand.o': No such file or directory
rm: cannot remove `./systemcommand.o': No such file or directory
rm: cannot remove `./binsequencecommand.o': No such file or directory
rm: cannot remove `./distancecommand.o': No such file or directory
rm: cannot remove `./ace.o': No such file or directory
rm: cannot remove `./averagelinkage.o': No such file or directory
rm: cannot remove `./bootstrap.o': No such file or directory
rm: cannot remove `./calculator.o': No such file or directory
rm: cannot remove `./chao1.o': No such file or directory
rm: cannot remove `./cluster.o': No such file or directory
rm: cannot remove `./clustercommand.o': No such file or directory
rm: cannot remove `./collect.o': No such file or directory
rm: cannot remove `./collectcommand.o': No such file or directory
rm: cannot remove `./collectsharedcommand.o': No such file or directory
rm: cannot remove `./commandoptionparser.o': No such file or directory
rm: cannot remove `./completelinkage.o': No such file or directory
rm: cannot remove `./database.o': No such file or directory
rm: cannot remove `./engine.o': No such file or directory
rm: cannot remove `./fastamap.o': No such file or directory
rm: cannot remove `./fileoutput.o': No such file or directory
rm: cannot remove `./globaldata.o': No such file or directory
rm: cannot remove `./groupmap.o': No such file or directory
rm: cannot remove `./helpcommand.o': No such file or directory
rm: cannot remove `./makegroupcommand.o': No such file or directory
rm: cannot remove `./chopseqscommand.o': No such file or directory
rm: cannot remove `./clearcutcommand.o': No such file or directory
rm: cannot remove `./catchallcommand.o': No such file or directory
rm: cannot remove `./splitabundcommand.o': No such file or directory
rm: cannot remove `./splitmatrix.o': No such file or directory
rm: cannot remove `./clustersplitcommand.o': No such file or directory
rm: cannot remove `./weightedlinkage.o': No such file or directory
rm: cannot remove `./inputdata.o': No such file or directory
rm: cannot remove `./jackknife.o': No such file or directory
rm: cannot remove `./kmer.o': No such file or directory
rm: cannot remove `./kmerdb.o': No such file or directory
rm: cannot remove `./listvector.o': No such file or directory
rm: cannot remove `./mothur.o': No such file or directory
rm: cannot remove `./nameassignment.o': No such file or directory
rm: cannot remove `./npshannon.o': No such file or directory
rm: cannot remove `./ordervector.o': No such file or directory
rm: cannot remove `./progress.o': No such file or directory
rm: cannot remove `./quitcommand.o': No such file or directory
rm: cannot remove `./rabundvector.o': No such file or directory
rm: cannot remove `./rarecalc.o': No such file or directory
rm: cannot remove `./raredisplay.o': No such file or directory
rm: cannot remove `./rarefact.o': No such file or directory
rm: cannot remove `./rarefactcommand.o': No such file or directory
rm: cannot remove `./rarefactsharedcommand.o': No such file or directory
rm: cannot remove `./sabundvector.o': No such file or directory
rm: cannot remove `./sequence.o': No such file or directory
rm: cannot remove `./shannon.o': No such file or directory
rm: cannot remove `./sharedace.o': No such file or directory
rm: cannot remove `./sharedchao1.o': No such file or directory
rm: cannot remove `./sharedcommand.o': No such file or directory
rm: cannot remove `./sharedjabund.o': No such file or directory
rm: cannot remove `./sharedjclass.o': No such file or directory
rm: cannot remove `./sharedjest.o': No such file or directory
rm: cannot remove `./sharedordervector.o': No such file or directory
rm: cannot remove `./sharedrabundvector.o': No such file or directory
rm: cannot remove `./sharedsabundvector.o': No such file or directory
rm: cannot remove `./sharedsobs.o': No such file or directory
rm: cannot remove `./sharedsorabund.o': No such file or directory
rm: cannot remove `./sharedsorclass.o': No such file or directory
rm: cannot remove `./sharedsorest.o': No such file or directory
rm: cannot remove `./sharedthetan.o': No such file or directory
rm: cannot remove `./sharedthetayc.o': No such file or directory
rm: cannot remove `./simpson.o': No such file or directory
rm: cannot remove `./singlelinkage.o': No such file or directory
rm: cannot remove `./sparsematrix.o': No such file or directory
rm: cannot remove `./summarycommand.o': No such file or directory
rm: cannot remove `./summarysharedcommand.o': No such file or directory
rm: cannot remove `./uvest.o': No such file or directory
rm: cannot remove `./validcalculator.o': No such file or directory
rm: cannot remove `./validparameter.o': No such file or directory
rm: cannot remove `./treenode.o': No such file or directory
rm: cannot remove `./readtreecommand.o': No such file or directory
rm: cannot remove `./reversecommand.o': No such file or directory
rm: cannot remove `./trimseqscommand.o': No such file or directory
rm: cannot remove `./slibshuff.o': No such file or directory
rm: cannot remove `./libshuff.o': No such file or directory
rm: cannot remove `./dlibshuff.o': No such file or directory
rm: cannot remove `./mergefilecommand.o': No such file or directory
rm: cannot remove `./coverage.o': No such file or directory
rm: cannot remove `./whittaker.o': No such file or directory
rm: cannot remove `./preclustercommand.o': No such file or directory
rm: cannot remove `./otuhierarchycommand.o': No such file or directory
rm: cannot remove `./setdircommand.o': No such file or directory
rm: cannot remove `./getgroupcommand.o': No such file or directory
rm: cannot remove `./getlabelcommand.o': No such file or directory
rm: cannot remove `./secondarystructurecommand.o': No such file or directory
rm: cannot remove `./mothurout.o': No such file or directory
rm: cannot remove `./parselistscommand.o': No such file or directory
rm: cannot remove `./readblast.o': No such file or directory
rm: cannot remove `./chimeracheckrdp.o': No such file or directory
rm: cannot remove `./hclustercommand.o': No such file or directory
rm: cannot remove `./hcluster.o': No such file or directory
rm: cannot remove `./getlistcountcommand.o': No such file or directory
rm: cannot remove `./readcluster.o': No such file or directory
rm: cannot remove `./ccode.o': No such file or directory
rm: cannot remove `./taxonomyequalizer.o': No such file or directory
rm: cannot remove `./phylotypecommand.o': No such file or directory
rm: cannot remove `./classifyseqscommand.o': No such file or directory
rm: cannot remove `./classifyotucommand.o': No such file or directory
rm: cannot remove `./parsesffcommand.o': No such file or directory
rm: cannot remove `./classify.o': No such file or directory
rm: cannot remove `./phylotree.o': No such file or directory
rm: cannot remove `./phylodiversity.o': No such file or directory
rm: cannot remove `./phylodiversitycommand.o': No such file or directory
rm: cannot remove `./bayesian.o': No such file or directory
rm: cannot remove `./phylosummary.o': No such file or directory
rm: cannot remove `./alignmentdb.o': No such file or directory
rm: cannot remove `./knn.o': No such file or directory
rm: cannot remove `./distancedb.o': No such file or directory
rm: cannot remove `./chimeraslayer.o': No such file or directory
rm: cannot remove `./slayer.o': No such file or directory
rm: cannot remove `./pcacommand.o': No such file or directory
rm: cannot remove `./formatcolumn.o': No such file or directory
rm: cannot remove `./formatphylip.o': No such file or directory
rm: cannot remove `./mgclustercommand.o': No such file or directory
rm: cannot remove `./getsharedotucommand.o': No such file or directory
rm: cannot remove `./maligner.o': No such file or directory
rm: cannot remove `./chimerarealigner.o': No such file or directory
rm: cannot remove `./bergerparker.o': No such file or directory
rm: cannot remove `./bstick.o': No such file or directory
rm: cannot remove `./sharedkstest.o': No such file or directory
rm: cannot remove `./qstat.o': No such file or directory
rm: cannot remove `./shen.o': No such file or directory
rm: cannot remove `./logsd.o': No such file or directory
rm: cannot remove `./geom.o': No such file or directory
rm: cannot remove `./setlogfilecommand.o': No such file or directory
rm: cannot remove `mothur': No such file or directory
make: *** [clean] Error 1

You can ignore those. The make clean removes anything that may have compiled, so you can start fresh. Anytime you change the makefile it’s a good idea to do a make clean. Now you just need to run make.

Ahh it works now! Thanks a lot for your help!! :smiley: