1 | <?xml version="1.0" encoding="utf-8"?> |
---|
2 | <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" |
---|
3 | "../../../tools/boostbook/dtd/boostbook.dtd"> |
---|
4 | |
---|
5 | <!-- Copyright (c) 2001-2004 CrystalClear Software, Inc. |
---|
6 | Subject to the Boost Software License, Version 1.0. |
---|
7 | (See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) |
---|
8 | --> |
---|
9 | |
---|
10 | <section id="date_time.buildinfo"> |
---|
11 | <title>Build-Compiler Information</title> |
---|
12 | |
---|
13 | <para> |
---|
14 | <link linkend="overview">Overview</link> -- |
---|
15 | <link linkend="compile_options">Compilation Options</link> -- |
---|
16 | <link linkend="portability">Compiler/Portability Notes</link> -- |
---|
17 | <link linkend="dir_structure">Directory Structure</link> -- |
---|
18 | <link linkend="other_boost_libs">Required Boost Libraries</link> |
---|
19 | </para> |
---|
20 | |
---|
21 | <anchor id="overview" /> |
---|
22 | <bridgehead renderas="sect3">Overview</bridgehead> |
---|
23 | <para> |
---|
24 | The library has several functions that require the creation of a library file. The Jamfile in the build directory will produce a "static" library (libboost_date_time) and a "dynamic/shared" library (boost_date_time) that contains these functions. |
---|
25 | </para> |
---|
26 | |
---|
27 | <anchor id="compile_options" /> |
---|
28 | <bridgehead renderas="sect3">Compilation Options</bridgehead> |
---|
29 | <para> |
---|
30 | By default the posix_time system uses a single 64 bit integer internally to provide a microsecond level resolution. As an alternative, a combination of a 64 bit integer and a 32 bit integer (96 bit resolution) can be used to provide nano-second level resolutions. The default implementation may provide better performance and more compact memory usage for many applications that do not require nano-second resolutions. |
---|
31 | </para> |
---|
32 | <para> |
---|
33 | To use the alternate resolution (96 bit nanosecond) the variable <code>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG</code> must be defined in the library users project files (ie Makefile, Jamfile, etc). This macro is not used by the Gregorian system and therefore has no effect when building the library. |
---|
34 | </para> |
---|
35 | <para>As of version 1.33, the date_time library introduced a new IO streaming system. Some compilers are not capable of utilizing this new system. For those compilers the earlier ("legacy") IO system is still available. Non-supported compilers will select the legacy system automatically but the user can force the usage of the legacy system by defining <code>USE_DATE_TIME_PRE_1_33_FACET_IO</code>.</para> |
---|
36 | |
---|
37 | <para>As a convenience, <code>date_time</code> has provided some <link linkend="additional_duration_types">additional duration types</link>. Use of these types may have unexpected results due to the snap-to-end-of-month behavior (see <link linkend="snap_to_details">Reversibility of Operations Pitfall</link> for complete details and examples). These types are enabled by default. To disable these types, simply undefine <code>BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES</code> in your project file.</para> |
---|
38 | |
---|
39 | <para>Another convenience is the default constructors for <code><link linkend="date_time.gregorian.date_class">date</link></code>, and <code><link linkend="date_time.posix_time.ptime_class">ptime</link></code>. These constructors are enabled by default. To disable them, simply define <code>DATE_TIME_NO_DEFAULT_CONSTRUCTOR</code> in your project file.</para> |
---|
40 | |
---|
41 | <anchor id="portability" /> |
---|
42 | <bridgehead renderas="sect3">Compiler/Portability Notes</bridgehead> |
---|
43 | <para> |
---|
44 | The Boost Date-Time library has been built and tested with many compilers. However, some compilers and standard libraries have issues. While some of these issues can be worked around, others are difficult to work around. The following compilers fully support all aspects of the library: |
---|
45 | <itemizedlist mark="bullet"> |
---|
46 | <listitem>GCC 3.2 - 3.4, 4.0 on Linux</listitem> |
---|
47 | <listitem>GCC 3.3 on Darwin</listitem> |
---|
48 | <listitem>GCC 3.3 on Solaris</listitem> |
---|
49 | <listitem>GCC 3.2 (cygwin) *</listitem> |
---|
50 | <listitem>MinGW 3.2 *</listitem> |
---|
51 | <listitem>MSVC 7.1 </listitem> |
---|
52 | <listitem>Intel 8.1 Linux and Windows</listitem> |
---|
53 | </itemizedlist> |
---|
54 | * These compilers do not support the <code>wstring/wstream</code> aspects of the <code>date_time</code> library. |
---|
55 | </para> |
---|
56 | <para> |
---|
57 | In particular, a lack of support for standard locales limits the ability of the library to support iostream based input output. For these compilers a set of more limited string based input-output is provided. Some compilers/standard libraries with this limitation include: |
---|
58 | <itemizedlist mark="bullet"> |
---|
59 | <listitem>GCC 2.9x on Linux</listitem> |
---|
60 | <listitem>Borland 5.1.1 and 5.6</listitem> |
---|
61 | <listitem>MSVC 7.0</listitem> |
---|
62 | <listitem>MSVC 6 SP5 </listitem> |
---|
63 | </itemizedlist> |
---|
64 | </para> |
---|
65 | <para> |
---|
66 | Metrowerks Code Warrior 9.4 has some input I/O limitations, but is otherwise |
---|
67 | fully supported. |
---|
68 | </para> |
---|
69 | <bridgehead renderas="sect5">Visual Studio & STLPort</bridgehead> |
---|
70 | <para>There is a known issue with Visual Studio (7.0 & 7.1) and STLPort. The build errors typically make reference to a type issue or 'no acceptable conversion' and are attempting to instantiate a template with <code>wchar_t</code>. The default build of STLPort does not support <code>wchar_t</code>. There are two possible workarounds for this issue. The simplest is the user can build date_time with no wide stream/string etc. The other is to rebuild STLPort with wchar_t support. |
---|
71 | </para> |
---|
72 | <para>To build date_time with no wide stream/string etc, execute the following command from <code>$BOOST_ROOT</code>: |
---|
73 | <screen>bjam -a "-sTOOLS=vc-7_1-stlport" "-sSTLPORT_PATH=..." \ |
---|
74 | "-sBUILD=<define>BOOST_NO_STD_WSTRING" \ |
---|
75 | --stagedir=... --with-date_time stage</screen> |
---|
76 | (replace the ellipsis with the correct paths for the build system and adjust the <code>TOOLS</code> to the proper toolset if necessary) |
---|
77 | </para> |
---|
78 | <para>Rebuilding STLPort with <code>wchar_t</code> support involves placing <code>/Zc:wchar_t</code> in the STLPort makefile. Date_time should then be built with the following command from <code>$BOOST_ROOT</code>: |
---|
79 | <screen>bjam -a "-sTOOLS=vc-7_1-stlport" "-sSTLPORT_PATH=..." \ |
---|
80 | "-sBUILD=&native-wchar_t>on" \ |
---|
81 | --stagedir=... --with-date_time stage</screen> |
---|
82 | (replace the ellipsis with the correct paths for the build system and adjust the <code>TOOLS</code> to the proper toolset if necessary) |
---|
83 | </para> |
---|
84 | |
---|
85 | <anchor id="dir_structure" /> |
---|
86 | <bridgehead renderas="sect3">Directory Structure</bridgehead> |
---|
87 | <para> |
---|
88 | The directory tree has the following structure: |
---|
89 | <programlisting>/boost/date_time -- common headers and template code |
---|
90 | /boost/date_time/gregorian -- Gregorian date system header files |
---|
91 | /boost/date_time/posix_time -- Posix time system headers |
---|
92 | /boost/date_time/local_time -- Local time system headers |
---|
93 | /libs/date_time/build -- build files and output directory |
---|
94 | /libs/date_time/test -- test battery for generic code |
---|
95 | /libs/date_time/test/gregorian -- test battery for the Gregorian system |
---|
96 | /libs/date_time/test/posix_time -- test battery for the posix_time system |
---|
97 | /libs/date_time/test/local_time -- test battery for the local_time system |
---|
98 | /libs/date_time/examples/gregorian -- example programs for dates |
---|
99 | /libs/date_time/examples/posix_time -- time example programs |
---|
100 | /libs/date_time/examples/local_time -- nifty example programs |
---|
101 | /libs/date_time/src/gregorian -- cpp files for libboost_date_time |
---|
102 | /libs/date_time/src/posix_time -- empty (one file, but no source code...)</programlisting> |
---|
103 | </para> |
---|
104 | |
---|
105 | <anchor id="other_boost_libs" /> |
---|
106 | <bridgehead renderas="sect3">Required Boost Libraries</bridgehead> |
---|
107 | <para> |
---|
108 | Various parts of date-time depend on other boost libraries. These include: |
---|
109 | <itemizedlist mark="bullet"> |
---|
110 | <listitem><ulink url="../../libs/tokenizer/index.html">boost.tokenizer</ulink> </listitem> |
---|
111 | <listitem><ulink url="../../libs/integer/cstdint.htm">boost.integer(cstdint)</ulink> </listitem> |
---|
112 | <listitem><ulink url="../../libs/utility/operators.htm">boost.operators</ulink> </listitem> |
---|
113 | <listitem><ulink url="../../libs/conversion/lexical_cast.htm">boost::lexical_cast </ulink> </listitem> |
---|
114 | <listitem><ulink url="../../libs/smart_ptr/smart_ptr.htm">boost::smart_ptr </ulink> </listitem> |
---|
115 | <listitem><ulink url="../../libs/algorithm/string/index.html">boost::string_algorithms </ulink> </listitem> |
---|
116 | </itemizedlist> |
---|
117 | so at least these libraries need to be installed. |
---|
118 | </para> |
---|
119 | </section> |
---|