1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html lang=
"en-US" xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en-US">
7 <title>ReadMe for ICU
</title>
8 <meta name=
"COPYRIGHT" content=
9 "Copyright (c) 1997-2007 IBM Corporation and others. All Rights Reserved." />
10 <meta name=
"KEYWORDS" content=
11 "ICU; International Components for Unicode; ICU4C; what's new; readme; read me; introduction; downloads; downloading; building; installation;" />
12 <meta name=
"DESCRIPTION" content=
13 "The introduction to the International Components for Unicode with instructions on building, installation, usage and other information about ICU." />
14 <meta http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii" />
15 <style type=
"text/css">
17 h1 {border-width:
2px; border-style: solid; text-align: center; width:
100%; font-size:
200%; font-weight: bold}
18 h2 {margin-top:
3em; text-decoration: underline; page-break-before: always}
19 h2.TOC {page-break-before: auto}
20 h3 {margin-top:
2em; text-decoration: underline}
21 h4 {text-decoration: underline}
22 h5 {text-decoration: underline}
23 caption {font-weight: bold; text-align: left}
24 div.indent {margin-left:
2em}
25 ul.TOC {list-style-type: none}
26 samp {margin-left:
1em; border-style: groove; padding:
1em; display: block; background-color: #EEEEEE}
32 <h1>International Components for Unicode
<br />
33 <abbr title=
"International Components for Unicode">ICU
</abbr> 3.8
36 <p>Version:
2007 September
16<br />
37 Copyright
© 1997-
2007 International Business Machines Corporation and
38 others. All Rights Reserved.
</p>
39 <!-- Remember that there is a copyright at the end too -->
42 <h2 class=
"TOC">Table of Contents
</h2>
45 <li><a href=
"#Introduction">Introduction
</a></li>
47 <li><a href=
"#GettingStarted">Getting Started
</a></li>
49 <li><a href=
"#News">What Is New In This release?
</a></li>
51 <li><a href=
"#Download">How To Download the Source Code
</a></li>
53 <li><a href=
"#SourceCode">ICU Source Code Organization
</a></li>
56 <a href=
"#HowToBuild">How To Build And Install ICU
</a>
59 <li><a href=
"#HowToBuildSupported">Supported Platforms
</a></li>
61 <li><a href=
"#HowToBuildWindows">Windows
</a></li>
63 <li><a href=
"#HowToBuildCygwin">Cygwin
</a></li>
65 <li><a href=
"#HowToBuildUNIX">UNIX
</a></li>
67 <li><a href=
"#HowToBuildZOS">z/OS (os/
390)
</a></li>
69 <li><a href=
"#HowToBuildOS400">i5/OS (OS/
400 iSeries)
</a></li>
73 <li><a href=
"#HowToPackage">How To Package ICU
</a></li>
76 <a href=
"#ImportantNotes">Important Notes About Using ICU
</a>
79 <li><a href=
"#ImportantNotesMultithreaded">Using ICU in a Multithreaded
82 <li><a href=
"#ImportantNotesWindows">Windows Platform
</a></li>
84 <li><a href=
"#ImportantNotesUNIX">UNIX Type Platforms
</a></li>
89 <a href=
"#PlatformDependencies">Platform Dependencies
</a>
92 <li><a href=
"#PlatformDependenciesNew">Porting To A New
95 <li><a href=
"#PlatformDependenciesImpl">Platform Dependent
96 Implementations
</a></li>
102 <h2><a name=
"Introduction" href=
"#Introduction" id=
103 "Introduction">Introduction
</a></h2>
105 <p>Today's software market is a global one in which it is desirable to
106 develop and maintain one application (single source/single binary) that
107 supports a wide variety of languages. The International Components for
108 Unicode (ICU) libraries provide robust and full-featured Unicode services on
109 a wide variety of platforms to help this design goal. The ICU libraries
110 provide support for:
</p>
113 <li>The latest version of the Unicode standard
</li>
115 <li>Character set conversions with support for over
220 codepages
</li>
117 <li>Locale data for more than
250 locales
</li>
119 <li>Language sensitive text collation (sorting) and searching based on the
120 Unicode Collation Algorithm (=ISO
14651)
</li>
122 <li>Regular expression matching and Unicode sets
</li>
124 <li>Transformations for normalization, upper/lowercase, script
125 transliterations (
50+ pairs)
</li>
127 <li>Resource bundles for storing and accessing localized information
</li>
129 <li>Date/Number/Message formatting and parsing of culture specific
130 input/output formats
</li>
132 <li>Calendar specific date and time manipulation
</li>
134 <li>Complex text layout for Arabic, Hebrew, Indic and Thai
</li>
136 <li>Text boundary analysis for finding characters, word and sentence
140 <p>ICU has a sister project ICU4J that extends the internationalization
141 capabilities of Java to a level similar to ICU. The ICU C/C++ project is also
142 called ICU4C when a distinction is necessary.
</p>
144 <h2><a name=
"GettingStarted" href=
"#GettingStarted" id=
145 "GettingStarted">Getting started
</a></h2>
147 <p>This document describes how to build and install ICU on your machine. For
148 other information about ICU please see the following table of links.
<br />
149 The ICU homepage also links to related information about writing
150 internationalized software.
</p>
152 <table border=
"1" cellpadding=
"3" width=
"100%" summary=
153 "These are some useful links regarding ICU and internationalization in general.">
155 Here are some useful links regarding ICU and internationalization in
160 <td>ICU, ICU4C
& ICU4J Homepage
</td>
163 "http://www.icu-project.org/">http://www.icu-project.org/
</a></td>
167 <td>FAQ - Frequently Asked Questions about ICU
</td>
170 "http://www.icu-project.org/userguide/icufaq.html">http://www.icu-project.org/userguide/icufaq.html
</a></td>
174 <td>ICU User's Guide
</td>
177 "http://www.icu-project.org/userguide/">http://www.icu-project.org/userguide/
</a></td>
181 <td>Download ICU Releases
</td>
184 "http://www.icu-project.org/download/">http://www.icu-project.org/download/
</a></td>
188 <td>ICU4C API Documentation Online
</td>
191 "http://www.icu-project.org/apiref/icu4c/">http://www.icu-project.org/apiref/icu4c/
</a></td>
195 <td>Online ICU Demos
</td>
198 "http://demo.icu-project.org/icu-bin/icudemos">http://demo.icu-project.org/icu-bin/icudemos
</a></td>
202 <td>Contacts and Bug Reports/Feature Requests
</td>
205 "http://www.icu-project.org/contacts.html">http://www.icu-project.org/contacts.html
</a></td>
209 <p><strong>Important:
</strong> Please make sure you understand the
<a href=
210 "license.html">Copyright and License Information
</a>.
</p>
212 <h2><a name=
"News" href=
"#News" id=
"News">What is new in this
215 <p>The following list concentrates on
<em>changes that affect existing
216 applications migrating from previous ICU releases
</em>. For more news about
217 this release, see the
<a href=
"http://www.icu-project.org/download/">ICU
3.8
218 download page
</a>.
</p>
220 <h3><a name=
"News_timezone" id=
"News_timezone">Changes to timezone formatting
223 <p>In ICU
3.8, the behavior of date formatting and parsing has changed
224 significantly, perhaps requiring recoding on your part depending on your
225 usage. For more information, see
<a href=
"http://icu-project.org/userguide/formatDateTime.html">
226 Formatting Dates and Times
</a> in the User Guide.
</p>
228 <h2><a name=
"Download" href=
"#Download" id=
"Download">How To Download the
231 <p>There are two ways to download ICU releases:
</p>
234 <li><strong>Official Release Snapshot:
</strong><br />
235 If you want to use ICU (as opposed to developing it), you should download
236 an official packaged version of the ICU source code. These versions are
237 tested more thoroughly than day-to-day development builds of the system,
238 and they are packaged in zip and tar files for convenient download. These
239 packaged files can be found at
<a href=
240 "http://www.icu-project.org/download/">http://www.icu-project.org/download/
</a>.
<br />
241 The packaged snapshots are named
<strong>icu-nnnn.zip
</strong> or
242 <strong>icu-nnnn.tgz
</strong>, where nnnn is the version number. The .zip
243 file is used for Windows platforms, while the .tgz file is preferred on
244 most other platforms.
<br />
245 Please unzip this file.
</li>
247 <li><strong>Subversion Source Repository:
</strong><br />
248 If you are interested in developing features, patches, or bug fixes for
249 ICU, you should probably be working with the latest version of the ICU
250 source code. You will need to check the code out of our Subversion repository to
251 ensure that you have the most recent version of all of the files. See our
252 <a href=
"http://www.icu-project.org/repository/">source
253 repository
</a> for details.
</li>
256 <h2><a name=
"SourceCode" href=
"#SourceCode" id=
"SourceCode">ICU Source Code
257 Organization
</a></h2>
259 <p>In the descriptions below,
<strong><i><ICU
></i></strong> is the full
260 path name of the ICU directory (the top level directory from the distribution
261 archives) in your file system. You can also view the
<a href=
262 "http://www.icu-project.org/userguide/design.html">ICU Architectural
263 Design
</a> section of the User's Guide to see which libraries you need for
264 your software product. You need at least the data (
<code>[lib]icudt
</code>)
265 and the common (
<code>[lib]icuuc
</code>) libraries in order to use ICU.
</p>
267 <table border=
"1" cellpadding=
"0" width=
"100%" summary=
268 "The following files describe the code drop.">
270 The following files describe the code drop.
274 <th scope=
"col">File
</th>
276 <th scope=
"col">Description
</th>
282 <td>Describes the International Components for Unicode (this file)
</td>
286 <td>license.html
</td>
288 <td>Contains the text of the ICU license
</td>
295 <table border=
"1" cellpadding=
"0" width=
"100%" summary=
296 "The following directories contain source code and data files.">
298 The following directories contain source code and data files.
302 <th scope=
"col">Directory
</th>
304 <th scope=
"col">Description
</th>
308 <td><i><ICU
></i>/source/
<b>common
</b>/
</td>
310 <td>The core Unicode and support functionality, such as resource bundles,
311 character properties, locales, codepage conversion, normalization,
312 Unicode properties, Locale, and UnicodeString.
</td>
316 <td><i><ICU
></i>/source/
<b>i18n
</b>/
</td>
318 <td>Modules in i18n are generally the more data-driven, that is to say
319 resource bundle driven, components. These deal with higher-level
320 internationalization issues such as formatting, collation, text break
321 analysis, and transliteration.
</td>
325 <td><i><ICU
></i>/source/
<b>layout
</b>/
</td>
327 <td>Contains the ICU layout engine (not a rasterizer).
</td>
331 <td><i><ICU
></i>/source/
<b>io
</b>/
</td>
333 <td>Contains the ICU I/O library.
</td>
337 <td><i><ICU
></i>/source/
<b>data
</b>/
</td>
340 <p>This directory contains the source data in text format, which is
341 compiled into binary form during the ICU build process. It contains
342 several subdirectories, in which the data files are grouped by
343 function. Note that the build process must be run again after any
344 changes are made to this directory.
</p>
346 <p>If some of the following directories are missing, it's probably
347 because you got an official download. If you need the data source files
348 for customization, then please download the ICU source code from
<a
349 href=
"http://www.icu-project.org/repository/">subversion
</a>.
</p>
352 <li><b>in/
</b> A directory that contains a pre-built data library for
353 ICU. A standard source code package will contain this file without
354 several of the following directories. This is to simplify the build
355 process for the majority of users and to reduce platform porting
358 <li><b>brkitr/
</b> Data files for character, word, sentence, title
359 casing and line boundary analysis.
</li>
361 <li><b>locales/
</b> These .txt files contain ICU language and
362 culture-specific localization data. Two special bundles are
363 <b>root
</b>, which is the fallback data and parent of other bundles,
364 and
<b>index
</b>, which contains a list of installed bundles. The
365 makefile
<b>resfiles.mk
</b> contains the list of resource bundle
368 <li><b>mappings/
</b> Here are the code page converter tables. These
369 .ucm files contain mappings to and from Unicode. These are compiled
370 into .cnv files.
<b>convrtrs.txt
</b> is the alias mapping table from
371 various converter name formats to ICU internal format and vice versa.
372 It produces cnvalias.icu. The makefiles
<b>ucmfiles.mk,
373 ucmcore.mk,
</b> and
<b>ucmebcdic.mk
</b> contain the list of
374 converters to be built.
</li>
376 <li><b>translit/
</b> This directory contains transliterator rules as
377 resource bundles, a makefile
<b>trnsfiles.mk
</b> containing the list
378 of installed system translitaration files, and as well the special
379 bundle
<b>translit_index
</b> which lists the system transliterator
382 <li><b>unidata/
</b> This directory contains the Unicode data files.
384 "http://www.unicode.org/">http://www.unicode.org/
</a> for more
387 <li><b>misc/
</b> The misc directory contains other data files which
388 did not fit into the above categories. Currently it only contains
389 time zone information, and a name preperation file for
<a href=
390 "http://www.ietf.org/rfc/rfc3490.txt">IDNA
</a>.
</li>
392 <li><b>out/
</b> This directory contains the assembled memory mapped
395 <li><b>out/build/
</b> This directory contains intermediate (compiled)
396 files, such as .cnv, .res, etc.
</li>
399 <p>If you are creating a special ICU build, you can set the ICU_DATA
400 environment variable to the out/ or the out/build/ directories, but
401 this is generally discouraged because most people set it incorrectly.
402 You can view the
<a href=
403 "http://www.icu-project.org/userguide/icudata.html">ICU Data
404 Management
</a> section of the ICU User's Guide for details.
</p>
409 <td><i><ICU
></i>/source/test/
<b>intltest
</b>/
</td>
411 <td>A test suite including all C++ APIs. For information about running
412 the test suite, see the build instructions specific to your platform
413 later in this document.
</td>
417 <td><i><ICU
></i>/source/test/
<b>cintltst
</b>/
</td>
419 <td>A test suite written in C, including all C APIs. For information
420 about running the test suite, see the build instructions specific to your
421 platform later in this document.
</td>
425 <td><i><ICU
></i>/source/test/
<b>iotest
</b>/
</td>
427 <td>A test suite written in C and C++ to test the icuio library. For
428 information about running the test suite, see the build instructions
429 specific to your platform later in this document.
</td>
433 <td><i><ICU
></i>/source/test/
<b>testdata
</b>/
</td>
435 <td>Source text files for data, which are read by the tests. It contains
436 the subdirectories
<b>out/build/
</b> which is used for intermediate
437 files, and
<b>out/
</b> which contains
<b>testdata.dat.
</b></td>
441 <td><i><ICU
></i>/source/
<b>tools
</b>/
</td>
443 <td>Tools for generating the data files. Data files are generated by
444 invoking
<i><ICU
></i>/source/data/build/makedata.bat on Win32 or
445 <i><ICU
></i>/source/make on UNIX.
</td>
449 <td><i><ICU
></i>/source/
<b>samples
</b>/
</td>
451 <td>Various sample programs that use ICU
</td>
455 <td><i><ICU
></i>/source/
<b>extra
</b>/
</td>
457 <td>Non-supported API additions. Currently, it contains the 'uconv' tool
458 to perform codepage conversion on files.
</td>
462 <td><i><ICU
></i>/
<b>packaging
</b>/
<br />
463 <i><ICU
></i>/
<b>debian
</b>/
</td>
465 <td>These directories contain scripts and tools for packaging the final
466 ICU build for various release platforms.
</td>
470 <td><i><ICU
></i>/source/
<b>config
</b>/
</td>
472 <td>Contains helper makefiles for platform specific build commands. Used
477 <td><i><ICU
></i>/source/
<b>allinone
</b>/
</td>
479 <td>Contains top-level ICU workspace and project files, for instance to
480 build all of ICU under one MSVC project.
</td>
484 <td><i><ICU
></i>/
<b>include
</b>/
</td>
486 <td>Contains the headers needed for developing software that uses ICU on
491 <td><i><ICU
></i>/
<b>lib
</b>/
</td>
493 <td>Contains the import libraries for linking ICU into your Windows
498 <td><i><ICU
></i>/
<b>bin
</b>/
</td>
500 <td>Contains the libraries and executables for using ICU on Windows.
</td>
503 <!-- end of ICU structure ==================================== -->
505 <h2><a name=
"HowToBuild" href=
"#HowToBuild" id=
"HowToBuild">How To Build And
508 <h3><a name=
"HowToBuildSupported" href=
"#HowToBuildSupported" id=
509 "HowToBuildSupported">Supported Platforms
</a></h3>
511 <table border=
"1" cellpadding=
"3" summary=
512 "ICU can be built on many platforms.">
514 Here is a status of functionality of ICU on several different platforms.
518 <th scope=
"col">Operating system
</th>
520 <th scope=
"col">Compiler
</th>
522 <th scope=
"col">Testing frequency
</th>
528 <td>Microsoft Visual C++
2005 (
8.0)
</td>
530 <td>Reference platform
</td>
534 <td>Red Hat Enterprise Linux
5</td>
538 <td>Reference platform
</td>
544 <td>Visual Age C++
8.0</td>
546 <td>Reference platform
</td>
550 <td>Solaris
10 (SunOS
5.10)
</td>
552 <td>Sun Studio
11 (Sun C++
5.8)
</td>
554 <td>Reference platform
</td>
558 <td>HP-UX
11.23 (IA64)
</td>
562 <td>Reference platform
</td>
566 <td>Red Hat Enterprise Linux
4 Update
4</td>
570 <td>Regularly tested
</td>
576 <td>Visual Age C++
6.0</td>
578 <td>Regularly tested
</td>
582 <td>Solaris
9 (SunOS
5.9)
</td>
584 <td>Sun Studio
8 (Sun C++
5.5)
</td>
586 <td>Regularly tested
</td>
590 <td>HP-UX
11.11 (PA-RISC)
</td>
592 <td>aCC A
.03.50<br />
595 <td>Regularly tested
</td>
599 <td>Windows
2000 with Cygwin
</td>
601 <td>Microsoft Visual C++
2003 (
7.1)
</td>
603 <td>Regularly tested
</td>
607 <td>Windows Vista x86
</td>
609 <td>Microsoft Visual C++
2005 (
8.0)
</td>
611 <td>Regularly tested
</td>
615 <td>Mac OS X (
10.4)
</td>
619 <td>Regularly tested
</td>
627 <td>Regularly tested
</td>
631 <td>SUSE Linux Enterprise Server
9 SP1
</td>
633 <td>Intel C++ Compiler
9.0</td>
635 <td>Regularly tested
</td>
643 <td>Rarely tested
</td>
651 <td>Rarely tested
</td>
655 <td>i5/OS (OS/
400 iSeries) V5R3
</td>
659 <td>Rarely tested
</td>
663 <td>Windows Vista x64
</td>
665 <td>Microsoft Visual C++
2005 (
8.0)
</td>
667 <td>Rarely tested
</td>
675 <td>Rarely tested
</td>
679 <td>NetBSD, OpenBSD, FreeBSD
</td>
683 <td>Rarely tested
</td>
687 <td>SUSE Linux Enterprise Server
9 (PowerPC)
</td>
689 <td>Visual Age
8.0</td>
691 <td>Rarely tested
</td>
699 <td>Rarely tested
</td>
707 <td>Rarely tested
</td>
715 <td>Rarely tested
</td>
721 <td>Compaq's cxx compiler
</td>
723 <td>Rarely tested
</td>
729 <td>NCR MP-RAS C/C++ Compiler
</td>
731 <td>Rarely tested
</td>
738 <h4>Key to testing frequency
</h4>
741 <dt><i>Reference platform
</i></dt>
743 <dd>ICU will work on these platforms with these compilers
</dd>
745 <dt><i>Regularly tested
</i></dt>
747 <dd>ICU should work on these platforms with these compilers
</dd>
749 <dt><i>Rarely tested
</i></dt>
751 <dd>ICU has been ported to these platforms but may not have been tested
755 <h3><a name=
"HowToBuildWindows" href=
"#HowToBuildWindows" id=
756 "HowToBuildWindows">How To Build And Install On Windows
</a></h3>
758 <p>Building International Components for Unicode requires:
</p>
761 <li>Microsoft Windows
2000 or above
</li>
763 <li>Microsoft Visual C++
2005</li>
765 <li><a href=
"#HowToBuildCygwin">Cygwin
</a> is required when other versions
766 of Microsoft Visual C++ and other compilers are used to build ICU.
</li>
769 <p>The steps are:
</p>
772 <li>Unzip the icu-XXXX.zip file into any convenient location. Using command
773 line zip, type
"unzip -a icu-XXXX.zip -d drive:\directory", or just use
776 <li>Be sure that the ICU binary directory,
<i><ICU
></i>\bin\, is
777 included in the
<strong>PATH
</strong> environment variable. The tests will
778 not work without the location of the ICU DLL files in the path.
</li>
780 <li>Open the
"<i><ICU></i>\source\allinone\allinone.sln" workspace
781 file in Microsoft Visual Studio
2003. (This solution includes all the
782 International Components for Unicode libraries, necessary ICU building
783 tools, and the test suite projects). Please see the
<a href=
784 "#HowToBuildWindowsCommandLine">command line note below
</a> if you want to
785 build from the command line instead.
</li>
787 <li>Set the active configuration to
"Debug" or
"Release" (See
<a href=
788 "#HowToBuildWindowsConfig">Windows configuration note
</a> below).
</li>
790 <li>Choose the
"Build" menu and select
"Rebuild Solution". If you want to
791 build the Debug and Release at the same time, see the
<a href=
792 "#HowToBuildWindowsBatch">batch configuration note
</a> below.
</li>
794 <li>Run the C++ test suite,
"intltest". To do this: set the active startup
795 project to
"intltest", and press Ctrl+F5 to run it. Make sure that it
796 passes without any errors.
</li>
798 <li>Run the C test suite,
"cintltst". To do this: set the active startup
799 project to
"cintltst", and press Ctrl+F5 to run it. Make sure that it
800 passes without any errors.
</li>
802 <li>Run the I/O test suite,
"iotest". To do this: set the active startup
803 project to
"iotest", and press Ctrl+F5 to run it. Make sure that it passes
804 without any errors.
</li>
806 <li>You are now able to develop applications with ICU by using the
807 libraries and tools in
<i><ICU
></i>\bin\. The headers are in
808 <i><ICU
></i>\include\ and the link libraries are in
809 <i><ICU
></i>\lib\. To install the ICU runtime on a machine, or ship
810 it with your application, copy the needed components from
811 <i><ICU
></i>\bin\ to a location on the system PATH or to your
812 application directory.
</li>
815 <p><a name=
"HowToBuildWindowsCommandLine" id=
816 "HowToBuildWindowsCommandLine"><strong>Using MSDEV At The Command Line
817 Note:
</strong></a> You can build ICU from the command line. Assuming that you
818 have properly installed Microsoft Visual C++ to support command line
819 execution, you can run the following command, 'devenv.com
820 <i><ICU
></i>\source\allinone\allinone.sln /build Release'. You can also
821 use Cygwin with this compiler to build ICU, and you can refer to the
<a href=
822 "#HowToBuildCygwin">How To Build And Install On Windows with Cygwin
</a>
823 section for more details.
</p>
825 <p><a name=
"HowToBuildWindowsConfig" id=
826 "HowToBuildWindowsConfig"><strong>Setting Active Configuration
827 Note:
</strong></a> To set the active configuration, two different
828 possibilities are:
</p>
831 <li>Choose
"Build" menu, select
"Configuration Manager...", and select
832 "Release" or
"Debug" for the Active Configuration Solution.
</li>
834 <li>Another way is to select the desired build configuration from
"Solution
835 Configurations" dropdown menu from the standard toolbar. It will say
836 "Release" or
"Debug" in the dropdown list.
</li>
839 <p><a name=
"HowToBuildWindowsBatch" id=
"HowToBuildWindowsBatch"><strong>Batch
840 Configuration Note:
</strong></a> If you want to build the Debug and Release
841 configurations at the same time, choose
"Build" menu, and select
"Batch
842 Build...". Click the
"Select All" button, and then click the
"Rebuild"
845 <h3><a name=
"HowToBuildCygwin" href=
"#HowToBuildCygwin" id=
846 "HowToBuildCygwin">How To Build And Install On Windows with Cygwin
</a></h3>
848 <p>Building International Components for Unicode with this configuration
852 <li>Microsoft
2000 or above
</li>
854 <li>Microsoft Visual C++
2003 or above (when gcc isn't used).
</li>
857 Cygwin with the following installed:
864 <li>man (if you plan to look at the man pages)
</li>
869 <p>There are two ways you can build ICU with Cygwin. You can build with gcc
870 or Microsoft Visual C++. If you use gcc, the resulting libraries and tools
871 will depend on the Cygwin environment. If you use Microsoft Visual C++, the
872 resulting libraries and tools do not depend on Cygwin and can be more easily
873 distributed to other Windows computers (the generated man pages and shell
874 scripts still need Cygwin). To build with gcc, please follow the
"<a href=
875 "#HowToBuildUNIX
">How To Build And Install On UNIX</a>" instructions, while
876 you are inside a Cygwin bash shell. To build with Microsoft Visual C++,
877 please use the following instructions:
</p>
880 <li>Start the Windows
"Command Prompt" window. This is different from the
881 gcc build, which requires the Cygwin Bash command prompt. The Microsoft
882 Visual C++ compiler will not work with a bash command prompt.
</li>
884 <li>If the computer isn't set up to use Visual C++ from the command line,
885 you need to run vcvars32.bat. For example
"<tt>C:\Program Files\Microsoft
886 Visual Studio 8\VC\bin\vcvars32.bat</tt>" can be used for
32-bit builds
887 <strong>or
</strong> "<tt>C:\Program Files (x86)\Microsoft Visual Studio
888 8\VC\bin\amd64\vcvarsamd64.bat</tt>" can be used for
64-bit builds on
891 <li>Unzip the icu-XXXX.zip file into any convenient location. Using command
892 line zip, type
"unzip -a icu-XXXX.zip -d drive:\directory", or just use
895 <li>Change directory to
"icu/source", which is where you unzipped ICU.
</li>
897 <li>Run
"<tt>bash <a href="source/runConfigureICU
">./runConfigureICU</a>
898 Cygwin/MSVC</tt>" (See
<a href=
"#HowToWindowsConfigureICU">Windows
899 configuration note
</a> and non-functional configure options below).
</li>
901 <li>Type
<tt>"make"</tt> to compile the libraries and all the data files.
902 This make command should be GNU make.
</li>
904 <li>Optionally, type
<tt>"make check"</tt> to run the test suite, which
905 checks for ICU's functionality integrity (See
<a href=
906 "#HowToTestWithoutGmake">testing note
</a> below).
</li>
908 <li>Type
<tt>"make install"</tt> to install ICU. If you used the --prefix=
909 option on configure or runConfigureICU, ICU will be installed to the
910 directory you specified. (See
<a href=
"#HowToInstallICU">installation
911 note
</a> below).
</li>
914 <p><a name=
"HowToWindowsConfigureICU" id=
915 "HowToWindowsConfigureICU"><strong>Configuring ICU on Windows
916 NOTE:
</strong></a> In addition to the Unix
<a href=
917 "#HowToConfigureICU">configuration note
</a> the following configure options
918 currently do not work on Windows with Microsoft's compiler. Some options can
919 work by manually editing
<tt>icu/source/common/unicode/pwin32.h
</tt>, but
920 manually editing the files is not recommended.
</p>
923 <li><tt>--disable-renaming
</tt></li>
925 <li><tt>--disable-threading
</tt></li>
927 <li><tt>--enable-tracing
</tt></li>
929 <li><tt>--enable-rpath
</tt></li>
931 <li><tt>--with-iostream
</tt></li>
933 <li><tt>--enable-static
</tt> (Requires that U_STATIC_IMPLEMENTATION be
934 defined in user code that links against ICU's static libraries.)
</li>
936 <li><tt>--with-data-packaging=files
</tt> (The pkgdata tool currently does
937 not work in this mode. Manual packaging is required to use this mode.)
</li>
940 <h3><a name=
"HowToBuildUNIX" href=
"#HowToBuildUNIX" id=
"HowToBuildUNIX">How
941 To Build And Install On UNIX
</a></h3>
943 <p>Building International Components for Unicode on UNIX requires:
</p>
946 <li>A C++ compiler installed on the target machine (for example: gcc, CC,
947 xlC_r, aCC, cxx, etc...).
</li>
949 <li>An ANSI C compiler installed on the target machine (for example:
952 <li>A recent version of GNU make (
3.80+).
</li>
954 <li>For a list of z/OS tools please view the
<a href=
"#HowToBuildZOS">z/OS
955 build section
</a> of this document for further details.
</li>
958 <p>Here are the steps to build ICU:
</p>
961 <li>Decompress the icu-
<i>X
</i>.
<i>Y
</i>.tgz (or
962 icu-
<i>X
</i>.
<i>Y
</i>.tar.gz) file. For example,
<tt>"gunzip -d <
963 icu-<i>X</i>.<i>Y</i>.tgz | tar xvf -"</tt></li>
965 <li>Change directory to the
"icu/source".
</li>
967 <li>Run
<tt>"chmod +x runConfigureICU configure install-sh"</tt> because
968 these files may have the wrong permissions.
</li>
970 <li>Run the
<tt><a href=
"source/runConfigureICU">runConfigureICU
</a></tt>
971 script for your platform. (See
<a href=
"#HowToConfigureICU">configuration
972 note
</a> below).
</li>
974 <li>Type
<tt>"gmake"</tt> (or
"make" if GNU make is the default make on
975 your platform) to compile the libraries and all the data files. The proper
976 name of the GNU make command is printed at the end of the configuration
977 run, as in
"You must use gmake to compile ICU".
</li>
979 <li>Optionally, type
<tt>"gmake check"</tt> to run the test suite, which
980 checks for ICU's functionality integrity (See
<a href=
981 "#HowToTestWithoutGmake">testing note
</a> below).
</li>
983 <li>Type
<tt>"gmake install"</tt> to install ICU. If you used the --prefix=
984 option on configure or runConfigureICU, ICU will be installed to the
985 directory you specified. (See
<a href=
"#HowToInstallICU">installation
986 note
</a> below).
</li>
989 <p><a name=
"HowToConfigureICU" id=
"HowToConfigureICU"><strong>Configuring ICU
990 NOTE:
</strong></a> Type
<tt>"./runConfigureICU --help"</tt> for help on how
991 to run it and a list of supported platforms. You may also want to type
992 <tt>"./configure --help"</tt> to print the available configure options that
993 you may want to give runConfigureICU. If you are not using the
994 runConfigureICU script, or your platform is not supported by the script, you
995 may need to set your CC, CXX, CFLAGS and CXXFLAGS environment variables, and
996 type
<tt>"./configure"</tt>. Some of the more frequently used options to
997 configure are --disable-
64bit-libs to create
32-bit libraries, and --srcdir
998 to do out of source builds (build the libraries in the current location).
999 HP-UX user's, please see this
<a href=
"#ImportantNotesHPUX">note regarding
1000 HP-UX multithreaded build issues
</a> with newer compilers. Solaris user's,
1001 please see this
<a href=
"#ImportantNotesSolaris">note regarding Solaris
1002 multithreaded build issues
</a>.
</p>
1004 <p><a name=
"HowToTestWithoutGmake" id=
"HowToTestWithoutGmake"><strong>Running
1005 The Tests From The Command Line NOTE:
</strong></a> You may have to set
1006 certain variables if you with to run test programs individually, that is
1007 apart from
"gmake check". The environment variable
<strong>ICU_DATA
</strong>
1008 can be set to the full pathname of the data directory to indicate where the
1009 locale data files and conversion mapping tables are when you are not using
1010 the shared library (e.g. by using the .dat archive or the individual data
1011 files). The trailing
"/" is required after the directory name (e.g.
1012 "$Root/source/data/out/" will work, but the value
"$Root/source/data/out" is
1013 not acceptable). You do not need to set
<strong>ICU_DATA
</strong> if the
1014 complete shared data library is in your library path.
</p>
1016 <p><a name=
"HowToInstallICU" id=
"HowToInstallICU"><strong>Installing ICU
1017 NOTE:
</strong></a> Some platforms use package management tools to control the
1018 installation and uninstallation of files on the system, as well as the
1019 integrity of the system configuration. You may want to check if ICU can be
1020 packaged for your package management tools by looking into the
"packaging"
1021 directory. (Please note that if you are using a snapshot of ICU from Subversion, it
1022 is probable that the packaging scripts or related files are not up to date
1023 with the contents of ICU at this time, so use them with caution).
</p>
1025 <h3><a name=
"HowToBuildZOS" href=
"#HowToBuildZOS" id=
"HowToBuildZOS">How To
1026 Build And Install On z/OS (OS/
390)
</a></h3>
1028 <p>You can install ICU on z/OS or OS/
390 (the previous name of z/OS), but IBM
1029 tests only the z/OS installation. You install ICU in a z/OS UNIX system
1030 services file system such as HFS or zFS. On this platform, it is important
1031 that you understand a few details:
</p>
1034 <li>The makedep and GNU make tools are required for building ICU. If it
1035 is not already installed on your system, it is available at the
<a href=
1036 "http://www.ibm.com/servers/eserver/zseries/zos/unix/redbook/">z/OS UNIX -
1037 Tools and Toys
</a> site. The PATH environment variable should be updated to
1038 contain the location of this executable prior to build. Failure to add these
1039 tools to your PATH will cause ICU build failures or cause pkgdata to fail
1042 <li>Since USS does not support using the mmap() function over NFS, it is
1043 recommended that you build ICU on a local filesystem. Once ICU has been
1044 built, you should not have this problem while using ICU when the data
1045 library has been built as a shared library, which is this is the default
1048 <li>Encoding considerations: The source code assumes that it is compiled
1049 with codepage ibm-
1047 (to be exact, the UNIX System Services variant of
1050 it). The pax command converts all of the source code files from ASCII to
1051 codepage ibm-
1047 (USS) EBCDIC. However, some files are binary files and
1052 must not be converted, or must be converted back to their original state.
1053 You can use the
<a href=
"as_is/os390/unpax-icu.sh">unpax-icu.sh
</a> script
1054 to do this for you automatically. It will unpackage the tar file and
1055 convert all the necessary files for you automatically.
</li>
1057 <li>z/OS supports both native S/
390 hexadecimal floating point and (with
1058 OS/
390 2.6 and later) IEEE
754 binary floating point. This is a compile
1059 time option. Applications built with IEEE should use ICU DLLs that are
1060 built with IEEE (and vice versa). The environment variable IEEE390=
0 will
1061 cause the z/OS version of ICU to be built without IEEE floating point
1062 support and use the native hexadecimal floating point. By default ICU is
1063 built with IEEE
754 support. Native floating point support is sufficient
1064 for codepage conversion, resource bundle and UnicodeString operations, but
1065 the Format APIs require IEEE binary floating point.
</li>
1067 <li>z/OS introduced the concept of Extra Performance Linkage (XPLINK) to
1068 bring performance improvement opportunities to call-intensive C and C++
1069 applications such as ICU. XPLINK is enabled on a DLL-by-DLL basis, so if
1070 you are considering using XPLINK in your application that uses ICU, you
1071 should consider building the XPLINK-enabled version of ICU. You need to
1072 set ICU's environment variable
<code>OS390_XPLINK=
1</code> prior to
1073 invoking the make process to produce binaries that are enabled for
1074 XPLINK. The XPLINK option, which is available for z/OS
1.2 and later,
1075 requires the PTF PQ69418 to build XPLINK enabled binaries.
</li>
1077 <li>Currently in ICU
3.0, there is an issue with building on z/OS without
1078 XPLINK and with the C++ iostream. By default, the iostream library on z/OS
1079 is XPLINK enabled. If you are not building an XPLINK enabled version of
1080 ICU, you should use the
<code>--with-iostream=old
</code> configure option
1081 when using runConfigureICU. This will prevent applications that use the
1082 icuio library from crashing.
</li>
1084 <li>The rest of the instructions for building and testing ICU on z/OS with
1085 UNIX System Services are the same as the
<a href=
"#HowToBuildUNIX">How To
1086 Build And Install On UNIX
</a> section.
</li>
1089 <h4>z/OS (Batch/PDS) support outside the UNIX system services
1092 <p>By default, ICU builds its libraries into the UNIX file system (HFS). In
1093 addition, there is a z/OS specific environment variable (OS390BATCH) to build
1094 some libraries into the z/OS native file system. This is useful, for example,
1095 when your application is externalized via Job Control Language (JCL).
</p>
1097 <p>The OS390BATCH environment variable enables non-UNIX support including the
1098 batch environment. When OS390BATCH is set, the libicui18n
<i>XX
</i>.dll,
1099 libicuuc
<i>XX
</i>.dll, and libicudt
<i>XX
</i>e.dll binaries are built into
1100 data sets (the native file system). Turning on OS390BATCH does not turn off
1101 the normal z/OS UNIX build. This means that the z/OS UNIX (HFS) DLLs will
1102 always be created.
</p>
1104 <p>Two additional environment variables indicate the names of the z/OS data
1105 sets to use. The LOADMOD environment variable identifies the name of the data
1106 set that contains the dynamic link libraries (DLLs) and the LOADEXP
1107 environment variable identifies the name of the data set that contains the
1108 side decks, which are normally the files with the .x suffix in the UNIX file
1111 <p>A data set is roughly equivalent to a UNIX or Windows file. For most kinds
1112 of data sets the operating system maintains record boundaries. UNIX and
1113 Windows files are byte streams. Two kinds of data sets are PDS and PDSE. Each
1114 data set of these two types contains a directory. It is like a UNIX
1115 directory. Each
"file" is called a
"member". Each member name is limited to
1116 eight bytes, normally EBCDIC.
</p>
1118 <p>Here is an example of some environment variables that you can set prior to
1122 LOADMOD=
<i>USER
</i>.ICU.LOAD
1123 LOADEXP=
<i>USER
</i>.ICU.EXP
</samp>
1126 <p>The PDS member names for the DLL file names are as follows:
</p>
1128 <samp>IXMI
<i>XX
</i>IN --
> libicui18n
<i>XX
</i>.dll
1129 IXMI
<i>XX
</i>UC --
> libicuuc
<i>XX
</i>.dll
1130 IXMI
<i>XX
</i>DA --
> libicudt
<i>XX
</i>e.dll
</samp>
1133 <p>You should point the LOADMOD environment variable at a partitioned data
1134 set extended (PDSE) and point the LOADEXP environment variable at a
1135 partitioned data set (PDS). The PDSE can be allocated with the following
1138 <samp>Data Set Name . . . :
<i>USER
</i>.ICU.LOAD
1139 Management class. . :
<i>**None**
</i>
1140 Storage class . . . :
<i>BASE
</i>
1141 Volume serial . . . :
<i>TSO007
</i>
1142 Device type . . . . :
<i>3390</i>
1143 Data class. . . . . :
<i>LOAD
</i>
1144 Organization . . . : PO
1145 Record format . . . : U
1146 Record length . . . :
0
1147 Block size . . . . :
<i>32760</i>
1148 1st extent cylinders:
1
1149 Secondary cylinders :
5
1150 Data set name type : LIBRARY
</samp>
1153 <p>The PDS can be allocated with the following attributes:
</p>
1155 <samp>Data Set Name . . . :
<i>USER
</i>.ICU.EXP
1156 Management class. . :
<i>**None**
</i>
1157 Storage class . . . :
<i>BASE
</i>
1158 Volume serial . . . :
<i>TSO007
</i>
1159 Device type . . . . :
<i>3390</i>
1160 Data class. . . . . :
<i>**None**
</i>
1161 Organization . . . : PO
1162 Record format . . . : FB
1163 Record length . . . :
80
1164 Block size . . . . :
<i>3200</i>
1165 1st extent cylinders:
3
1166 Secondary cylinders :
3
1167 Data set name type : PDS
</samp>
1170 <h3><a name=
"HowToBuildOS400" href=
"#HowToBuildOS400" id=
1171 "HowToBuildOS400">How To Build And Install On i5/OS (OS/
400 iSeries)
</a></h3>
1173 <p>Before you start building ICU, ICU requires the following:
</p>
1176 <li>QSHELL interpreter installed (install base option
30, operating system)
1177 <!--li>QShell Utilities, PRPQ 5799-XEH (not required for V4R5)</li--></li>
1179 <li>ILE C/C++ Compiler for iSeries, LPP 5722-WDS</li>
1181 <li>The latest GNU facilities (You can get the GNU facilities for i5/OS
1183 "http://www.ibm.com/servers/enable/site/porting/iseries/overview/gnu_utilities.html">
1184 http://www.ibm.com/servers/enable/site/porting/iseries/overview/gnu_utilities.html</a>).
1185 Older versions may not work properly.</li>
1188 <p>The following describes how to setup and build ICU. For background
1189 information, you should look at the <a href="#HowToBuildUNIX">UNIX build
1190 instructions</a>.</p>
1194 Create i5/OS target library. This library will be the target for the
1195 resulting modules, programs and service programs. You will specify this
1196 library on the OUTPUTDIR environment variable.
1198 <samp>CRTLIB LIB(<i>libraryname</i>)
1199 ADDENVVAR ENVVAR(OUTPUTDIR) VALUE('<i>libraryname</i>')</samp>
1204 Set up the following environment variables and job characteristics in your build process
1206 <samp>ADDENVVAR ENVVAR(MAKE) VALUE('/usr/bin/gmake')
1207 CHGJOB CCSID(37)</samp>
1210 <li>Run <tt>'QSH'</tt></li>
1212 <li>Run gunzip on the ICU source code compressed tar archive
1213 (icu-<i>X</i>.<i>Y</i>.tgz).</li>
1215 <li>Run unpax-icu.sh on the tar file generated from the previous step.</li>
1217 <li>Change your current directory to icu/source.</li>
1219 <li>Run <tt>'./runConfigureICU i5OS'</tt> (See <a href="#HowToConfigureICU">configuration
1220 note</a> for details).</li></li>
1222 <li>Run <tt>'gmake'</tt> to build ICU.</li>
1224 <li>Run <tt>'gmake check QIBM_MULTI_THREADED=Y'</tt> to build and run the tests.
1225 You can look at the <a href=
1226 "http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/apis/concept4.htm">
1227 iSeries Information Center</a> for more details regarding the running of multiple threads
1230 <!-- end build environment -->
1232 <h2><a name=
"HowToPackage" href=
"#HowToPackage" id=
"HowToPackage">How To
1233 Package ICU
</a></h2>
1235 <p>There are many ways that a person can package ICU with their software
1236 products. Usually only the libraries need to be considered for packaging.
</p>
1238 <p>On UNIX, you should use
"<tt>gmake install</tt>" to make it easier to
1239 develop and package ICU. The bin, lib and include directories are needed to
1240 develop applications that use ICU. These directories will be created relative
1241 to the
"<tt>--prefix=</tt><i>dir</i>" configure option (See the
<a href=
1242 "#HowToBuildUNIX">UNIX build instructions
</a>). When ICU is built on Windows,
1243 a similar directory structure is built.
</p>
1245 <p>When changes have been made to the standard ICU distribution, it is
1246 recommended that at least one of the following guidelines be followed for
1247 special packaging.
</p>
1250 <li>Add a suffix name to the library names. This can be done with the
1251 --with-library-suffix configure option.
</li>
1253 <li>The installation script should install the ICU libraries into the
1254 application's directory.
</li>
1257 <p>Following these guidelines prevents other applications that use a standard
1258 ICU distribution from conflicting with any libraries that you need. On
1259 operating systems that do not have a standard C++ ABI (name mangling) for
1260 compilers, it is recommended to do this special packaging anyway. More
1261 details on customizing ICU are available in the
<a href=
1262 "http://www.icu-project.org/userguide/">User's Guide
</a>. The
<a href=
1263 "#SourceCode">ICU Source Code Organization
</a> section of this readme.html
1264 gives a more complete description of the libraries.
</p>
1266 <table border=
"1" cellpadding=
"3" summary=
1267 "ICU has several libraries for you to use.">
1269 Here is an example of libraries that are frequently packaged.
1273 <th scope=
"col">Library Name
</th>
1275 <th scope=
"col">Windows Filename
</th>
1277 <th scope=
"col">Linux Filename
</th>
1279 <th scope=
"col">Comment
</th>
1283 <td>Data Library
</td>
1285 <td>icudt
<i>XY
</i>l.dll
</td>
1287 <td>libicudata.so.
<i>XY
</i>.
<i>Z
</i></td>
1289 <td>Data required by the Common and I18n libraries. There are many ways
1290 to package and
<a href=
1291 "http://www.icu-project.org/userguide/icudata.html">customize this
1292 data
</a>, but by default this is all you need.
</td>
1296 <td>Common Library
</td>
1298 <td>icuuc
<i>XY
</i>.dll
</td>
1300 <td>libicuuc.so.
<i>XY
</i>.
<i>Z
</i></td>
1302 <td>Base library required by all other ICU libraries.
</td>
1306 <td>Internationalization (i18n) Library
</td>
1308 <td>icuin
<i>XY
</i>.dll
</td>
1310 <td>libicui18n.so.
<i>XY
</i>.
<i>Z
</i></td>
1312 <td>A library that contains many locale based internationalization (i18n)
1317 <td>Layout Engine
</td>
1319 <td>icule
<i>XY
</i>.dll
</td>
1321 <td>libicule.so.
<i>XY
</i>.
<i>Z
</i></td>
1323 <td>An optional engine for doing font layout.
</td>
1327 <td>Layout Extensions Engine
</td>
1329 <td>iculx
<i>XY
</i>.dll
</td>
1331 <td>libiculx.so.
<i>XY
</i>.
<i>Z
</i></td>
1333 <td>An optional engine for doing font layout that uses parts of ICU.
</td>
1337 <td>ICU I/O (Unicode stdio) Library
</td>
1339 <td>icuio
<i>XY
</i>.dll
</td>
1341 <td>libicuio.so.
<i>XY
</i>.
<i>Z
</i></td>
1343 <td>An optional library that provides a stdio like API with Unicode
1348 <td>Tool Utility Library
</td>
1350 <td>icutu
<i>XY
</i>.dll
</td>
1352 <td>libicutu.so.
<i>XY
</i>.
<i>Z
</i></td>
1354 <td>An internal library that contains internal APIs that are only used by
1355 ICU's tools. If you do not use ICU's tools, you do not need this
1360 <p>Normally only the above ICU libraries need to be considered for packaging.
1361 The versionless symbolic links to these libraries are only needed for easier
1362 development. The
<i>X
</i>,
<i>Y
</i> and
<i>Z
</i> parts of the name are the
1363 version numbers of ICU. For example, ICU
2.0.2 would have the name
1364 libicuuc.so
.20.2 for the common library. The exact format of the library
1365 names can vary between platforms due to how each platform can handles library
1368 <h2><a name=
"ImportantNotes" href=
"#ImportantNotes" id=
1369 "ImportantNotes">Important Notes About Using ICU
</a></h2>
1371 <h3><a name=
"ImportantNotesMultithreaded" href=
"#ImportantNotesMultithreaded"
1372 id=
"ImportantNotesMultithreaded">Using ICU in a Multithreaded
1373 Environment
</a></h3>
1375 <p>Some versions of ICU require calling the
<code>u_init()
</code> function
1376 from
<code>uclean.h
</code> to ensure that ICU is initialized properly. In
1377 those ICU versions,
<code>u_init()
</code> must be called before ICU is used
1378 from multiple threads. There is no harm in calling
<code>u_init()
</code> in a
1379 single-threaded application, on a single-CPU machine, or in other cases where
1380 <code>u_init()
</code> is not required.
</p>
1382 <p>In addition to ensuring thread safety,
<code>u_init()
</code> also attempts
1383 to load at least one ICU data file. Assuming that all data files are packaged
1384 together (or are in the same folder in files mode), a failure code from
1385 <code>u_init()
</code> usually means that the data cannot be found. In this
1386 case, the data may not be installed properly, or the application may have
1387 failed to call
<code>udata_setCommonData()
</code> or
1388 <code>u_setDataDirectory()
</code> which specify to ICU where it can find its
1391 <p>Since
<code>u_init()
</code> will load only one or two data files, it
1392 cannot guarantee that all of the data that an application needs is available.
1393 It cannot check for all data files because the set of files is customizable,
1394 and some ICU services work without loading any data at all. An application
1395 should always check for error codes when opening ICU service objects (using
1396 <code>ucnv_open()
</code>,
<code>ucol_open()
</code>, C++ constructors,
1399 <h4>ICU
3.4 and later
</h4>
1401 <p>ICU
3.4 self-initializes properly for multi-threaded use. It achieves this
1402 without performance penalty by hardcoding the core Unicode properties data,
1403 at the cost of some flexibility. (For details see Jitterbug
4497.)
</p>
1405 <p><code>u_init()
</code> can be used to check for data loading. It tries to
1406 load the converter alias table (
<code>cnvalias.icu
</code>).
</p>
1408 <h4>ICU
2.6.
.3.2</h4>
1410 <p>These ICU versions require a call to
<code>u_init()
</code> before
1411 multi-threaded use. The services that are directly affected are those that
1412 don't have a service object and need to be fast: normalization and character
1415 <p><code>u_init()
</code> loads and initializes the data files for
1416 normalization and character properties (
<code>unorm.icu
</code> and
1417 <code>uprops.icu
</code>) and can therefore also be used to check for data
1420 <h4>ICU
2.4 and earlier
</h4>
1422 <p>ICU
2.4 and earlier versions were not prepared for multithreaded use on
1423 multi-CPU platforms where the CPUs implement weak memory coherency. These
1424 CPUs include: Power4, Power5, Alpha, Itanium.
<code>u_init()
</code> was not
1427 <h4><a name=
"ImportantNotesHPUX" href=
"#ImportantNotesHPUX" id=
1428 "ImportantNotesHPUX">Using ICU in a Multithreaded Environment on
1431 <p>If you are building ICU with a newer aCC compiler and you are planning on
1432 using the older
<iostream.h
> instead of the newer
<iostream
>, you
1433 will need to use a special configure flag before building ICU. By default,
1434 the aCC
<a href=
"http://docs.hp.com/en/1405/options.htm#optioncap-AA">-AA
</a>
1435 flag is used on HP-UX when the compiler supports that option in order to make
1436 ICU thread safe with RogueWave and other libraries using the
2.0 Standard C++
1437 library. Your applications that use ICU will also need to use the
<a href=
1438 "http://docs.hp.com/en/1405/options.htm#optioncap-AA">-AA
</a> compiler flag.
1439 To turn off this behavior in ICU, you will need to use the --with-iostream=old
1440 configure option when you first use runConfigureICU.
</p>
1442 <h4><a name=
"ImportantNotesSolaris" href=
"#ImportantNotesSolaris" id=
1443 "ImportantNotesSolaris">Using ICU in a Multithreaded Environment on
1446 <h5>Linking on Solaris
</h5>
1448 <p>In order to avoid synchronization and threading issues, developers are
1449 <strong>suggested
</strong> to strictly follow the compiling and linking
1450 guidelines for multithreaded applications, specified in the following
1451 document from Sun Microsystems. Most notably, pay strict attention to the
1452 following statements from Sun:
</p>
1455 <p>To use libthread, specify -lthread before -lc on the ld command line, or
1456 last on the cc command line.
</p>
1458 <p>To use libpthread, specify -lpthread before -lc on the ld command line,
1459 or last on the cc command line.
</p>
1462 <p>Failure to do this may cause spurious lock conflicts, recursive mutex
1463 failure, and deadlock.
</p>
1465 <p>Source:
"<i>Solaris Multithreaded Programming Guide, Compiling and
1466 Debugging</i>", Sun Microsystems, Inc., Apr
2004<br />
1468 "http://docs.sun.com/app/docs/doc/816-5137/6mba5vpke?a=view">http://docs.sun.com/app/docs/doc/
816-
5137/
6mba5vpke?a=view
</a></p>
1470 <h3><a name=
"ImportantNotesWindows" href=
"#ImportantNotesWindows" id=
1471 "ImportantNotesWindows">Windows Platform
</a></h3>
1473 <p>If you are building on the Win32 platform, it is important that you
1474 understand a few of the following build details.
</p>
1476 <h4>DLL directories and the PATH setting
</h4>
1478 <p>As delivered, the International Components for Unicode build as several
1479 DLLs, which are placed in the
"<i><ICU></i>\bin" directory. You must
1480 add this directory to the PATH environment variable in your system, or any
1481 executables you build will not be able to access International Components for
1482 Unicode libraries. Alternatively, you can copy the DLL files into a directory
1483 already in your PATH, but we do not recommend this. You can wind up with
1484 multiple copies of the DLL and wind up using the wrong one.
</p>
1486 <h4><a name=
"ImportantNotesWindowsPath" id=
1487 "ImportantNotesWindowsPath">Changing your PATH
</a></h4>
1489 <p><strong>Windows
2000/XP
</strong>: Use the System Icon in the Control
1490 Panel. Pick the
"Advanced" tab. Select the
"Environment Variables..."
1491 button. Select the variable PATH in the lower box, and select the lower
1492 "Edit..." button. In the
"Variable Value" box, append the string
1493 ";<i><ICU></i>\bin" to the end of the path string. If there is
1494 nothing there, just type in
"<i><ICU></i>\bin". Click the Set button,
1495 then the OK button.
</p>
1497 <p>Note: When packaging a Windows application for distribution and
1498 installation on user systems, copies of the ICU DLLs should be included with
1499 the application, and installed for exclusive use by the application. This is
1500 the only way to insure that your application is running with the same version
1501 of ICU, built with exactly the same options, that you developed and tested
1502 with. Refer to Microsoft's guidelines on the usage of DLLs, or search for the
1503 phrase
"DLL hell" on
<a href=
1504 "http://msdn.microsoft.com/">msdn.microsoft.com
</a>.
</p>
1506 <h3><a name=
"ImportantNotesUNIX" href=
"#ImportantNotesUNIX" id=
1507 "ImportantNotesUNIX">UNIX Type Platform
</a></h3>
1509 <p>If you are building on a UNIX platform, and if you are installing ICU in a
1510 non-standard location, you may need to add the location of your ICU libraries
1511 to your
<strong>LD_LIBRARY_PATH
</strong> or
<strong>LIBPATH
</strong>
1512 environment variable (or the equivalent runtime library path environment
1513 variable for your system). The ICU libraries may not link or load properly
1514 without doing this.
</p>
1516 <p>Note that if you do not want to have to set this variable, you may instead
1517 use the --enable-rpath option at configuration time. This option will
1518 instruct the linker to always look for the libraries where they are
1519 installed. You will need to use the appropriate linker options when linking
1520 your own applications and libraries against ICU, too. Please refer to your
1521 system's linker manual for information about runtime paths. The use of rpath
1522 also means that when building a new version of ICU you should not have an
1523 older version installed in the same place as the new version's installation
1524 directory, as the older libraries will used during the build, instead of the
1525 new ones, likely leading to an incorrectly build ICU. This is the proper
1526 behavior of rpath.
</p>
1528 <h2><a name=
"PlatformDependencies" href=
"#PlatformDependencies" id=
1529 "PlatformDependencies">Platform Dependencies
</a></h2>
1531 <h3><a name=
"PlatformDependenciesNew" href=
"#PlatformDependenciesNew" id=
1532 "PlatformDependenciesNew">Porting To A New Platform
</a></h3>
1534 <p>If you are using ICU's Makefiles to build ICU on a new platform, there are
1535 a few places where you will need to add or modify some files. If you need
1536 more help, you can always ask the
<a href=
1537 "http://www.icu-project.org/contacts.html">icu-support mailing list
</a>. Once
1538 you have finished porting ICU to a new platform, it is recommended that you
1539 contribute your changes back to ICU via the icu-support mailing list. This
1540 will make it easier for everyone to benefit from your work.
</p>
1542 <h4>Data For a New Platform
</h4>
1544 <p>For some people, it may not be necessary for completely build ICU. Most of
1545 the makefiles and build targets are for tools that are used for building
1546 ICU's data, and an application's data (when an application uses ICU resource
1547 bundles for its data).
</p>
1549 <p>Data files can be built on a different platform when both platforms share
1550 the same endianness and the same charset family. This assertion does not
1551 include platform dependent DLLs/shared/static libraries. For details see the
1552 User Guide
<a href=
"http://www.icu-project.org/userguide/icudata.html">ICU
1553 Data
</a> chapter.
</p>
1555 <p>ICU
3.6 removes the requirement that ICU be completely built in the native
1556 operating environment. It adds the icupkg tool which can be run on any
1557 platform to turn binary ICU data files from any one of the three formats into
1558 any one of the other data formats. This allows a application to use ICU data
1559 built anywhere to be used for any other target platform.
</p>
1561 <p><strong>WARNING!
</strong> Building ICU without running the tests is not
1562 recommended. The tests verify that ICU is safe to use. It is recommended that
1563 you try to completely port and test ICU before using the libraries for your
1564 own application.
</p>
1566 <h4>Adapting Makefiles For a New Platform
</h4>
1568 <p>Try to follow the build steps from the
<a href=
"#HowToBuildUNIX">UNIX
</a>
1569 build instructions. If the configure script fails, then you will need to
1570 modify some files. Here are the usual steps for porting to a new
1575 <li>Create an mh file in icu/source/config/. You can use mh-linux or a
1576 similar mh file as your base configuration.
</li>
1578 <li>Modify icu/source/aclocal.m4 to recognize your platform's mh file.
</li>
1580 <li>Modify icu/source/configure.in to properly set your
<b>platform
</b> C
1583 <li>Run
<a href=
"http://www.gnu.org/software/autoconf/">autoconf
</a> in
1584 icu/source/ without any options. The autoconf tool is standard on most
1587 <li>If you have any optimization options that you want to normally use, you
1588 can modify icu/source/runConfigureICU to specify those options for your
1591 <li>Build and test ICU on your platform. It is very important that you run
1592 the tests. If you don't run the tests, there is no guarentee that you have
1593 properly ported ICU.
</li>
1596 <h3><a name=
"PlatformDependenciesImpl" href=
"#PlatformDependenciesImpl" id=
1597 "PlatformDependenciesImpl">Platform Dependent Implementations
</a></h3>
1599 <p>The platform dependencies have been mostly isolated into the following
1600 files in the common library. This information can be useful if you are
1601 porting ICU to a new platform.
</p>
1605 <strong>unicode/platform.h.in
</strong> (autoconf'ed platforms)
<br />
1606 <strong>unicode/p
<i>XXXX
</i>.h
</strong> (others: pwin32.h, ppalmos.h,
1607 ..): Platform-dependent typedefs and defines:
<br />
1612 <li>Generic types like UBool, int8_t, int16_t, int32_t, int64_t,
1615 <li>U_EXPORT and U_IMPORT for specifying dynamic library import and
1618 <li><iostream
> usability
</li>
1620 <li>Thread safety usability
</li>
1626 <strong>unicode/putil.h, putil.c
</strong>: platform-dependent
1627 implementations of various functions that are platform dependent:
<br />
1632 <li>uprv_isNaN, uprv_isInfinite, uprv_getNaN and uprv_getInfinity for
1633 handling special floating point values.
</li>
1635 <li>uprv_tzset, uprv_timezone, uprv_tzname and time for getting
1636 platform specific time and time zone information.
</li>
1638 <li>u_getDataDirectory for getting the default data directory.
</li>
1640 <li>uprv_getDefaultLocaleID for getting the default locale
1643 <li>uprv_getDefaultCodepage for getting the default codepage
1650 <strong>umutex.h, umutex.c
</strong>: Code for doing synchronization in
1651 multithreaded applications. If you wish to use International Components
1652 for Unicode in a multithreaded application, you must provide a
1653 synchronization primitive that the classes can use to protect their
1654 global data against simultaneous modifications. We already supply working
1655 implementations for many platforms that ICU builds on.
<br />
1659 <li><strong>umapfile.h, umapfile.c
</strong>: functions for mapping or
1660 otherwise reading or loading files into memory. All access by ICU to data
1661 from files makes use of these functions.
<br />
1665 <li>Using platform specific #ifdef macros are highly discouraged outside of
1666 the scope of these files. When the source code gets updated in the future,
1667 these #ifdef's can cause testing problems for your platform.
</li>
1671 <p>Copyright
© 1997-
2007 International Business Machines Corporation and
1672 others. All Rights Reserved.
<br />
1673 IBM Globalization Center of Competency - San Jos
é<br />
1674 4400 North First Street
<br />
1675 San Jos
é, CA
95134<br />