Skip to content

LinuxInstallInstructions

Marc Suchard edited this page Mar 11, 2024 · 12 revisions

Installing BEAGLE on Linux

To install BEAGLE on Linux-based operating systems you will need to build BEAGLE from source.

You can either do this in the manual approach -as described below- or use an automated tool such as EasyBuild, especially useful if you are into the business of using alternative compilers and toolchains, including GPUs etc: Example build options: https://github.com/hpcugent/easybuild-easyconfigs/tree/master/easybuild/easyconfigs/b/beagle-lib

Installing from source

Step 1. Obtain prerequisites

You will need the following software to download and build BEAGLE from source:

  • gcc (or other equivalent compiler)
  • cmake
  • autoconf
  • automake
  • libtool
  • subversion
  • pkg-config

Additionally we recommended installing the following optional prerequisites:

  • OpenCL implementations for your hardware resources
  • NVIDIA CUDA drivers and toolkit (if you want to use BEAGLE with CUDA on an NVIDIA GPU)
  • Java JDK (if you want to use BEAGLE with BEAST)

The prerequisite software should be fairly easy to install. On Ubuntu and other Debian Linux distributions all the requisite software can be obtained via apt-get:

sudo apt-get install cmake build-essential autoconf automake libtool git pkg-config openjdk-11-jdk

OpenCL implementations are available from:

The NVIDIA CUDA drivers and toolkit can be downloaded from http://www.nvidia.com/object/cuda_get.html. They need to be installed for BEAGLE to use CUDA for GPU acceleration.

Step 2. Build from the source repository

git clone --depth=1 https://github.com/beagle-dev/beagle-lib.git
cd beagle-lib
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME ..
make install

This will compile and install the library into $HOME/lib, you can find them by ls -lt $HOME/lib/*beagle*.

The default installation will compile all available BEAGLE variants based on the detected system resources where CPU variant is always built and GPU version has two possible variants (cuda-variant and OpenCL-variant). We recommend using cuda-variant if you are using NVIDIA GPU cards by replacing the line

cmake ..

with

cmake -DBUILD_OPENCL=OFF ..

Similarly, you can choose to turn off cuda build by

cmake -DBUILD_CUDA=OFF ..

or turn off both cuda and opencl builds by

cmake -DBUILD_CUDA=OFF -DBUILD_OPENCL=OFF ..

Optionally, you can turn off building the JNI component (which generates the java native interface to call beagle from java) by

cmake -DBUILD_JNI=OFF ..

Step 3. Set environment variables

If you followed the instructions above, then BEAGLE was installed to your home directory. You'll need to tell other programs to find the beagle library in your home directory by setting the LD_LIBRARY_PATH environment variable:

export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH

Or if using tcsh:

setenv LD_LIBRARY_PATH $HOME/lib:$LD_LIBRARY_PATH

That command will need to be run every time you log in, so it's best to put it in a login script such as .bashrc or .profile or .cshrc, etc.

If you plan to build other applications that depend on beagle, you'll also need be sure BEAGLE is in your pkg-config path:

export PKG_CONFIG_PATH=$HOME/lib/pkgconfig:$PKG_CONFIG_PATH

This too can be put in a login script.

For instructions on how to use BEAGLE with BEAST please refer to Using BEAGLE with BEAST