Difference between revisions of "Compiling"

(Added build instructions specific to debian/ubuntu)
 
(tighten up the steps a bit, remove installation, clarify which are optional for the vm)
 
(27 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
= Compiling BRL-CAD =
 
= Compiling BRL-CAD =
  
BRL-CAD source files contain an INSTALL file with general instructions.  This page contains tips for building on specific systems.
+
This page contains simplified steps for building '''''quickly'''''.
  
== Debian / Ubuntu ==
+
== Install Dev Tools ==
 +
 
 +
''If you downloaded the virtual machine disk image, skip this step.''
 +
 
 +
BRL-CAD uses the CMake build system and may be built with most compilers, so first step is to [http://www.cmake.org/cmake/resources/software.html download and install CMake].  If needed, compiling from their source distribution is actually very easy.
 +
 
 +
If you're on some other Debian/Ubuntu system, you can install pretty much everything you might want with aptitude:
  
=== Tools ===
 
 
<pre>
 
<pre>
aptitude install build-essential libtool
+
aptitude install build-essential make cmake
 
</pre>
 
</pre>
  
=== Library dependencies ===
+
== Install Dependencies ==
 +
 
 +
''If you downloaded the virtual machine disk image, skip this step.''
 +
 
 +
If you're on a Mac or Windows, you're good to go.  For Linux, BSD, and other package-managed systems, you'll want to install a few things.
 +
 
 +
Here's some of them for Debian/Ubuntu-style Linux:
  
 
<pre>
 
<pre>
aptitude install libxi-dev libncursesw5-dev libxt-dev libxslt1-dev libxmu-dev libxmu-headers byacc flex libtnt-dev libxext-dev libpng12-dev zlib1g-dev libsm-dev libx11-dev libxau-dev tk8.5-dev tcl8.5-dev tk8.4-dev tcl8.4-dev itcl3-dev
+
aptitude install sed byacc flex xsltproc
 +
aptitude install libncursesw5-dev libfontconfig-dev  
 +
aptitude install xserver-xorg-dev
 +
aptitude install libx11-dev libxi-dev libxt-dev libxau-dev libxext-dev libxmu-dev libxmu-headers
 
</pre>
 
</pre>
  
=== Configure ===
+
== Download BRL-CAD ==
 +
 
 +
''If you downloaded the virtual machine disk image, run this to make sure you have the latest sources:''
 
<pre>
 
<pre>
./configure --enable-optimized --enable-iwidgets-build --enable-libblt-build --enable-libtkimg-build --enable-nx-build --enable-models
+
svn up brlcad-svn-trunk
 
</pre>
 
</pre>
  
=== Make and Install ===
+
For everyone else, we recommend obtaining the latest sources from our repository:
 
<pre>
 
<pre>
make
+
svn checkout svn://svn.code.sf.net/p/brlcad/code/brlcad/trunk brlcad-svn-trunk
sudo make install
+
 
</pre>
 
</pre>
  
=== Troubleshooting ===
+
If you run into trouble, snapshot release sources may also be obtained from [https://sourceforge.net/projects/brlcad/files/BRL-CAD%20Source/ Sourceforge].
  
If make returns an error complaining that libitk.la cannot be found, make sure you have libtool installed then do:
+
== Configure your Build ==
 +
 
 +
Next, set up a build directory and configure your compilation:
  
 
<pre>
 
<pre>
./autogen.sh
+
cd brlcad-svn-trunk
make noprod
+
mkdir .build
 +
cd .build
 +
cmake .. -DBRLCAD_ENABLE_STRICT=NO -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release
 +
</pre>
 +
 
 +
By default, our build enforces code standards that will halt on trivial issues, so we recommend turning off that strict behavior for your first compile. By default, it will also search your system for dependencies, but this can be complicated so we tell the build to use our bundled versions.  When you graduate to doing development, you'll want to change the build type to -DCMAKE_BUILD_TYPE=Debug instead of Release.
 +
 
 +
BRL-CAD source files contain an [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/INSTALL INSTALL] file with more detailed instructions if you want to customize the build.
 +
 
 +
== Compile ==
 +
 
 +
You're good to go, now it's time to compile:
 +
<pre>
 
make
 
make
 
</pre>
 
</pre>
  
=== History ===
+
Compilation can take anywhere from a couple minutes to an hour depending on your hardware.  If you had a quad-core CPU, you might run '"make -j4" to request compiling in parallel.
These tips gleaned from [http://www.linuxquestions.org/questions/linux-software-2/brl-cad-7.14.6-compilation-fails-on-debian-lenny-stable-pentium-6-722382/ knudfl] and [http://ibot.rikers.org/%23brlcad/20080906.html.gz #brlcad]Tested by JamesVasile on Ubuntu Itrepid with BRL-CAD 7.14.8.
+
 
 +
If the build fails, re-run make while capturing all output to a log: make > build.log 2>&1
 +
Please report any build failures.
 +
 
 +
== Run! ==
 +
 
 +
You don't have to install to run BRL-CAD. You can just run the binaries you just finished compiling. They are in the brlcad/.build/bin directory. There are 400+ tools in BRL-CAD.  Here's a couple to get started:
 +
 
 +
<pre>
 +
bin/benchmark run
 +
bin/mged
 +
bin/archer
 +
</pre>
 +
 
 +
The first command will evaluate your system performance. If you made a Release build, please submit your benchmark results to benchmark at brlcad dot org.
 +
 
 +
The second command runs the main graphical interfaceBe sure to check out the extensive [[Documentation]] and [[Main_Page]] for tutorials.
 +
 
 +
The third runs our newer graphical interface that is under development.
 +
 
 +
== What now? ==
 +
 
 +
Help make BRL-CAD better!  There are many ways you can contribute to open source and you don't need to be an experienced programmer. We do need software developers, but we also need artists, writers, designers, and managers.
 +
 
 +
See [[Contributor Quickies]] for really easy ways to get started!

Latest revision as of 17:06, 16 September 2014

Compiling BRL-CAD[edit]

This page contains simplified steps for building quickly.

Install Dev Tools[edit]

If you downloaded the virtual machine disk image, skip this step.

BRL-CAD uses the CMake build system and may be built with most compilers, so first step is to download and install CMake. If needed, compiling from their source distribution is actually very easy.

If you're on some other Debian/Ubuntu system, you can install pretty much everything you might want with aptitude:

aptitude install build-essential make cmake

Install Dependencies[edit]

If you downloaded the virtual machine disk image, skip this step.

If you're on a Mac or Windows, you're good to go. For Linux, BSD, and other package-managed systems, you'll want to install a few things.

Here's some of them for Debian/Ubuntu-style Linux:

aptitude install sed byacc flex xsltproc
aptitude install libncursesw5-dev libfontconfig-dev 
aptitude install xserver-xorg-dev
aptitude install libx11-dev libxi-dev libxt-dev libxau-dev libxext-dev libxmu-dev libxmu-headers

Download BRL-CAD[edit]

If you downloaded the virtual machine disk image, run this to make sure you have the latest sources:

svn up brlcad-svn-trunk

For everyone else, we recommend obtaining the latest sources from our repository:

svn checkout svn://svn.code.sf.net/p/brlcad/code/brlcad/trunk brlcad-svn-trunk

If you run into trouble, snapshot release sources may also be obtained from Sourceforge.

Configure your Build[edit]

Next, set up a build directory and configure your compilation:

cd brlcad-svn-trunk
mkdir .build
cd .build
cmake .. -DBRLCAD_ENABLE_STRICT=NO -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release

By default, our build enforces code standards that will halt on trivial issues, so we recommend turning off that strict behavior for your first compile. By default, it will also search your system for dependencies, but this can be complicated so we tell the build to use our bundled versions. When you graduate to doing development, you'll want to change the build type to -DCMAKE_BUILD_TYPE=Debug instead of Release.

BRL-CAD source files contain an INSTALL file with more detailed instructions if you want to customize the build.

Compile[edit]

You're good to go, now it's time to compile:

make

Compilation can take anywhere from a couple minutes to an hour depending on your hardware. If you had a quad-core CPU, you might run '"make -j4" to request compiling in parallel.

If the build fails, re-run make while capturing all output to a log: make > build.log 2>&1 Please report any build failures.

Run![edit]

You don't have to install to run BRL-CAD. You can just run the binaries you just finished compiling. They are in the brlcad/.build/bin directory. There are 400+ tools in BRL-CAD. Here's a couple to get started:

bin/benchmark run
bin/mged
bin/archer

The first command will evaluate your system performance. If you made a Release build, please submit your benchmark results to benchmark at brlcad dot org.

The second command runs the main graphical interface. Be sure to check out the extensive Documentation and Main_Page for tutorials.

The third runs our newer graphical interface that is under development.

What now?[edit]

Help make BRL-CAD better! There are many ways you can contribute to open source and you don't need to be an experienced programmer. We do need software developers, but we also need artists, writers, designers, and managers.

See Contributor Quickies for really easy ways to get started!