BRL-CAD on Linux README
=======================

Below are installation and platform notes of relevance to particular
Linux distributions.

Table of Contents
-----------------
Parallel Builds
64-bit Compile
32-bit Compile
Arch Linux
Ubuntu/Debian
PPC64 Linux

Parallel Builds
---------------
BRL-CAD compilation can take advantage of multiple CPUs.  With
Make based builds, this is done using the "-j" flag - e.g. a
six core machine will build faster using "make -j6" to utilize
all cores.


64-bit Compile (on a platform that defaults to 32-bit)
--------------

cmake ../brlcad -DBRLCAD_WORD_SIZE=32BIT

32-bit Compile (on a platform that defaults to 64-bit)
--------------

cmake ../brlcad -DBRLCAD_WORD_SIZE=64BIT

* Note that in both of the above situations you need both a compiler that
works in the alternate mode and system libraries of the correct type.


Arch Linux
----------

An example PKGBUILD and needed scripts are provided in misc/archlinux.
Review and edit the PKGBUILD to suit your preferred configuration and
build situation (e.g. building from a tarball vs building from SVN).
Run `makepkg` in that directory to build the package.


Ubuntu/Debian
-------------

Users of Ubuntu, Debian, and other similar packaging distributions of
Linux will need to ensure that a few essentials are in place before
you will be able to compile BRL-CAD.

Following the build instructions in the INSTALL file.  You will need:

gcc (3+, e.g. 4.0.3)
g++ (3+, e.g. 4.0.3)
make (e.g. gnu make 3.8.0)
cmake (2.8.3 or newer)

All three of those have implicit dependencies on other packages.

You will also want to make sure that you have the X11 development
headers installed:

  apt-get install xserver-xorg-dev libx11-dev libxi-dev libxext-dev

Other development packages needed to build on Debian-based platforms:

  for building the Tcl/Tk libraries:  libfontconfig-dev

  for OpenGL: libglu1-mesa-dev

Note there is a supported Debian package generation script in file
'sh/make_deb.sh' which can function only on a Debian or Ubuntu system.
It can be used like so:

  $ cd <BRL-CAD source directory>

  # get help for the script:
  $ ./sh/make_deb.sh

  # create a binary package:
  $ ./sh/make_deb.sh -b

You can customize the script's cmake build options by modifying the
file 'misc/debian/rules'.  Note that the BRL-CAD source directory
should be deleted and recreated for each new attempt at package
generation.


Redhat/Fedora
-------------

Development packages needed to build on Redhat/Fedora platforms:

libXext-devel
libXi-devel
freetype-devel
fontconfig-devel


To determine what particular version of Redhat or Fedora you are
using, check these files:

cat /etc/redhat-release
cat /etc/fedora-release

Note there is a supported rpm package generation script in file
'sh/make_rpm.sh' which can only function on a Fedora or openSUSE
system.  It can be used like so:

  $ cd <BRL-CAD source directory>

  # create an rpm file:
  $ ./sh/make_rpm.sh

It is also possible to create an RPM package using CPack with the
make package build target, on systems with the proper RPM tools.

PPC64 Linux
-----------

If you happen to be installing on a ppc64 Linux system, the binaries
may not resolve correctly without being installed first.  Be sure to
install before testing applications (i.e., even before running the
benchmark or "make test").
