Editing Compiling

Warning: You are not logged in.

Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 
= Compiling BRL-CAD =
 
= Compiling BRL-CAD =
  
This page contains simplified steps for building '''''quickly'''''.
+
BRL-CAD source files contain an [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/INSTALL INSTALL] file with general instructions.  This page contains simplified tips for building '''''quickly'''''.
  
== Install Dev Tools ==
+
== Obtain Dev Tools ==
  
''If you downloaded the virtual machine disk image, skip this step.''
+
If you downloaded the virtual machine disk image, YOU DON'T NEED TO INSTALL ANYTHING ELSE.  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.
+
BRL-CAD uses the CMake build system and will compile with most compilers, so first up is to [http://www.cmake.org/cmake/resources/software.html download and install it].  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:
 
If you're on some other Debian/Ubuntu system, you can install pretty much everything you might want with aptitude:
Line 13: Line 13:
 
<pre>
 
<pre>
 
aptitude install build-essential make cmake
 
aptitude install build-essential make cmake
</pre>
 
 
== 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>
 
 
aptitude install sed byacc flex xsltproc
 
aptitude install sed byacc flex xsltproc
 
aptitude install libncursesw5-dev libfontconfig-dev  
 
aptitude install libncursesw5-dev libfontconfig-dev  
Line 29: Line 18:
 
aptitude install libx11-dev libxi-dev libxt-dev libxau-dev libxext-dev libxmu-dev libxmu-headers
 
aptitude install libx11-dev libxi-dev libxt-dev libxau-dev libxext-dev libxmu-dev libxmu-headers
 
</pre>
 
</pre>
 +
 +
If you're on a Mac or Windows, you just need to install CMake and developer tools.
  
 
== Download BRL-CAD ==
 
== Download BRL-CAD ==
  
''If you downloaded the virtual machine disk image, run this to make sure you have the latest sources:''
+
If you downloaded the virtual machine disk image, WE ALREADY DID THIS FOR YOU.  Run "'''svn up brlcad-svn-trunk'''" and you'll find the latest source code in that brlcad-svn-trunk directory.
<pre>
+
 
svn up brlcad-svn-trunk
+
Release sources may be obtained from [https://sourceforge.net/projects/brlcad/files/BRL-CAD%20Source/ Sourceforge] or directory from Subversion:
</pre>
+
  
For everyone else, we recommend obtaining the latest sources from our repository:
 
 
<pre>
 
<pre>
svn checkout svn://svn.code.sf.net/p/brlcad/code/brlcad/trunk brlcad-svn-trunk
+
svn checkout svn://svn.code.sf.net/p/brlcad/code/brlcad/trunk brlcad
 +
cd brlcad
 
</pre>
 
</pre>
  
If you run into trouble, snapshot release sources may also be obtained from [https://sourceforge.net/projects/brlcad/files/BRL-CAD%20Source/ Sourceforge].
+
== Configure ==
  
== Configure your Build ==
+
Next, we set up a build directory and configure our compilation.  BRL-CAD adhere's to a high conformance standard and considers most warnings as errors, so we turn off that strict behavior just so the build doesn't halt on trivialities.
  
Next, set up a build directory and configure your compilation:
+
We could add -DCMAKE_BUILD_TYPE=Release to get an optimized build or -DCMAKE_BUILD_TYPE=Debug to get one better suited for development work.
  
 
<pre>
 
<pre>
cd brlcad-svn-trunk
 
 
mkdir .build
 
mkdir .build
 
cd .build
 
cd .build
cmake .. -DBRLCAD_ENABLE_STRICT=NO -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release
+
cmake .. -DBRLCAD_BUNDLED_LIBS=ON
 
</pre>
 
</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.
+
== Compile ==
  
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.
+
Compilation will usually 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.
  
== Compile ==
 
 
You're good to go, now it's time to compile:
 
 
<pre>
 
<pre>
 
make
 
make
 +
make test
 
</pre>
 
</pre>
  
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.
+
We run make test to see if all went well.  If the build fails, it can be helpful to run make again capturing output to a log file.  E.g., make > build.log 2>&1
  
If the build fails, re-run make while capturing all output to a log: make > build.log 2>&1
+
== Install ==
Please report any build failures.
+
  
== Run! ==
+
Depending on the version of sources you start with, BRL-CAD should install into /usr/brlcad/SUBDIR where SUBDIR is rel-VERSION or dev-VERSION.  
 
+
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>
 
<pre>
bin/benchmark run
+
sudo make install
bin/mged
+
ls -la /usr/brlcad
bin/archer
+
/usr/brlcad/*/bin/mged
 
</pre>
 
</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.
+
== Quick test ==
  
The second command runs the main graphical interface. Be sure to check out the extensive [[Documentation]] and [[Main_Page]] for tutorials.
+
You don't have to install, though, and can just run binaries that are in the brlcad/.build/bin directory.
  
The third runs our newer graphical interface that is under development.
+
<pre>
 
+
bin/benchmark
== What now? ==
+
bin/mged
 
+
</pre>
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!
+
That's it!  If you have a Release compile, you can submit your benchmark results to benchmark at brlcad dot org.  Be sure to check out the extensive [[Documentation]] and [[Main_Page]] for tutorials and [[Contributor Quickies]] for ways to get involved!

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)