Difference between revisions of "Building from SVN"

m (Reverted edits by AbbyStokes (Talk); changed back to last version by Willdye)
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
== Obtain the sources ==
+
== Obtain the sources via Subversion ==
  
 
BRL-CAD has recently [[Cvs2svn|switched from CVS to the Subversion system]]. In the new system some of the earlier complexities inherent to CVS are gone, no ''-dP'' option is required and developers will not need their passwords or usernames until it is time to commit a change.
 
BRL-CAD has recently [[Cvs2svn|switched from CVS to the Subversion system]]. In the new system some of the earlier complexities inherent to CVS are gone, no ''-dP'' option is required and developers will not need their passwords or usernames until it is time to commit a change.
  
For non-developers:
+
For Linux/Mac/BSD:
<pre>svn checkout https://brlcad.svn.sourceforge.net/svnroot/brlcad/brlcad/trunk brlcad</pre>
+
<pre>svn checkout https://svn.code.sf.net/p/brlcad/code/brlcad/trunk brlcad</pre>
  
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 distributions will also have SVN available in their package repositories.
+
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.
  
== Generate the configure script ==
+
For Windows:
cd brlcad
+
./autogen.sh
+
  
If autogen.sh reports that the build system is NOT ready and it's not clear why, rerun autogen.sh in verbose mode:
+
Install a Subversion client for Windows, such as TortoiseSVN: https://sourceforge.net/projects/tortoisesvn/
./autogen.sh --verbose
+
For example, if you're running Ubuntu and you don't have autoconf installed, you may need to run the command "sudo apt-get install autoconf", and then try to run autogen.sh again.  You may need to also install "libtool" or some other package.
+
=== An example generating the configure script on Mac OS X ===
+
You need to do " sudo port install libtool" to get GNU version of libtool.
+
imac:brlcad username$ sudo ln -s /usr/local/bin/glibtoolize /usr/bin/libtoolize
+
Password:
+
imac:brlcad username$ ./autogen.sh
+
Preparing the BRL-CAD build system...please wait
+
+
Found GNU Autoconf version 2.61
+
Found GNU Automake version 1.10
+
Found GNU Libtool version 1.5.26
+
+
Automatically preparing build ... done
+
+
The BRL-CAD build system is now prepared.  To build here, run:
+
  ./configure
+
  make
+
imac:brlcad username$
+
  
== Configure the build system ==
+
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 --help
+
./configure --prefix=[install_dir] --enable-optimized --enable-all
+
  
When building for multiuser file servers it is often useful to make the install_dir reflect the version and/or architecture of the compile.  An example would be "--prefix=/usr/brlcad/rel-7.20.2" to install into a /usr/brlcad/rel-7.20.2 directory.  This way a single system can have multiple versions of BRL-CAD installed or multiple binary formats for various architectures if installing on a network file system.  Symbolic links are then usually added to point to the "current" or "main" version that is preferable to provide so that users only need to add /usr/brlcad/bin to their path. Examples include:
+
 
 +
== Configure the build system with CMake ==
 +
 
 +
BRL-CAD also requires the build tool CMake.  Again, most Linux/BSD/UNIX distributions will provide a package for CMake - for platforms that do not, CMake is available from http://www.cmake.org
 +
 
 +
For Linux/Mac/BSD, create a build directory and run cmake:
 +
 
 +
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:[[File:Running_cmake_on_windows.png|200px|thumb|right|Running CMake GUI on Windows]]
 +
 +
