Difference between revisions of "Building from SVN"
(→Obtain the sources via Subversion) |
(→Configure the build system with CMake) |
||
Line 14: | Line 14: | ||
== Configure the build system with CMake == | == Configure the build system with CMake == | ||
− | BRL-CAD also requires the build tool CMake. | + | BRL-CAD also requires the build tool CMake. Most Linux/BSD/UNIX systems provide a package for CMake. For platforms that do not, CMake is available from http://www.cmake.org |
− | For Linux/Mac/BSD, | + | Once installed, create a directory where you will compile BRL-CAD and run CMake. |
+ | |||
+ | For Linux/Mac/BSD, this looks like: | ||
cd brlcad | cd brlcad | ||
Line 25: | Line 27: | ||
For Windows, you can use the CMake GUI where you specify build and source directories:[[File:Running_cmake_on_windows.png|200px|thumb|right|Running CMake GUI on Windows]] | For Windows, you can use the CMake GUI where you specify build and source directories:[[File:Running_cmake_on_windows.png|200px|thumb|right|Running CMake GUI on Windows]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Compile and test your build == | == Compile and test your build == |
Revision as of 13:53, 2 December 2019
Contents
Obtain the sources via Subversion
For Linux/Mac/BSD:
svn checkout https://svn.code.sf.net/p/brlcad/code/brlcad/trunk brlcad
Note: If you do not yet have an SVN client installed, go to http://subversion.tigris.org for information on obtaining an appropriate SVN client for your platform. Most modern Linux/BSD/UNIX distributions will also have SVN available in their package repositories.
For Windows:
Install a Subversion client for Windows, such as TortoiseSVN: https://sourceforge.net/projects/tortoisesvn/
To get a checkout after installing TortoiseSVN, right-click in a folder where you want to download the sources, select SVN Checkout and specify https://svn.code.sf.net/p/brlcad/code/brlcad/trunk for the repository URL.
Configure the build system with CMake
BRL-CAD also requires the build tool CMake. Most Linux/BSD/UNIX systems provide a package for CMake. For platforms that do not, CMake is available from http://www.cmake.org
Once installed, create a directory where you will compile BRL-CAD and run CMake.
For Linux/Mac/BSD, this looks like:
cd brlcad mkdir build cd build cmake .. (for a default build) cmake .. -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release (for a release build)
For Windows, you can use the CMake GUI where you specify build and source directories:
Compile and test your build
On Linux/Mac/BSD, run this in your build directory:
make
At this point, you should have a fully installed and working system. You can test things by doing:
make test make benchmark
Both the test and benchmark should report successfully if everything is working correctly. Report any failures to the BRL-CAD bug tracker.
On Windows, open the BRLCAD solution and Compile.
Doxygen
If you have doxygen installed somewhere CMake can find it, then you can build a browsable XHTML documentation of the source code. This is useful if you want to use BRL-CAD's libraries directly, or if you just want a better overview of how things are structured.
To build the XHTML files on a UNIX system, run (from your build directory)
make dox
and then open doc/doxygen_output/html/index.xhtml with your web browser of choice
Install
On Linux/Mac/BSD, run this in your build directory:
make install
If you created a prefix as described above for multiple versions or multiple architectures, you should now create your symbolic links for user convenience and consistency. Example where /usr/brlcad/rel-7.8.0/mips32 was used as the install_dir prefix:
% ln -s rel-7.8.0/mips32 /usr/brlcad/stable % ln -s stable/bin /usr/brlcad/bin % ln -s stable/include /usr/brlcad/include % ln -s stable/lib /usr/brlcad/lib % ln -s stable/man /usr/brlcad/man % ln -s stable/share /usr/brlcad/share % ls -l /usr/brlcad total 48 lrwxr-xr-x 1 root wheel 10 12 Apr 09:00 bin -> stable/bin lrwxr-xr-x 1 root wheel 14 12 Apr 09:00 include -> stable/include lrwxr-xr-x 1 root wheel 10 12 Apr 09:00 lib -> stable/lib lrwxr-xr-x 1 root wheel 10 12 Apr 09:00 man -> stable/man drwxr-xr-x 7 root wheel 238 11 Apr 18:00 rel-7.8.0 lrwxr-xr-x 1 root wheel 12 12 Apr 09:00 share -> stable/share lrwxr-xr-x 1 root wheel 9 12 Apr 09:00 stable -> rel-7.8.0/mips32
Future versions of BRL-CAD may provide this symbolic link operation for you as a CMake configuration option.
On Windows:
You can run directly from the build directory. Browse to the "bin" directory from the GUI or from cmd.exe and run applications (e.g., mged).
Setup environment (optional)
At this point, everything should be ready for use. If the default prefix of /usr/brlcad was used or if the corresponding symbolic links were created, users should only need to add /usr/brlcad/bin to their PATH in order to find binaries for the package (optionally setting their MANPATH as well):
For bash:
export PATH=/usr/brlcad/bin:$PATH export MANPATH=/usr/brlcad/man:$MANPATH
For csh/tcsh:
set path=( /usr/brlcad/bin $path ) setenv MANPATH /usr/brlcd/man:$MANPATH rehash
If users do not want to modify their PATH, they can get by providing the full path to the binaries (e.g. /usr/brlcad/bin/mged). To find BRL-CAD manual pages without setting your MANPATH, use the provided "brlman" binary instead of "man".
Test installation
If everything went well, there should now be more than 400 command-line applications at your disposal for processing images and geometry. A quick test of functionality (and performance) is to run the BRL-CAD benchmark again, which is installed as the benchmark tool:
benchmark
Additionally, you can run the MGED solid modeler:
mged