Lattice Builder
Software Package for Constructing Rank-1 Lattices
|
Building Lattice Builder consists of the following steps:
Compiling Lattice Builder requires a C++ compiler that partially supports the C++11 standard, such as g++ from the GNU Compiler Collection version 4.7 or later.
The C++11 features that Lattice Builder uses are:
The Lattice Builder library depends on the following Boost libraries:
In addition to these, the Lattice Builder command-line tool also depends on the following Boost libraries:
Only the Program Options and Chrono libraries require building and linking; the others are header-only libraries.
Installation instructions for the Boost libraries can be found on the Getting Started page for Unix variants or for Microsoft Windows.
Alternatively, you can customize and run the script install-boost.sh
that can found under the scripts
directory with the source code.
The fast CBC implementation of Lattice Builder depends on the FFTW library.
In order to facilitate cross-platform compatibility, Lattice Builder uses Boost.Build as its build system (installation instructions). The nightly-build version is recommended.
If you installed Boost.Build as indicated to some prefix B2_PREFIX
, the installation system should have created the file B2_PREFIX/share/boost-build/site-config.jam
. Make sure that it contains at least a line that indicates which default toolset should be used. On Linux systems, this line should look like:
The space before the semicolon is important.
To check if Boost.Build is installed and available in the path, try either:
or
replacing /path/to
with the actual path to which Boost.Build was installed.
To compile Lattice Builder, Boost.Build needs to know where to find the Boost header files and how to link to the Boost and FFTW libraries. These settings are specific to the platform on which Lattice Builder is to be built and should be customized in the file B2_PREFIX/share/boost-build/site-config.jam
, where B2_PREFIX
is the directory under which Boost.Build was installed. If the file cannot be found at that location, it can be created if the user has proper access permissions (otherwise see User-Specific Configuration (optional)). If all libraries are installed under standard paths, the site-config.jam
file can only contain:
Otherwise, the following site-config.jam
file could be customized with the following content:
To use this this configuration file, the environment variables BOOST_PREFIX and FFTW_PREFIX should be set to point to the directories under which the Boost and FFTW libraries are installed, respectively. The specification for lib rt
indicates that the rt
library should always be linked to as a shared library. The specification for lib boost_chrono
indicates that it depends on lib boost_system
and on lib rt
. The spaces around the colons and before the semicolons are important.
The compilation process generates object files before linking them together into an executable program. Boost.Build can be told to put these temporary object files in any desired directory by changing the project
line, for instance, to:
which would put them in /tmp/b2
. As a more sophisticated example, we could put them into /tmp/$USER/b2
, where $USER
is the current user name, with:
As an alternative to editing site-config.jam
, the customizations explained in Site-Specific Configuration can be applied to the user-config.jam
file, which Boost.Build attempts to find at the root of the user's home directory. In that case, the library aliases in the project-config.jam
file, which can be found at the Lattice Builder project's root directory, must be updated by replacing every occurrence of site-config
with user-config
. For example,
should be replaced with
Finally, the appropriate compiler flags should set in project-config.jam
to support the C++11 standard:
where FLAGS
is the placeholder for those flags. For example, with GCC 4.7, this line would be:
Change the current directory to the root directory of the package, which contains the tools
and latbuilder
subdirectories. First, the tcode
utility, which produces C++ header files out of TeX code, must be built with:
Then, if everything is configured correctly, the following command will build the Lattice Builder library and command-line tool:
with /installation/path
replaced with the directory into which Lattice Builder should be installed. To check that the program installed correctly, try:
Help on usage can be obtained by replacing the –version
switch with the –help
switch.
To build using multiple processes in parallel, the -j
switch with the number of processes as its argument can be added to the b2
command. For example:
would build Lattice Builder using 4 different threads in parallel.
An example Jamfile and Makefile to build a project that uses the Lattice Builder application programming interface (API) can be found under /installation/path/share/doc/examples/myproject
.
A lot of example code using the Lattice Builder API can be found under the latbuilder/examples
directory of the source package and in its subdirectories.
sed 'a\ '
, then by using a text search function to locate the "error:" string.