beagle on windows

1,508 views
Skip to first unread message

botgrad

unread,
Mar 22, 2010, 10:45:55 PM3/22/10
to beast-users
Hi, curious about the beagle program for windows, any one have any
success? I think I've installed all auxiliary programs properly (CUDA
etc). I compiled Beagle using apache ant, and that seemed to work but
when I try using it with Beast I get errors (beast runs fine without
it).

with Beast 1.5.2 I get: Failed to load BEAGLE library: no hmsbeagle-
jni in java.library.path

I can't find a file called hmsbeagle-jni on my computer.

with Beast 1.5.3: Exception in thread "main"
java.lang.NoClassDefFoundError: beagle/BeagleFlag
at dr.app.beast.BeastMain.main(Unknown Source), etc

I can't find a file called BeagleFlag on my computer. Making sure
CLASSPATHs were defined for the Beast and Beagle Libraries hasn't
helped.

If anyone has any solutions I'm all ears (or eyes).

Sincerely,
Will

Chris

unread,
Mar 23, 2010, 11:58:55 AM3/23/10
to beast-users
Hi Will,

I was able to compile and run an earlier build of BEAGLE on Windows
Vista using a combination of VisualStudio and the build_installer.bat
batch file in /trunk/project/beagle-vs of the SVN download... seem to
remember that I ran into some of the same problems that you mentioned,
since the Java syntax for Windows is slightly different from what
other folks have recommended for UNIX-based operating systems.

If you're confident that you've compiled successfully without any
errors (warnings should be ok), try the following command line after
changing into the appropriate BEAST 1.5.3 directory, which should
include sub-directories for "bin", "lib", etc...

java -xms10000m -xmx10000m -classpath .\lib\beast.jar;.\lib\beast-
beagle.jar dr.app.beast.BeastMain -beagle -beagle_GPU -beagle_order
1,1,2,2,0,0 name.of.your.input.file.xml

You will probably need to tweak the amount of memory, depending on
your available RAM. The beagle_order flag allocates each partition to
the GPU or CPU. In the example above, I've split six partitions
between two GPUs and the CPU.

There could also be issues with setting paths for environment
variables, but I think that was all handled during the compile
process. The developers noted in an earlier post that you should run
BEAGLE with concurrent builds of BEAST, not sure if that is part of
your problem:

http://groups.google.com/group/beast-users/browse_thread/thread/9db2020fcddcb3a1#

One last thought... I spent a lot of time working on getting BEAGLE
compiled and running on Vista, only to find that there was no
performance increase for my data. In fact, BEAGLE ran about 10-15%
slower than the standard CPU version of BEAST. It seems that the
computational overhead of calling the GPU for multiple partitions can
be relatively expensive, especially when those partitions have less
than (say) 500-1000 sites and/or comprise nucleotide data (rather than
amino acid models).

Best,
Chris

Chris

unread,
Mar 23, 2010, 2:29:07 PM3/23/10
to beast-users
Hi Will,

A quick follow-up after looking at some of my old files...

The build_installer.bat file uses VisualStudio to compile the code and
create a Windows setup executable in /trunk/project/beagle-vs/
beagleinstaller/Release. You need this to install BEAGLE before using
the command line described above. I'm not sure how compiling with
Apache Ant works in comparison.

You can download a trial version of VisualStudio 9.0 from the
Microsoft web site, then modify the build_installer.bat file to set
the correct paths for devenv.exe and vcvarsall.bat (part of
VisualStudio). For example:

SET devenv="C:\Program Files (x86)\Microsoft Visual Studio
9.0\Common7\IDE\devenv.exe"
SET vcvars="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
\vcvarsall.bat"

Hope this helps... but I would carefully consider the potential
benefits of computational speed in BEAGLE versus the inevitable time
and frustration spent trying to compile source for Windows. Depending
on the size and structure of your data set, CPU/GPU/RAM, etc... it
might be more efficient to run simultaneous analyses on different CPU
cores in BEAST, rather than trying to obtain marginal improvement for
a single run with BEAGLE, since you'll need to replicate your results
to verify MCMC convergence anyway.

Best,
Chris

botgrad

unread,
Mar 24, 2010, 12:37:37 PM3/24/10
to beast-users
Thanks Chris, I ll try this out.
-Will

Aaron Darling

unread,
Mar 24, 2010, 2:28:03 PM3/24/10
to wil...@interchange.ubc.ca, beast-users
Hi Will,
I developed the beagle windows installer. The installer and build
system still need some fine tuning, so it would be great to get feedback
from you and others on it. I just compiled an up-to-date installer for
64-bit windows, which you can download from:
http://edhar.genomecenter.ucdavis.edu/~koadman/libhmsbeagle-20100324.msi
Note that this probably won't work on 32-bit windows, and of course
you'll have to set java.library.path on the beast command-line to point
to wherever you choose to install the library.

Hope that helps,
-Aaron

Chris

unread,
Mar 24, 2010, 5:45:12 PM3/24/10
to beast-users
Hi Aaron & Will,

