Tips for MrBayes

Distributed files

Use at your own risk!

Enabling command history and tab-key completion of commands and file names on Windows

Requirements

Prepare readline

cd workdir
unzip readline-4.3-2-mswin32.zip
tar xzf ..\mrbayes-3.1.2.tar.gz
cd mrbayes-3.1.2
copy ..\readline-4.3-2-mswin32\lib\readline-static.lib
md readline
xcopy ..\readline-4.3-2-mswin32\include\readline .

Make Makefile

Make the Makefile as the following.

CC = cl
CFLAGS = /MD /DWIN_VERSION /DUSE_READLINE \
         /I. /DREADLINE_STATIC
all: mrbayes.exe
mrbayes.exe: mb.obj bayes.obj command.obj mbmath.obj \
             mcmc.obj model.obj plot.obj sump.obj sumt.obj
    link /OPT:REF /OUT:mrbayes.exe *.obj \
    readline-static.lib user32.lib advapi32.lib
mb.obj: mb.c
bayes.obj: bayes.c
command.obj: command.c
mbmath.obj: mbmath.c
mcmc.obj: mcmc.c
model.obj: model.c
plot.obj: plot.c
sump.obj: sump.c
sumt.obj: sumt.c

Modify command.c

Add the following line to line 7,364.

#define strncasecmp _strnicmp

Compile MrBayes

Type the following in workdir\mrbayes-3.1.2.

nmake

Enabling command history and tab-key completion of commands and file names on MacOS X

Requirements

Compile and install ncurses

tar xzf ncurses-5.6.tar.gz
cd ncurses-5.6
CFLAGS=-isysroot\ /Developer/SDKs/MacOSX10.4u.sdk \
-arch i386 -arch ppc \
CXXFLAGS=$CFLAGS \
./configure --prefix=/usr/local/ppc \
--with-normal --without-shared --without-debug \
--without-cxx --without-cxx-binding
make
sudo make install
cd ..

Compile and install readline

tar xzf readline-5.2.tar.gz
CFLAGS=-isysroot\ /Developer/SDKs/MacOSX10.4u.sdk \
-arch i386 -arch ppc \
-I/usr/local/fat/include \
CXXFLAGS=$CFLAGS \
LDFLAGS=-L/usr/local/fat/lib \
./configure --prefix=/usr/local/fat \
--enable-static --disable-shared
make
sudo make install
cd ..

Make Makefiles

cp Makefile Makefile-ppc
cp Makefile Makefile-i386

Modify Makefile-ppc as the followings.

18: OPTFLAGS=-O2 -pipe -fomit-frame-pointer \
    -frerun-loop-opt -finline-functions -fforce-addr \
    -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
    -arch ppc -faltivec
22: CC = gcc -I/usr/local/fat/include
52: LIBS += /usr/local/fat/lib/libreadline.a /usr/local/fat/lib/libncurses.a

Modify Makefile-i386 as the followings.

18: OPTFLAGS=-O2 -pipe -fomit-frame-pointer \
    -frerun-loop-opt -finline-functions -fforce-addr \
    -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
    -arch i386 -mfpmath=sse -msse3
22: CC = gcc -I/usr/local/fat/include
52: LIBS += /usr/local/fat/lib/libreadline.a /usr/local/fat/lib/libncurses.a

Compile MrBayes

make -f Makefile-ppc
mv ./mb ./mb-ppc
rm *.o
make -f Makefile-i386
mv ./mb ./mb-i386
rm *.o
lipo -create ./mb-ppc ./mb-i386 -output ./mb

Improving MrBayes

Enabling SwapAdjacent and NSwaps options of MCMC / MCMCP command, and adding SwapDescendAll option to MCMC / MCMCP command.

Requirements

Apply patch file

Download this patche file to MrBayes source code directory. And type the following in the directory.

patch < ../mrbayes-3.1.2.mod.diff

Then, you can compile the modified version of MrBayes.


Creative Commons License Life is fifthdimension. by Akifumi S. Tanabe is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.