README for Spirit V1.5 ============================================================================== The docs for Spirit are located in the libs/spirit/doc subdirectory. The code is under the boost subdirectory. The examples are in libs/spirit/example, and the test suite is in libs/spirit/test. The Spirit homepage is http://spirit.sourceforge.net/ ============================================================================== If you are on a Linux/Unix system, you can install the library by running: # ./configure # make install Note that this will default to putting the headers in /usr/local/include/boost/spirit. To change the location, use the --prefix= option when running configure. e.g. # ./configure --prefix=/usr On systems that aren't supported by configure scripts, simply point your compiler's include path to the spirit directory. There are no libraries to build, Spirit is a header-only library. The examples can be built by executing 'make'. The test suite can be built and run by executing 'make check' If you are using gcc 2.95.x, you may need to use the flag '-ftemplate-depth-50' The spirit configure script does this automatically, but you may need it for your project. ============================================================================== If you want to build spirit as thread safe, you have to define the SPIRIT_THREADSAFE macro. Spirit uses the boost thread library, which is not distributed together with spirit. You will have to add the boost headers to your include path. You will also need to link with libboost_thread.a and your platform threading library. The configure script supports two options which can be used to build the Spirit examples and tests thread safe. --enable-spirit-threadsafe --with-boost=PATH absolute path name where the Boost C++ libraries reside. Alternatively, the BOOST_ROOT environment variable will be used Here are the commands I use to set up things to build the examples and tests thread safe on Linux. ./configure --enable-spirit-threadsafe --with-boost=/home/dan/software/boost_1_28_0 This alters the following variables: CPPFLAGS="-DSPIRIT_THREADSAFE -I$BOOST_ROOT $CPPFLAGS" BOOST_THREAD_LIB_DIR=$BOOST_ROOT/libs/thread/build/bin/libboost_thread.a/gcc/release/runtime-link-static/threading-multi LIBS="-L$BOOST_THREAD_LIB_DIR -lboost_thread -lpthread $LIBS" Of course this assumes that you already have boost_thread built, and you will have to use the correct boost path. Currently the thread support has only been tested with boost 1.28.0. If you use a different version, it may or may not work. ============================================================================== Here is a list of the examples that depend on software not in the main spirit distribution: application/slex/callback.cpp depends on boost/function.hpp fundamental/regular_expression.cpp depends on boost regex (see docs) fundamental/spirit_bind.cpp depends on boost/bind.hpp None of these examples are built by default. ============================================================================== Questions, comments, complaints, bug-fixes? Please send them to the Spirit mailing list: spirit-general@lists.sourceforge.net