Aaron - Just tried your latest installer for Windows, and it returns a
null pointer exception when trying to execute with BEAST 1.5.3. I
remember encountering this type of error for my homebrew compile using
BEAGLE builds after Czech2010, so maybe the problem is cross-
compatibility between various revisions of the source code for each
application?

Will - If you've been able to compile the latest build of BEAST (i.e.,
matching Aaron's installer) using Apache Ant, this might not be a
problem for you. Give it a shot and see what happens?

Best,
Chris

botgrad

unread,
Mar 25, 2010, 3:00:03 AM3/25/10
to beast-users
Thanks guys!
The command line stuff is more or less completely new to me so please
bear with me.
The compiled versions look different to me. With ant there was a
library of class files which I don't see in the compiled version that
Aaron sent.
Is there a command line guide for beast or beagle? I haven't been able
to find one...(though several people on this website reference the
example directory in 1.5.2 I didn't see an obvious location for that
information.)
Do I set java library path with java -Djava.library.path="path to
beagle library" ? I tried this with the Chris's commands but it didn't
seem to work...it still said hmsbeagle-jni not set in
java.library.path. (using Aarons compiled version)
-Will

Chris

unread,
Mar 25, 2010, 9:15:01 AM3/25/10
to beast-users
Hi Will,

Aaron is right that a path needs to be set for the hmsbeagle library,
either in the Java command line or as a system environment variable in
the Windows control panel. I usually do the latter, but verified that
the -Djava command works after deleting the system setting and running
this instead:

java -xms1000m -xmx1000m -Djava.library.path="C:\Program Files
(x86)\Common Files\libhmsbeagle-1.0" -classpath .\lib\beast.jar;.\lib


\beast-
beagle.jar dr.app.beast.BeastMain -beagle -beagle_GPU -beagle_order
1,1,2,2,0,0 name.of.your.input.file.xml

Obviously, you need to change the name of the path so it corresponds
to the actual directory on your hard drive that contains the BEAGLE
driver (.dll) and library (.lib).

Can you run BEAST (w/out BEAGLE) from the command line? That would be
a good way to check whether everything is ok on that end:

java -xms1000m -xmx1000m .\lib\beast.jar dr.app.beast.BeastMain
name.of.your.input.file.xml

Not sure what the jni problem is... The only way I've been able to
replicate this type of issue is by attempting to run BEAGLE on a much
earlier build of BEAST (e.g., release 1.5.2), which throws the
following error when checking resources with the -beagle_info flag:

"Failed to load BEAGLE library: no hmsbeagle-jni in java.library.path"

When I run Aaron's version of BEAGLE w/ BEAST 1.5.3, the null pointer
exception is almost identical to what Bena reported in the thread I
linked to earlier:

java.lang.NullPointerException
at beagle.BeagleJNIWrapper.createInstance(Native Method)
at beagle.BeagleJNIImpl.<init>(Unknown Source)

Note that this error also refers to the jni, and the solution was to
download and compile the latest builds for both applications. So maybe
your versions just aren't playing nice with each other.

Here are the compatible builds that I was able to compile and run on
Vista 64-bit: BEAST (r2671) and BEAGLE (r657). There have been a ton
of revisions and bug fixes since then, but that might be another
option. I'm pretty sure the r2671 version of BEAST is just the regular
1.5.3 release from last fall, so you wouldn't need to recompile that.

Good luck!

Best,
Chris

Chris

unread,
Mar 26, 2010, 10:51:58 AM3/26/10
to beast-users
Hi Will,

If you're still hanging in there, I was able to get the most recent
revisions of BEAGLE and BEAST working together on Windows. Basically,
it just involved compiling BEAST (r3076) with Ant and running Aaron's
installer executable. Before compiling, make sure to edit the
build.xml file so that the default on line 2 is "build_jar_all_BEAST",
otherwise it won't create the necessary jar files.

Once everything is compiled and installed, try using the following
command after changing into the main directory for the new compiled
version of BEAST (remember to modify paths and settings as
appropriate):

java -Djava.library.path="C:\Program Files\(x86)\Common Files
\libhmsbeagle-1.0" -xms1000m -xmx1000m -classpath .\build\dist
\beast.jar;.\build\dist\beast.beagle.jar dr.app dr.app.beast.BeastMain


-beagle -beagle_GPU -beagle_order 1,1,2,2,0,0
name.of.your.input.file.xml

The key issue seems to be synching the revisions for both
applications. Since this is all pre-release code, I think it would be
a reasonable courtesy to check with the developers prior to submitting
results for publication, and to follow the updates on Google code to
look for bug fixes that might affect your results.

Best,
Chris

Chris

unread,
Mar 26, 2010, 11:42:42 AM3/26/10
to beast-users
Apologies, there were several typos in the command line suggested
above, try this instead:

java -xms1000m -xmx1000m -Djava.library.path="C:\Program Files\
(x86)\Common Files
\libhmsbeagle-1.0" -classpath .\build\dist\beast.jar;.\build\dist
\beast-beagle.jar dr.app.beast.BeastMain -beagle -beagle_GPU -
beagle_order 1,1,2,2,0,0 name.of.your.input.file.xml

-Chris

Reply all
Reply to author
Forward
0 new messages