Next: , Previous: Introduction, Up: Top


3 Installing the SOLID SDK

3.1 Requirements

The SOLID library (libsolid) and the broad-phase library (libbroad) have a standard C API and can be linked to both C and C++ applications. Note that libsolid and libbroad are internally coded in C++ and thus need the libstdc++ library on Unix platforms (link using g++ rather than gcc). The mathematics toolkit (MT) is coded in standard C++ and uses templates extensively. The source code compiles under GNU g++ version 2.95 and higher and Microsoft Visual C++ version 6.0 SP4 and higher.

3.2 Installation

All header files that export types and functions are stored in the `include' directory. Source files are stored in the `src' directory. On a Unix-like operating system, a `configure' script generated by the GNU build tools (automake, autoconf, libtool) is used for creating the Makefiles. Simply type `./configure' followed by `make' in the root of the SOLID distribution directory to build the SOLID lib and example programs. Typing `make install' installs the SOLID library header files and binaries as well as this documentation in `/usr/local'. Note that you usually must have root privileges for adding items to `/usr/local'. See `./configure --help' for installing the library in a different location. The SOLID library can be built under Microsoft Visual C++ 6.0 and higher using the workspace (.dsw) and project (.dsp) files found in the `VisualC6' directory. For use with Visual C++ 7.0 and higher, the workspace and project files must first be converted to the newer solution (.sln) and project (.vcproj) formats. On a Win32 platform, the simplest way to make the SOLID SDK accessible in your applications is to add the SOLID `include' and `lib' directories to respectively the include and link path used by the compiler. For running executables built using SOLID, the `solid.dll' should be contained in the executable search path. This is achieved most easily by copying these DLLs either to the directory containing the executable or to the `WINxxxx/system32' directory. SOLID uses the Qhull library for computing convex hulls of sets of points. In case the Qhull library is not available for your platform, SOLID can still be built. However, in that case, queries on convex hulls built with DT_NewPolytope (see below) fall back to brute force algorithms, and are therefore much slower. In order to build a SOLID library without Qhull, make sure that the preprocessing flag `-DQHULL' is not set. The core of SOLID may use either single or double precision floating-point arithmetic. The default option is single-precision. In order to build a double-precision SOLID core, use `configure' with the `--enable-doubles' option. Under Visual C++, doubles can be enabled using the `-DUSE_DOUBLES' preprocessing flag. Note that this flag only affects the floating-point numbers that are used internally in SOLID. The API functions always use single-precision floating-point numbers. In the same way, the SOLID core can be built using a tracer class for scalars. See the file `MT_ScalarTracer.h' in the `include' directory. A scalar tracer is used for tracing rounding errors in results of floating-point operations. An object of the type MT_ScalarTracer has a value field and an error field. The value field holds the result of an operation, and the error field multiplied by the machine epsilon gives an estimated upper bound for the relative rounding error. The MT_ScalarTracer class behaves as the primitive scalar types float and double, however, constants of this type have to be constructed explicitly. In order to build a SOLID core that uses scalar tracers, create Makefiles using `configure' with the `--enable-tracer' option. Under Visual C++, the tracers are enabled using the `-DUSE_TRACER' preprocessing flag. This option is very useful for debugging purposes. Makefiles for building debug binaries of SOLILD are created using the `--enable-debug' option.