When building for multiuser file servers it is often useful to make the install_dir reflect the version and/or architecture of the compile.  An example would be "-DCMAKE_INSTALL_PREFIX=/usr/brlcad/rel-7.20.2" to install into a /usr/brlcad/rel-7.20.2 directory. (When CMAKE_BUILD_TYPE is set to Release, the installation directory automatically is assigned the appropriate directory and the user doesn't have to do so manually.) This way a single system can have multiple versions of BRL-CAD installed or multiple binary formats for various architectures if installing on a network file system.  Symbolic links are then usually added to point to the "current" or "main" version that is preferable to provide so that users only need to add /usr/brlcad/bin to their path. Examples include:
  
 
;By version
 
;By version
Line 54: Line 46:
  
 
IMPORTANT!!! - Because BRL-CAD has such a long development history, it predates some library naming conventions in modern operating systems. This means an attempt to configure for an install in the "/usr" path on Linux (for example) will stand a good chance of damaging important system libraries - e.g. BRL-CAD libraries put in "/usr/lib" may overwrite system libraries with the same names. Using "/usr/brlcad" or "/opt/brlcad" means all installed files will be safely contained in the brlcad directory.
 
IMPORTANT!!! - Because BRL-CAD has such a long development history, it predates some library naming conventions in modern operating systems. This means an attempt to configure for an install in the "/usr" path on Linux (for example) will stand a good chance of damaging important system libraries - e.g. BRL-CAD libraries put in "/usr/lib" may overwrite system libraries with the same names. Using "/usr/brlcad" or "/opt/brlcad" means all installed files will be safely contained in the brlcad directory.
 +
  
 
== Compile and test your build ==
 
== Compile and test your build ==
 +
 +
On Linux/Mac/BSD, run this in your build directory:
 +
 
  make
 
  make
  
Line 64: Line 60:
  
 
Both the test and benchmark should report successfully if everything is working correctly. Report any failures to the BRL-CAD [http://sourceforge.net/tracker/?group_id=105292&atid=640802 bug tracker].
 
Both the test and benchmark should report successfully if everything is working correctly. Report any failures to the BRL-CAD [http://sourceforge.net/tracker/?group_id=105292&atid=640802 bug tracker].
 +
 +
On Windows, open the BRLCAD solution and Compile.
 +
  
 
== Install ==
 
== Install ==
 +
 +
On Linux/Mac/BSD, run this in your build directory:
 +
 
  make install
 
  make install
  
Line 86: Line 88:
 
lrwxr-xr-x  1 root  wheel    9 12 Apr 09:00 stable -> rel-7.8.0/mips32</pre>
 
lrwxr-xr-x  1 root  wheel    9 12 Apr 09:00 stable -> rel-7.8.0/mips32</pre>
  
''Future versions of BRL-CAD may provide this symbolic link operation for you as a configure option. Keep an eye out in the configure --help output.''
+
''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) ==
 
== 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):
 
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):
  
Line 103: Line 111:
  
 
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".
 
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 ==
 
== 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:
 
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:
  

Latest revision as of 23:32, 4 January 2018

Obtain the sources via Subversion[edit]

BRL-CAD has recently switched from CVS to the Subversion system. In the new system some of the earlier complexities inherent to CVS are gone, no -dP option is required and developers will not need their passwords or usernames until it is time to commit a change.

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[edit]

BRL-CAD also requires the build tool CMake. Again, most Linux/BSD/UNIX distributions will provide a package for CMake - for platforms that do not, CMake is available from http://www.cmake.org

For Linux/Mac/BSD, create a build directory and run cmake:

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:
Running CMake GUI on Windows

When building for multiuser file servers it is often useful to make the install_dir reflect the version and/or architecture of the compile. An example would be "-DCMAKE_INSTALL_PREFIX=/usr/brlcad/rel-7.20.2" to install into a /usr/brlcad/rel-7.20.2 directory. (When CMAKE_BUILD_TYPE is set to Release, the installation directory automatically is assigned the appropriate directory and the user doesn't have to do so manually.) This way a single system can have multiple versions of BRL-CAD installed or multiple binary formats for various architectures if installing on a network file system. Symbolic links are then usually added to point to the "current" or "main" version that is preferable to provide so that users only need to add /usr/brlcad/bin to their path. Examples include:

By version
/usr/brlcad/rel-7.8.0 (release 7.8.0)
/usr/brlcad/rel-7.6.0 (release 7.6.0)
By architecture
/usr/brlcad/ia32 (linux on Pentium)
/usr/brlcad/ia64 (linux on Itanium)
/usr/brlcad/x86_64 (linux on Opteron)
By version and architecture
/usr/brlcad/rel-7.8.0/mips32 (IRIX on MIPS in 32-bit mode, release 7.8.0)
/usr/brlcad/rel-7.8.0/mips64 (IRIX on MIPS in 64-bit mode, release 7.8.0)
/usr/brlcad/rel-7.8.2/mips32 (IRIX on MIPS in 32-bit mode, release 7.8.2)

IMPORTANT!!! - Because BRL-CAD has such a long development history, it predates some library naming conventions in modern operating systems. This means an attempt to configure for an install in the "/usr" path on Linux (for example) will stand a good chance of damaging important system libraries - e.g. BRL-CAD libraries put in "/usr/lib" may overwrite system libraries with the same names. Using "/usr/brlcad" or "/opt/brlcad" means all installed files will be safely contained in the brlcad directory.


Compile and test your build[edit]

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.


Install[edit]

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)[edit]

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[edit]

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