Error Compiling Mothur from Source on Linux

I’m trying to compile mothur from source on two separate Linux machines (one Ubuntu 10.04, one Fedora 16) and running into the same problems.

First I got a bug from mothur.cpp and one other cpp file where it wasn’t setting the MOTHUR_FILES variable properly, so I hard-coded both instances. Now all of the files compile properly, but the GNU Linker fails in the end and I’m not sure what to try. My error messages are appended below.

Suggestions?

Sincerely,
Brett

========================================================
cd uchime_src && ./mk && mv uchime … && cd …
addtargets2
alignchime
alignchimel
alnparams
alpha
alpha2
fractid
getparents
globalalign2
make3way
mx
myutils
path
searchchime
seqdb
setnucmx
sfasta
tracebackbit
uchime_main
usort
viterbifast
writechhit
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
strip: ‘uchime’: No such file
ls: cannot access uchime: No such file or directory
sum: uchime: No such file or directory
make: *** [uchime] Error 1

It looks like you may be having trouble with uchime’s static link for Linux. Can you try changing the following in the */uchime_src/mk file:

LINK_OPTS=
if [ uname -s == Linux ] ; then
#LINK_OPTS=-static
fi

That solved the issue - thanks!

I followed the steps and commented out the static link in the .mk file in chime_src like this:
LINK_OPTS=
if [ uname -s == Linux ] ; then
#LINK_OPTS=-static

However now when I re-run the make file in mother-1.25.0 I get a new error - here is the output:

gfortran -c -m64 *.f
cd uchime_src && ./mk && mv uchime … && cd …
addtargets2
alignchime
alignchimel
alnparams
alpha
alpha2
fractid
getparents
globalalign2
make3way
mx
myutils
path
searchchime
seqdb
setnucmx
sfasta
tracebackbit
uchime_main
usort
viterbifast
writechhit
./mk: line 19: syntax error near unexpected token fi' ./mk: line 19:fi’
make: *** [uchime] Error 2

LINK_OPTS=
if [ uname -s == Linux ] ; then
LINK_OPTS=-static
fi

The fi closes the if/then statement in the makefile. You need to comment out that as well if you are commenting out the if statement. I would recommend pulling our latest version, 1.31, http://www.mothur.org/wiki/Download_mothur. It contains new commands, feature updates and bug fixes you may be interested in.