Compile fixes
[ACE_TAO.git] / ACE / ACE-INSTALL.html
blob185fe6d9d5235a67f7b455c7fb58c6f860c278e8
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><!-- -->
3 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>Building and Installing ACE and Its Auxiliary Libraries and Services</title>
5 <link rev="made" href="mailto:d.schmidt@vanderbilt.edu">
7 <style>
8 body {
9 background-color: #ffffff;
10 color: #000000;
12 table, th, td {
13 border: 1px solid black;
15 .indent {
16 margin-left: 2em;
18 .boxed {
19 border: 1px solid black;
20 border-radius: 0.3em;
21 padding-right: 0.5em;
22 padding-left: 0.5em;
23 margin: 0.5em;
25 pre, code {
26 background-color: #e3e3e3;
27 border-radius: 0.2em;
28 padding-right: 0.2em;
29 padding-left: 0.2em;
31 </style>
32 </head>
34 <body>
36 <hr>
37 <h1>Building and Installing ACE and Its Auxiliary Libraries and Services</h1>
39 <h2>Synopsis</h2>
41 The file explains how to build and install ACE, its Network Services,
42 test suite and examples on the various OS platforms and compilers that
43 it has been ported to. Please consult the <a href="NEWS">NEWS</a> and
44 <a href="ChangeLogs">ChangeLogs</a> files to see whether any recent changes
45 to the release will affect your code. In addition, you should check
46 out our <a
47 href="docs/ACE-development-process.html">development
48 process</a>. As you start working with ACE, we suggest you get copies
49 of the <a
50 href="http://www.dre.vanderbilt.edu/~schmidt/ACE/book1/">C++NPv1</a>, <a
51 href="http://www.dre.vanderbilt.edu/~schmidt/ACE/book1/">C++NPv2</a>, and
52 <a href="http://www.riverace.com/acebooks/">APG</a> books to help
53 guide you after you've built and installed ACE. You should also
54 consult the <a
55 href="docs/ACE-FMM.html">ACE
56 Frequently Made Mistakes page</a>. If you encounter any problems or
57 would like to request an enhancement, then use <a
58 href="https://github.com/DOCGroup/ACE_TAO">github
59 </a> to submit an issue in accordance with our <a
60 href="docs/ACE-bug-process.html">bug
61 report process</a>.<p>
63 </p><h2>Document Index</h2>
65 <ul>
66 <li><a href="#platforms">Platforms, C++ Compilers, and Support</a></li>
67 <li><a href="#installpre">Installation prerequisites</a></li>
68 <li><a href="#aceinstall">Building and Installing ACE</a></li>
69 <li><a href="#svcsinstall">Building and Installing ACE Network Services</a></li>
70 <li><a href="#sslinstall">Building and Installing The ACE_SSL Library</a></li>
71 <li><a href="#guireactor_install">Building and Using GUI Reactors Libraries</a></li>
72 <li><a href="#installnotes">Installation Notes</a></li>
73 <li><a href="#g++">Compiling ACE with GNU g++</a></li>
74 <li><a href="#minimum_build">What Do I Need to Build for TAO?</a></li>
75 <li><a href="#resource_requirements">System Resource Requirements</a></li>
76 <li><a href="#MPC">General MPC Information</a></li>
77 <li><a href="#eclipse">Working with ACE in Eclipse</a></li>
78 <li><a href="#advanced">Advanced Topics</a></li>
79 <li><a href="#power">Building from git</a></li>
80 </li></ul>
83 <p></p><hr><p>
84 </p><h2><a name="platforms">Platforms, C++ Compilers, and Support</a></h2>
86 <p>ACE has been ported to a large number of platforms using many different
87 compilers over the years.
88 The <a href="http://www.dre.vanderbilt.edu/">DOC group</a>,
89 <a href="http://www.riverace.com/">Riverace</a>,
90 <a href="http://www.theaceorb.com/">OCI</a>,
91 <a href="https://www.remedy.nl/">Remedy IT</a>, and members of the ACE
92 user community have all contributed ports to make ACE the successful
93 and far-reaching toolkit it is today. Any UNIX/POSIX/Windows
94 variation is probably an easy target platform for ACE. If you have
95 <a href="docs/ACE-porting.html">porting questions</a> or have a problem
96 compiling the ACE source distribution, please contact one of the
97 commercial support companies, or create a <a href="https://github.com/DOCGroup/ACE_TAO">github
98 issue or discussion</a> using the <a href="PROBLEM-REPORT-FORM">PROBLEM-REPORT-FORM</a>,
99 located in the ACE_wrappers directory.
100 The DOC groups at Washington University, UC Irvine, and Vanderbilt
101 University provide only "best effort" support for non-sponsors for the
102 latest release, as described in <a href="docs/ACE-bug-process.html">
103 docs/ACE-bug-process.html</a>.
104 Thus, if you need more "predictable" help, or help with earlier versions of
105 ACE, it's recommend that you check out the
106 <a href="http://www.dre.vanderbilt.edu/support.html">list of
107 commercial support companies</a> for additional assistance.
108 </p>
109 <p>The responsibility for maintaining ACE across the wide range of
110 supported platforms is divided among a few different groups:
111 <ul>
112 <li>The DOC group maintains platforms used in the course of their research
113 and sponsored work</li>
114 <li>Companies that provide support (Riverace, OCI, and Remedy IT), maintain
115 platforms they support in the course of their various service offerings</li>
116 <li>The ACE user community maintains any other desired platforms.</li>
117 </ul>
118 The <a href="http://www.dre.vanderbilt.edu/scoreboard/" target="_blank">
119 build scoreboard</a>
120 records the current status of build and regression testing during
121 development by all of the above groups. It is available to all users wishing
122 to provide build results. Members of the ACE community that maintain ACE on
123 platforms not maintained by the DOC group, Riverace, OCI, or Remedy IT are
124 encouraged to provide build and regression test results for the scoreboard
125 to ensure that all in-use platforms are represented.
126 See the <a href="https://raw.githubusercontent.com/DOCGroup/autobuild/master/README" target="_blank">autobuild README</a> for more information about
127 how to set up a build; contact one of the above groups to inquire about how
128 to get your build results recorded on the scoreboard.</p>
129 <p>Because older
130 platforms that are not maintained tend to fall into a broken state and
131 clutter the ACE sources with code that is no longer used, the development
132 team reserves the right to remove ACE configuration files and source code
133 specific to inactive platform configurations that are not
134 listed on the scoreboard.</p>
135 <p>The table below summarizes each group's role and where you can get more
136 detailed information. For information on TAO's platform coverage and
137 support, please also see <a href="TAO/TAO-INSTALL.html">TAO's install
138 document</a>.</p><p>
140 <table width="75%">
141 <caption><b>Groups Involved in ACE Development and Support<br></b></caption>
142 <thead>
143 <tr valign="top">
144 <th>Group</th>
145 <th>Platforms</th>
146 <th>For more information</th>
147 </tr>
148 </thead><tbody>
149 <tr>
150 <th>DOC Group</th>
151 <td>
152 </td>
153 <td>DOC sites at <a href="http://www.dre.vanderbilt.edu/">ISIS</a>,
154 <a href="http://www.uci.edu/">UCI</a> and
155 <a href="https://wustl.edu//">Washington University</a>
156 </td>
157 </tr>
158 <tr>
159 <th>Riverace</th>
160 <td>Offers ACE
161 <a href="http://www.riverace.com/training.htm">training</a>,
162 <a href="http://www.riverace.com/support.htm">support</a> and
163 <a href="http://www.riverace.com/consult.htm">consulting services</a>
164 for many platforms including AIX, HP-UX, Linux, Solaris, and Windows.
165 </td>
166 <td>Riverace's <a href="http://www.riverace.com/support.htm">ACE
167 Support page</a>.</td>
168 </tr>
169 <tr>
170 <th>OCI</th>
171 <td>Maintains ACE on certain platforms required for their TAO
172 software and service offerings.
173 </td>
174 <td>
175 <a href="http://www.objectcomputing.com/">OCI's web site</a>,
176 <a href="https://objectcomputing.com/products/tao">TAO page</a>,
177 and the <a href="../TAO/TAO-INSTALL.html">TAO install document</a></td>
178 </tr>
179 <tr>
180 <th>Remedy IT</th>
181 <td>Maintains ACE on many platforms required for their ACE and
182 TAO service offerings. We support AIX,
183 Embarcadero C++ Builder,
184 MinGW, Microsoft Visual C++, GCC,
185 Cygwin, VxWorks 6.x (kernel and rtp),
186 BlueCAT Linux, RedHat Linux, Fedora, MacOSX, Solaris,
187 SuSE Linux on IA32/EM64T/IA64, QNX, LynxOS,
188 and Android.
189 The Intel C++ compiler is supported on
190 Windows 32/64bit, Linux IA32/EM64T/IA64, MacOSX.
191 </td>
192 <td>Remedy IT <a href="https://www.remedy.nl/">web site</a> and
193 the TAO <a href="TAO/TAO-INSTALL.html">install document</a>
194 </td>
195 </tr>
196 <tr>
197 <th>PrismTech</th>
198 <td>Maintains ACE on certain platforms required for their TAO
199 software and service offerings, including LynxOS.
200 </td>
201 <td>PrismTech's <a href="http://www.prismtech.com/">web site</a></td>
202 </tr>
203 <tr>
204 <th>ACE user community</th>
205 <td>Responsible for continued maintenance and testing of platforms
206 to which ACE has been ported, but aren't supported by the
207 above groups. These include
208 Digital UNIX (Compaq Tru64) 4.0 and 5.0;
209 IRIX 6.x; UnixWare 7.1.0;
210 Linux on PPC; OpenMVS;
211 Tandem; SCO; FreeBSD; NetBSD; OpenBSD;
212 Macintosh OS X; OS/9; PharLap ETS 13;
213 QNX RTP and Neutrino 2.0
214 </td>
215 </tr><tr>
216 <th>Not maintained</th>
217 <td>The following platforms have been ported to in the past but are
218 no longer maintained and may be removed from ACE at any time.
219 If you want to have support for these environments contact one
220 of the commercial support organisations. The platforms include:
221 Chorus; DG/UX; HP-UX 9, 10 and 11.00; pSOS;
222 SunOS 4.x and Solaris with SunC++ 4.x; VxWorks 5.4 and earlier;
223 Microsoft Visual C++ 5, 6, and 7.0; Borland C++ Builder 4, 5, 6, and 2006.
224 For up-to-date listings on platform that are deprecated and pending
225 removal from ACE, please see the <a href="NEWS">NEWS file</a>.
226 </td>
227 </tr>
228 </tbody></table></p><p>
230 </p><p>Although the DOC group has provided outstanding support for ACE
231 over the years, ACE's success has greatly increased the amount of
232 effort required to keep up with its maintenance, answer users'
233 questions, and give design guidance. Riverace offers world-class
234 commercial services to support ACE users. OCI, PrismTech, and Remedy
235 offer similar services for ACE and TAO, allowing the DOC group's primary focus
236 to shift back to their main goal: <em>research</em>. The DOC group is
237 fundamentally focused on (and <a
238 href="http://www.dre.vanderbilt.edu/~schmidt/resume-grants.html">funded
239 by</a>) advanced R&amp;D projects. The group continues to be
240 intimately involved in ACE+TAO development and maintenance, but with
241 revised priorities for maintenance. The <a
242 href="docs/ACE-bug-process.html">bug
243 fixing policies</a> followed by the DOC group are designed to strike a
244 balance between their many <a
245 href="http://www.dre.vanderbilt.edu/~schmidt/research.html">research
246 projects</a> and their commitment to the ACE+TAO <a
247 href="http://www.dre.vanderbilt.edu/~schmidt/ACE-users.html">user
248 community</a>. Naturally, we will be happy to accept well-tested
249 patches from the ACE+TAO user community for any platforms that aren't
250 supported by the DOC group, Riverace, OCI or Remedy IT. </p><p>
252 </p><p></p><hr><p>
253 </p><h2><a name="installpre">Installation prerequisites</a></h2>
255 <p> ACE (as well as TAO) use <A
256 HREF="http://htmlpreview.github.io/?https://github.com/DOCGroup/MPC/blob/master/docs/html/MakeProjectCreator.html">MPC</A>
257 (MakeProjectCreator) to generate files used by all supported build
258 tools (such as GNUmakefiles for UNIX based platforms, sln and vcproj
259 files for Visual Studio and Embarcadero makefiles) on various platforms. To
260 help new users to bootstrap quickly the release bundles of ACE (as
261 well as TAO) include all needed files to use the build
262 instructions in this document.
264 </p>
266 If it is necessary to generate
267 files for build tools for other compilers, one must
268 run MPC to generate the
269 appropriate files. Please see <a href="MPC/docs/USAGE">USAGE</a>, <a
270 href="MPC/docs/README">README</a>, and <a
271 href="bin/MakeProjectCreator/README">README for ACE</a> files for
272 details. The options that have been used to generate the above build
273 files can be found in <a
274 href="bin/MakeProjectCreator/config/global.features">
275 global.features</a> file.
276 </p>
278 <hr>
279 <h1><a name="aceinstall">Building and Installing ACE</a></h1>
281 The following sections explain how to build ACE on:
282 <ul>
283 <li><a href="#unix">UNIX</a></li>
284 <li><a href="#win32">Windows (including MinGW and Cygwin)</a></li>
285 <li><a href="#vxworks">VxWorks</a></li>
286 <li><a href="#android">Android</a></li>
287 </ul>
289 <h2>General Rules</h2>
290 <ul>
291 <li><p>Many features in ACE can be modified by defining some macros in
292 <code>$ACE_ROOT/ace/config.h</code>. These macros should
293 <em><b>always</b></em> appear <em><b>before</b></em> including
294 your platform specific config file.</p>
295 </li><li><p>However, if you want to undefine/redefine macros defined in the
296 platform specific config file, these <code>#undef</code> should
297 come <em><b>after</b></em> the config file.</p>
298 </li><li> If you're planning to build ACE on multiple platforms, you may
299 want to consider <a href="#cloning">cloning the source tree</a>
300 before you start. <p>
301 </p></li></ul>
303 <hr align="left" width="50%">
304 <h2><a name="unix">Building and Installing ACE on UNIX</a></h2>
306 As of ACE 6.0.6, you can building ACE on
307 UNIX with:
308 <ol>
309 <li><a href="#unix_traditional">Traditional ACE/GNU Make Configuration</a></li>
310 </ol>
311 The <a href="#win32">build process for Windows</a> is different from
312 the UNIX methods.
314 <h3><a name="unix_traditional">Using the Traditional ACE/GNU Configuration</a></h3>
316 Here's what you need to do to build ACE using GNU Make and ACE's traditional
317 per-platform configuration method:</p>
319 <ol>
320 <li>Install <a href="http://ftp.gnu.org/pub/gnu/make/">GNU make</a>
321 3.79.1 or greater on your system (available via <code>http</code>
322 anonymous <code>ftp</code> from <code>ftp.gnu.org</code> in the
323 <code>pub/gnu/make/</code> directory).
324 You <em>must</em> use GNU make when using ACE's traditional
325 per-platform configuration method or ACE won't compile.
326 </li>
327 <li>Add an environment variable called ACE_ROOT that contains the
328 name of the root of the directory where you keep the ACE wrapper
329 source tree. The ACE recursive Makefile scheme needs this information.
330 There are several ways to set the ACE_ROOT variable. For example:
331 <blockquote>
332 TSCH/CSH:
333 <code>setenv ACE_ROOT /home/cs/faculty/schmidt/ACE_wrappers</code>
334 </blockquote>
335 <blockquote>
336 BASH or Bourne Shell:
337 <code>export ACE_ROOT=/home/cs/faculty/schmidt/ACE_wrappers
338 </code>
339 </blockquote>
341 If you're building a number of versions of ACE, however, (e.g., for
342 different OS platforms or for different releases of ACE) you might use
343 the following approach (assuming TCSH/CSH):
344 <blockquote>
345 <code>setenv ACE_ROOT $cwd</code>
346 </blockquote>
347 </li>
348 <li>Create a configuration file, <code>$ACE_ROOT/ace/config.h</code>,
349 that includes the appropriate platform/compiler-specific
350 header configurations from the ACE source directory. For example:
351 <blockquote><code>
352 #include "ace/config-linux.h"
353 </code></blockquote>
354 The platform/compiler-specific configuration file
355 contains the #defines that are used throughout ACE to indicate
356 which features your system supports. See the
357 <code>$ACE_ROOT/ace/README</code> file for a description of these
358 macro settings. If you desire to add some site-specific or build-specific
359 changes, you can add them to your config.h file; place them
360 <strong>before</strong> the inclusion of the platform-specific
361 header file.
363 There are config files for most versions of UNIX. If there
364 isn't a version of this file that matches your
365 platform/compiler, you'll need to make one. Please open an issue at our
366 <a href="https://github.com/DOCGroup/ACE_TAO">github project</a>
367 if you get it working so it can be added to the master ACE
368 release.</p>
369 </li>
371 <li>Create a build configuration file,
372 <code>$ACE_ROOT/include/makeinclude/platform_macros.GNU</code>,
373 that contains the appropriate platform/compiler-specific
374 Makefile configurations, e.g.,
375 <blockquote><code>
376 include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
377 </code></blockquote>
378 This file contains the compiler and Makefile directives that are
379 platform/compiler-specific. If you'd like to add make options, you
380 can add them before including the platform-specific configuration.<p>
381 NOTE! There really is not a # character before 'include' in the
382 platform_macros.GNU file. # is a comment character.
383 </li>
384 <li>If you wish to install ACE (using &quot;make install&quot;), set the
385 installation prefix in platform_macros.GNU.
386 <blockquote><code>
387 INSTALL_PREFIX = /usr/local
388 </code></blockquote>
389 Headers will be installed to $INSTALL_PREFIX/include, executables to
390 $INSTALL_PREFIX/bin, documentation and build system files to
391 $INSTALL_PREFIX/share and libraries to $INSTALL_PREFIX/lib. The library
392 directory can be customized by setting INSTALL_LIB (for example,
393 INSTALL_LIB=lib64). With INSTALL_PREFIX set, RPATH will be enabled for
394 all executables and shared libraries. To disable RPATH (for example,
395 if $INSTALL_PREFIX/$INSTALL_LIB is already a system-known location for
396 shared libraries such as those listed in /etc/ld.so.conf), set the make
397 macro install_rpath to 0 by adding install_rpath=0 to platform_macros.GNU.
398 </li>
399 <li>Note that because ACE builds shared libraries, you'll need to set
400 LD_LIBRARY_PATH (or equivalent for your platform) to the directory
401 where binary version of the ACE library is built into. For example,
402 you probably want to do something like the following:
403 <blockquote>
404 <code>% setenv LD_LIBRARY_PATH $ACE_ROOT/lib:$LD_LIBRARY_PATH</code></blockquote>
405 </blockquote>
407 <blockquote>
408 <code>% export LD_LIBRARY_PATH=$ACE_ROOT/lib:$LD_LIBRARY_PATH</code></blockquote>
409 </blockquote>
410 </li>
411 <li>When all this is done, hopefully all you'll need to do is type:
412 <blockquote>
413 <code>% make</code></blockquote>
414 at the ACE_ROOT directory. This will build the ACE
415 library, tests, the examples, and the sample applications.
416 Building the entire ACE release can take a long time and consume
417 lots of disk space, however. Therefore, you might consider
418 cd'ing into the <code>$ACE_ROOT/ace</code> directory and
419 running <code>make</code> there to build just the ACE library.
420 As a sanity check, you might also want to build and run the
421 automated <a href="tests/README">"one-button" tests</a> in
422 <code>$ACE_ROOT/tests</code>. Finally, if you're also
423 planning on building <a href="https://www.dre.vanderbilt.edu/~schmidt/TAO.html">TAO</a>, you
424 should build the <a href="http://www.dre.vanderbilt.edu/~schmidt/PDF/gperf.pdf">gperf</a>
425 perfect hash function generator application in
426 <code>$ACE_ROOT/apps/gperf</code>.
427 </li>
428 <li>If you've set the INSTALL_PREFIX before building, now run
429 <blockquote><code>% make install</code></blockquote>
430 </li>
431 <li>If you need to regenerate the <code>ace/Svc_Conf_y.cpp</code> file,
432 you'll need to
433 get <a href="https://www.gnu.org/software/bison">GNU Bison</a>.
434 However, you should rarely, if ever, need to do this.
435 </li>
436 </ol>
438 <hr align="left" width="50%">
440 <h2><a name="win32">Building and Installing ACE on Windows</a></h2>
442 <p>This section contains instructions for building ACE on Microsoft
443 Windows with a variety of compilers and development environments.</p>
445 <p>First, if you are upgrading from an older release, the recommended practice
446 is to start with a clean directory. Unpacking the newer release over an older
447 one will not clean up any old files, and trying to use the environment's
448 "Clean" command will probably not account for all existing files.</p>
450 <p>For using MPC and our perl based test framework we recommend
451 our windows users to use <a href="https://www.activestate.com/products/perl">Active
452 State Perl</a> or <a href="http://strawberryperl.com">Strawberry Perl</a></p>
454 <ul>
455 <li><a href="#msvc">Microsoft Visual Studio</a></li>
456 <li><a href="#embarcadero">Embarcadero C++Builder</a></li>
457 <li><a href="#mingw">MinGW</a></li>
458 <li><a href="#cygwin">Cygwin</a></li>
459 </ul>
461 </p><p></p><hr align="left" width="50%"><p>
462 </p><h3><a name="msvc">Building and Installing ACE on Windows with
463 Microsoft Visual Studio</a></h3>
465 <p>ACE contains project files for
466 Visual Studio 2017 (vc141), and Visual Studio 2019 (vc142).
467 Visual Studio 2015/2017/2019 use different file formats but the same file
468 suffixes (<code>.sln</code> and <code>.vcproj</code>). To support both
469 environments, ACE supplies files with different names for the different
470 development and target platforms. The platform/name mapping is shown below.
471 All solution files have a <code>.sln</code> suffix and all project files have
472 a <code>.vcproj</code> suffix.</p>
474 <table width="400">
475 <caption><b>Mapping of Platform to Solution/Project File Name</b></caption>
476 <thead>
477 <tr valign="top">
478 <th>Platform</th>
479 <th>File Name</th>
480 </tr>
481 </thead><tbody>
482 <tr>
483 <th>Visual Studio 2017</th>
484 <td><i>name</i><code>_vs2017</code>
485 </td>
486 </tr>
487 <tr>
488 <th>Visual Studio 2019</th>
489 <td><i>name</i><code>_vs2019</code>
490 </td>
491 </tr>
492 </tbody></table>
494 <p>The VC++ compiler and linker can now be invoked from GNU make just like
495 most UNIX builds. Follow the instructions in the <a href="#unix_traditional">
496 ACE/GNU Configuration</a> sections and see the additional information in the
497 comments of
498 <a href="include/makeinclude/platform_win32_msvc.GNU">platform_win32_msvc.GNU</a>.
499 </p>
501 <p>If you happen to open an older file Visual Studio solution from a newer one, it will offer to convert
502 the file to the newer format for you
504 <ol>
505 <li>Uncompress the ACE distribution into a directory, where it will
506 create a ACE_wrappers directory containing the distribution. The
507 ACE_wrappers directory will be referred to as ACE_ROOT in the
508 following steps -- so ACE_ROOT\ace would be C:\ACE_wrappers\ace if
509 you uncompressed into the root directory.<br>
510 <br>
511 </li><li>Create a file called <code>config.h</code> in the ACE_ROOT\ace
512 directory that contains: <br>
513 <br>
514 <code>#include "ace/config-win32.h"</code><br>
515 <br>
517 </li><li>The static, DLL and MFC library builds are kept in
518 different workspaces. Files with names *_Static contain project
519 files for static builds. Workspaces for static and DLL builds will be
520 available through the stock release at DOC group's website. The
521 workspaces for MFC are not available and have to be generated using
522 MPC. Please see <a href="MPC/docs/README">MPC's README</a> for
523 details.<br><br>
524 </li><li>Now load the solution file for ACE (ACE_ROOT/ACE.sln).<br>
525 <br>
526 </li><li>Make sure you are building the configuration (i.e, Debug/Release)
527 the one you'll use (for example, the debug tests need the debug
528 version of ACE, and so on). All these different configurations are
529 provided for your convenience. You can either adopt the scheme to
530 build your applications with different configurations, or use
531 <code>ace/config.h</code> to tweak with the default settings on
532 NT.<br> <strong>Note:</strong> If you use the dynamic libraries,
533 make sure you include ACE_ROOT\lib in your PATH whenever you run
534 programs that uses ACE. Otherwise you may experience problems
535 finding ace.dll or aced.dll.<br>
536 <br>
537 </li><li>To use ACE with MFC libraries, also add the following to
538 your <code>config.h</code> file. Notice that if you want to
539 spawn a new thread with CWinThread, make sure you spawn the
540 thread with THR_USE_AFX flag set.<br>
541 <br>
542 <code>#define ACE_HAS_MFC 1</code><br>
543 <br>
544 By default, all of the ACE projects use the DLL versions of the
545 MSVC run-time libraries. You can still choose use the static (LIB)
546 versions of ACE libraries regardless of run-time libraries. The
547 reason we chose to link only the dynamic run-time library is that
548 almost every NT box has these library installed and to save disk
549 space. If you prefer to link MFC as a static library into ACE, you
550 can do this by defining <code>ACE_USES_STATIC_MFC</code> in your
551 <code>config.h</code> file. However, if you would like to link
552 everything (including the MSVC run-time libraries) statically,
553 you'll need to modify the project files in ACE yourself.<p>
554 </p></li><li>Static version of ACE libraries are built with
555 <code>ACE_AS_STATIC_LIBS</code><br> defined. This macro should
556 also be used in application projects that link to static ACE
557 libraries<br>
558 <br>
559 Optionally you can also add the line <br>
560 <br>
561 <code>#define ACE_NO_INLINE</code><br>
562 <br>
563 before the #include statement in ACE_ROOT\ace\config.h to disable
564 inline function and reduce the size of static libraries (and your
565 executables.)<br>
566 <br>
567 </li><li>ACE DLL and LIB naming scheme:<br>
568 <br>
569 We use the following rules to name the DLL and LIB files in ACE
570 when using MSVC.<br>
571 <br>
572 "Library/DLL name" + (Is static library ? "s" :
573 "") + (Is Debugging enable ? "d" : "")
574 + {".dll"|".lib"}<br>
575 <br>
576 </li></ol>
578 <p>More information for ACE/TAO on MSVC can be found
579 <a href="docs/msvc_notes.txt">here</a>. The doxygen version of this
580 document is available under Related Topics in the ACE Library.</p>
582 <b>ACE TESTS</b><p>
584 The tests are located in ACE_ROOT\tests. There is also a solution in
585 that directory to build all the tests (tests.sln)</p><p>
587 Once you build all the tests (Batch Build works well for this), you
588 can run perl script <code>run_test.pl</code> in the
589 <code>tests</code> directory to try all the tests.</p><p>
591 <a name="win32nonic">
592 <b> BUILDING ACE ON A WIN32 MACHINE THAT LACKS A NETWORK CARD </b></a></p><p>
594 <a name="win32nonic">You may want to run ACE on a non-networked machine. To do so, you must
595 install TCP/IP and configure it to ignore the absence of a network
596 card. This is one method:
598 </a></p><ol>
599 <a name="win32nonic"> <li>Run Control Panel
600 </li><li>Choose Network from Control Panel
601 </li><li>Add Adapter: MS Loopback Adapter
602 </li><li>Configure MS Loopback Adapter with 802.3 (default)
603 </li><li>Add Protocol: TCP/IP Protocol
604 </li><li>Configure TCP/IP Protocol with a valid IP address and subnet mask.
605 Leave everything else at the default settings.
606 </li><li>Add Service: Workstation
607 </li><li>Exit and Restart System
608 </li><li>Run Control Panel again
609 </li><li>Choose Services from Control Panel
610 </li><li>The following services are not necessary and may
611 be set to Disabled Startup: <br>
612 Alerter<br>
613 Computer Browser<br>
614 Net logon<br>
615 Messanger<br>
616 </li><li>Choose Network from Control Panel
617 </li><li>Confirm the following setup. This is all you need to run ACE:<br>
618 Installed Software:<br>
619 Computer Browser<br>
620 MS Loopback Adapter Driver<br>
621 TCP/IP Protocol<br>
622 Workstation<br>
623 Installed Adapter Cards:<br>
624 MS Loopback Adapter<p>
625 </p></li></a></ol>
627 <hr align="left" width="50%"><p>&nbsp;</p>
628 <h3><a name="embarcadero">Building and Installing ACE on Windows with Embarcadero C++</a></h3>
630 If you are building for a machine without a network card, you may want
631 to check <a href="#win32nonic">here</a> first. <p>
633 </p><ol>
634 <li>Uncompress the ACE distribution into a directory, where it will
635 create an
636 ACE_wrappers directory containing the source. The ACE_wrappers
637 directory will be referred to as ACE_ROOT in the following steps -- so
638 <code>ACE_ROOT\ace</code> would be <code>C:\ACE_wrappers\ace</code> when you uncompressed into the
639 root directory.<br>
640 <br>
641 </li><li>Create a file called <code>config.h</code> in the ACE_ROOT\ace
642 directory that contains at least: <br>
643 <br>
644 <code>#include "ace/config-win32.h"</code><br>
645 <br>
646 </li><li>Open a RAD Studio Command Prompt.<br>
647 <br>
648 </li><li>Set the ACE_ROOT environment variable to point to the ACE_wrappers
649 directory. For example:<br>
650 <br>
651 <code>set ACE_ROOT=C:\ACE_wrappers</code><br>
652 <br>
653 </li><li>Add ACE_wrappers\lib and ACE_wrappers\bin to the PATH environment variable:<br>
654 <br>
655 <code>set PATH=%ACE_ROOT%\lib;%ACE_ROOT%\bin;%PATH%</code><br>
656 <br>
657 </li><li>Change to the ACE_ROOT\ace directory.<br>
658 <br>
659 <code>cd %ACE_ROOT%\ace</code><br>
660 <br>
661 </li><li>Generate the bmake makefiles using <a href="#MPC">MPC</a>. Use the <code>bmake</code> project type for C++ Builder:<br>
662 <br>
663 <code>%ACE_ROOT%\bin\mwc.pl -type bmake</code><br>
664 <br>
665 </li><li>You can build several different versions of ACE by setting the following optional environment
666 variables before you run make:<br>
667 <br>
668 Set the environment variable below to build a debug version of ACE<br>
669 <code>set DEBUG=1</code><br>
670 <br>
671 Set the environment variable below to build a unicode version of ACE<br>
672 <code>set UNICODE=1</code><br>
673 <br>
674 Set the environment variable below to build a version of ACE with
675 Codeguard support. Should only be used when DEBUG is also set<br>
676 <code>set CODEGUARD=1</code><br>
677 <br>
678 By default we are using the clang based compilers. At the moment you
679 want to compile using the old bcc32 compiler set the CLASIC environment variable<br>
680 <code>set CLASSIC=1</code><br>
681 <br>
682 Set the environment variable below to build a version of ACE optimized
683 for a certain CPU. For this there are special compiler flags
684 (-3/-4/-5/-6), see the Embarcadero help for more info.<br>
685 <code>set CPU_FLAG=-6</code><br>
686 <br>
687 You can then start the build with the command
688 <br><code>make -f Makefile.bmak all</code><br>
689 <br>
690 You may also enable the options by passing them as command line options to make, for example:<br>
691 <code>make -f Makefile.bmak -DDEBUG all</code><br>
692 <br>
693 </li><li>Build ACE by doing:<br>
694 <br>
695 <code>make -f Makefile.bmak all</code><br>
696 <br>
697 </li></ol>
701 Note that when you run <code>make</code> in a sub directory you give <code>make -f Makefile.bmak all</code>. The <code>all</code> is needed to make sure the complete project is build.<p>
703 The C++ Builder port has been done by Jody Hagins, <a href="mailto:chris@kohlhoff.com">Christopher Kohlhoff</a> and <a href="mailto:jwillemsen@remedy.nl">Johnny Willemsen</a>. </p><p>
705 <b>ACE TESTS</b></p><p>
707 Before you can build the tests you need to build the protocols directory.
708 Change the directory to ACE_ROOT\protocols and start: </p><p>
709 </p><blockquote><code>
710 %ACE_ROOT%\bin\mwc.pl -type bmake<br>
711 make -f Makefile.bmak all
712 </code></blockquote><p>
714 The tests are located in ACE_ROOT\tests, change to this directory.
715 You build then the tests with the following commands:</p><p>
716 </p><blockquote><code>
717 %ACE_ROOT%\bin\mwc.pl -type bmake<br>
718 make -f Makefile.bmak all
719 </code></blockquote><p>
721 Once you build all the tests, you can run the automated test script using:</p><p>
722 </p><blockquote><code>perl run_test.pl</code></blockquote><p> in the
723 <code>tests</code> directory to try all the tests. You need to make
724 sure the ACE bin and lib directory (in this case
725 <code>%ACE_ROOT%\bin</code> and <code>%ACE_ROOT%\lib</code>)
726 are on the path before you try to run the tests. If your executables are
727 compiled into a subdirectory, add <code>-ExeSubDir subdirname</code> to the
728 command.</p><p>
730 <p></p><hr align="left" width="50%"><p>
731 </p><h3><a name="mingw">Building and Installing ACE on Win32 with MinGW/ MSYS</a></h3>
734 If you are building for a machine without a network card, you may want
735 to check <a href="#win32nonic">here</a> first.
737 </p><p>
738 Building and installing ACE on <a href="http://www.mingw.org/">MinGW</a>
739 uses a mix of a <a href="#unix">UNIX</a> building process and
740 <a href="#win32">Win32</a> configuration files.
741 Also, as MinGW uses GNU g++, you may want to take
742 a look at the <a href="#g++">Compiling ACE with GNU g++</a> section.
744 </p><p>
745 You will need the MinGW build tools and libraries, downloable from
746 <a href="http://www.mingw.org/"><tt>http://www.mingw.org</tt></a>.
748 <br>
749 For our build we require the packages
750 <b><tt>MinGW</tt></b> and <b><tt>MSYS</tt></b>.
752 </p><ol>
754 <li> Install the MinGW tools (including the MinGW Development toolkit) into a common directory, say c:/mingw.
755 <br><br>
757 </li><li> Install the MSYS tools into a common directory, say c:/msys.
758 <br><br>
760 </li><li> Open a MSYS shell. Set your <tt>PATH</tt> environment variable so
761 your MinGW's <tt>bin</tt> directory is first:
763 <blockquote><pre> % export PATH=/c/mingw/bin:$PATH
764 </pre></blockquote>
766 </li><li> Add an <tt>ACE_ROOT</tt> environment variable pointing to the
767 root of your ACE wrappers source tree:
769 <blockquote><pre> % export ACE_ROOT=/c/work/mingw/ACE_wrappers
770 </pre></blockquote>
772 From now on, we will refer to the root directory of the ACE
773 source tree as <tt>$ACE_ROOT</tt>.
774 <br><br>
776 </li><li> Create a file called <tt>config.h</tt> in the
777 <tt>$ACE_ROOT/ace</tt> directory that contains:
779 <blockquote><pre> #include "ace/config-win32.h"
780 </pre></blockquote>
782 </li><li> Create a file called <tt>platform_macros.GNU</tt> in the
783 <tt>$ACE_ROOT/include/makeinclude</tt> directory containing:
785 <blockquote><pre> include $(ACE_ROOT)/include/makeinclude/platform_mingw32.GNU
786 </pre></blockquote>
788 In the above text, don't replace <tt>$(ACE_ROOT)</tt> with the
789 actual directory, GNU make will take the value from the
790 environment variable you defined previously.
793 If you lack Winsock 2, add the line
795 </p><blockquote><pre> winsock2 = 0
796 </pre></blockquote>
798 before the previous one.
799 <br><br>
802 If you want to install ACE (using "make install") and want all the <tt>.pc</tt> files generated,
803 set the installation prefix in platform_macros.GNU.
804 </p><blockquote><pre> INSTALL_PREFIX=/c/ACE
805 </pre></blockquote>
806 Headers will be installed to $INSTALL_PREFIX/include, documentation and
807 build system files to $INSTALL_PREFIX/share and libraries to $INSTALL_PREFIX/lib. With INSTALL_PREFIX set, RPATH will be enabled.
808 To disable RPATH (for example, if $INSTALL_PREFIX/$INSTALL_LIB is already
809 a system-known location for shared libraries), set the make macro
810 install_rpath to 0 by adding install_rpath=0 to platform_macros.GNU.
812 <br><br>
814 </li><li> In the MSYS shell, change to the $ACE_ROOT/ace directory and
815 run make:
817 <blockquote><pre> % cd $ACE_ROOT/ace
818 % make
819 </pre></blockquote>
822 This should create <tt>libACE.dll</tt> (the Win32 shared library) and
823 <tt>libACE.dll.a</tt> (the Win32 import library for the DLL).
824 Note that the name for the ACE DLL follows the MinGW convention, which itself
825 resembles UNIX.
827 </p><p>
828 If you want static libs also, you may run:
830 </p><blockquote><pre> % make static_libs_only=1
831 </pre></blockquote>
833 </li><li> Run make install:
835 <blockquote><pre> % make install
836 </pre></blockquote>
838 This should create <tt>ACE.pc</tt> to use with pkg-config.
839 </p>
841 </li><li> <a name="mingwrunpath">
842 The same rules for Win32 search of DLLs apply for MinGW. If you
843 want to run some ACE programs from the MSYS shell, you may
844 need to add the directory for <tt>libACE.dll</tt> to your PATH:
846 </a><blockquote><pre><a name="mingwrunpath"> % export PATH=/c/work/mingw/ACE_wrappers/ace:$PATH
847 </a></pre></blockquote>
849 </li></ol>
851 <a name="mingwrunpath"><b>ACE TESTS</b></a><p>
853 <a name="mingwrunpath">The tests are located in <tt>$ACE_ROOT/tests</tt>.
854 After building the library, you can change to that directory and run
855 make:
857 </a></p><blockquote><pre><a name="mingwrunpath"> % cd $ACE_ROOT/tests
858 % make
859 </a></pre></blockquote>
862 <a name="mingwrunpath">Once you build all the tests, you can run
863 <code>run_tests.pl</code> in the
864 <code>tests</code> directory to try all the tests:
866 </a></p><blockquote><pre><a name="mingwrunpath"> % perl run_test.pl
867 </a></pre></blockquote>
870 <a name="mingwrunpath">If you are using ACE as a DLL, you will need to modify your PATH
871 variable as explained </a><a href="#mingwrunpath">above</a>.
873 </p><p>
874 You may want to check <tt>$ACE_ROOT/tests/README</tt> for the status
875 of the various tests on MinGW and the different Windows flavors.
877 </p><p></p><hr align="left" width="50%"><p>
878 </p><h3><a name="cygwin">Building and Installing ACE on Win32 with Cygwin</a></h3>
881 If you are building for a machine without a network card, you may want
882 to check <a href="#win32nonic">here</a> first.
884 </p><p>
885 Building and installing ACE on <a href="http://www.cygwin.com/">Cygwin</a>
886 uses the <a href="#unix">UNIX</a> building process.
887 Also, as Cygwin uses GNU g++, you may want to take
888 a look at the <a href="#g++">Compiling ACE with GNU g++</a> section.
890 </p><p>
891 You will need the Cygwin build tools and libraries, downloable from
892 <a href="http://www.cygwin.com/"><tt>http://www.cygwin.com</tt></a>.
893 For our build we require the following packages besides the packages the
894 setup selects by default:
895 <a name="cygwinpacks">
896 </a></p><blockquote>
897 <a name="cygwinpacks"><b><tt>gcc (version 3.3.3), cygserver, make, perl, binutils</tt></b>.
898 </a></blockquote>
900 <ol>
902 <a name="cygwinpacks"> <li> Install Cygwin (this can be easy downloading and running
903 <a href="http://cygwin.com/setup.exe"><tt>setup.exe</tt></a>
904 from the Cygwin site). For working with ACE we recommend
905 to select <code>DOS</code> as default text file type.
906 <br><br>
908 <li> Open a Cygwin shell. Set your <tt>PATH</tt> environment variable so
909 your Cygwin <tt>bin</tt> directory is first:
911 <blockquote><pre> % export PATH=//c/cygwin/bin:$PATH
912 </pre></blockquote>
916 <blockquote><pre> % export PATH=/cygdrive/c/cygwin/bin:$PATH
917 </pre></blockquote>
920 Note Cygwin uses ``<tt>/</tt>'' as directory separator,
921 and ``<tt>//X</tt>'' as a notation for Win32 drive <tt>X</tt>.
922 Note also that you <em>can't</em> use ``<tt>c:/cygwin/bin</tt>''
923 because, for Cygwin,
924 ``<tt>:</tt>'' is path separator character, as in UNIX.
925 <br><br>
927 </p></li><li> Add an <tt>ACE_ROOT</tt> environment variable pointing to the
928 root of your ACE wrappers source tree (in this example c:/work/cygwin/ACE_wrappers):
930 <blockquote><pre> % export ACE_ROOT=/cygdrive/c/work/cygwin/ACE_wrappers
931 </pre></blockquote>
934 Note here you <em>can't</em> use the ``<tt>//X</tt>'' Cygwin
935 notation as this is seen by Cygwin's compiler and it doesn't
936 support that (it <em>does</em> support ``<tt>/</tt>'' as directory
937 separator however).
939 </p><p>
940 From now on, we will refer to the root directory of the ACE
941 source tree as <tt>$ACE_ROOT</tt>.
942 <br><br>
944 </p></li><li> Create a file called <tt>config.h</tt> in the
945 <tt>$ACE_ROOT/ace</tt> directory that contains:
947 <blockquote><pre> #include "ace/config-cygwin32.h"
948 </pre></blockquote>
950 </li><li> Create a file called <tt>platform_macros.GNU</tt> in the
951 <tt>$ACE_ROOT/include/makeinclude</tt> directory containing:
953 <blockquote><pre> include $(ACE_ROOT)/include/makeinclude/platform_cygwin32.GNU
954 </pre></blockquote>
956 In the above text, don't replace <tt>$(ACE_ROOT)</tt> with the
957 actual directory, GNU make will take the value from the
958 environment variable you defined previously.
960 </li><li> On the Cygwin shell, change to the $ACE_ROOT/ace directory and
961 run make:
963 <blockquote><pre> % cd $ACE_ROOT/ace
964 % make
965 </pre></blockquote>
968 This should create <tt>libACE.dll</tt> (the Win32 shared library) and
969 <tt>libACE.dll.a</tt> (the Win32 import library for the DLL).
970 Note the name for the ACE DLL on Cygwin follows the UNIX convention.
971 <br><br>
973 </p><p>
974 If you want static libs also, you may run:
976 </p><blockquote><pre> % make static_libs_only=1
977 </pre></blockquote>
979 </li><li> <a name="cygwinrunpath">
980 The same rules for Win32 search of DLLs apply for Cygwin. If you
981 want to run some ACE programs from the Cygwin shell, you may
982 need to add the directory for <tt>libACE.dll</tt> to your PATH:
984 </a><blockquote><pre><a name="cygwinrunpath"> # export PATH=//c/work/cygwin/ACE_wrappers/ace:$PATH
985 </a></pre></blockquote>
987 <a name="cygwinrunpath"> If you are using MPC-generated Makefiles, then the DLLs have been
988 placed in the lib directory instead of ace and thus your PATH
989 addition would need to look like this:
991 </a><blockquote><pre><a name="cygwinrunpath"> # export PATH=//c/work/mingw/ACE_wrappers/lib:$PATH
992 </a></pre></blockquote>
995 </li></ol>
997 <a name="cygwinrunpath"><b>ACE TESTS</b></a><p>
999 <a name="cygwinrunpath">The tests are located in <tt>$ACE_ROOT/tests</tt>.
1000 After building the library, you can change to that directory and run
1001 make:
1003 </a></p><blockquote><pre><a name="cygwinrunpath"> % cd $ACE_ROOT/tests
1004 % make
1005 </a></pre></blockquote>
1008 <a name="cygwinrunpath">Once you build all the tests, you can run
1009 <code>run_tests.pl</code> in the
1010 <code>tests</code> directory to try all the tests:
1012 </a></p><blockquote><pre><a name="cygwinrunpath"> % perl run_test.pl
1013 </a></pre></blockquote>
1016 <a name="cygwinrunpath">If you are using ACE as a DLL, you will need to modify your PATH
1017 variable as explained </a><a href="#cygwinrunpath">above</a>.
1019 </p><p>
1020 You may want to check <tt>$ACE_ROOT/tests/README</tt> for the status
1021 of the various tests on Cygwin and the different Windows flavors.
1022 </p>
1024 <p></P>
1025 <p></p><hr align="left" width="50%"><p>
1026 </p><h2><a name="vxworks">Building and Installing ACE on VxWorks</a></h2>
1027 For the most part, you should be able to follow the instructions above
1028 to build ACE and applications that use it. Start with the
1029 <a href="#unix">Unix instructions</a> above to build ACE and the
1030 applications that use it. Please see below for more information on
1031 <a href="#VxWorks/NT">building ACE on NT hosts for VxWorks targets</a>.<p>
1033 A few notes on VxWorks builds (thanks to
1034 <a href="mailto:Paul_von_Behren@stortek.com">Paul von Behren</a> and
1035 <a href="https://www.remedy.nl">Remedy IT</a> for these notes):</p>
1037 </p><ul>
1038 <li>VxWorks builds are done with a cross compiler, i.e., the compiles
1039 are done on a workstation creating object modules which are
1040 downloaded and loaded into the VxWorks target system.<p>
1041 </p></li><li>C++ object modules must be post-processed by a VxWorks
1042 utility called "munch" to set up calls to static constructors and destructors.
1043 ACE integrates the makefile includes/rules files
1044 distributed with VxWorks to achieve maximum compatibility and reuse the target
1045 specifications and buildcommands defined by Windriver itself.
1046 The original ACE support for VxWorks included a perl script called
1047 <a href="bin/ace_ld">$ACE_ROOT/bin/ace_ld</a>,
1048 which was called from the Makefiles, replacing
1049 the traditional <code>ld</code> step. Although this script is currently still
1050 available it is not used anymore.<BR>
1051 You must have perl installed to use <code>ace_ld</code>. If perl is not on your path, you'll
1052 have to set <code>PERL_PATH</code> to the full path (including
1053 perl.exe), either in your
1054 <code>$(ACE_ROOT)/include/makeinclude/platform_macros.GNU</code>
1055 or in your environment.<p>
1056 </p></li><li>Wind River provides GCC/G++ cross-compilers for the
1057 supported target platforms. The executables are named cc&lt;target&gt;
1058 and g++&lt;target&gt;; for example, ccppc and g++cpp for PowerPC
1059 targets.<p>
1060 </p></li></ul>
1062 You'll have to let ACE know the target type at compile time. There
1063 are several ways to do this; please see the
1064 <code>$ACE_ROOT/include/makeinclude/platform_vxworks5.5.x.GNU</code>
1065 platform file for detailed information.<p>
1067 The VxWorks platform_vxworks*.GNU files are set up so that shared
1068 libraries are not built on VxWorks, by default. Only static
1069 libraries, with .a extension, are built. Therefore, it's not
1070 necessary to set the LD_LIBRARY_PATH environment variable on your host
1071 system when building for VxWorks targets. Please note, however, if
1072 you use TAO on VxWorks that you will need to set your LD_LIBRARY_PATH
1073 to find the TAO IDL compiler libraries (installed in the ace
1074 directory) on the host.</p><p>
1076 These non-default VxWorks kernel configuration <code>#defines</code>
1077 are required with ACE:</p><p>
1079 </p><pre>#define INCLUDE_CPLUS /* include C++ support */
1080 #define INCLUDE_CPLUS_IOSTREAMS /* include iostreams classes */
1081 #define INCLUDE_POSIX_ALL /* include all available POSIX functions */
1082 </pre>
1084 For completeness, here are the non-default <code>#defines</code> that
1085 we used for VxWorks 5.3.1/g++ 2.7.2:
1087 <pre>#define INCLUDE_CPLUS /* include C++ support */
1088 #define INCLUDE_CPLUS_IOSTREAMS /* include iostreams classes */
1089 #define INCLUDE_CONFIGURATION_5_2 /* pre-tornado tools */
1090 #define INCLUDE_DEBUG /* pre-tornado debugging */
1091 #define INCLUDE_LOADER /* object module loading */
1092 #define INCLUDE_NET_SYM_TBL /* load symbol table from network */
1093 #define INCLUDE_SYM_TBL_SYNC /* synchronize host and target symbol tables */
1094 #define INCLUDE_NFS /* nfs package */
1095 #define INCLUDE_PING /* ping() utility */
1096 #define INCLUDE_POSIX_ALL /* include all available POSIX functions */
1097 #define INCLUDE_RDB /* remote debugging package */
1098 #define INCLUDE_RLOGIN /* remote login */
1099 #define INCLUDE_RPC /* rpc package */
1100 #define INCLUDE_SECURITY /* shell security for network access */
1101 #define INCLUDE_SHELL /* interactive c-expression interpreter */
1102 #define INCLUDE_SHOW_ROUTINES /* show routines for system facilities*/
1103 #define INCLUDE_SPY /* spyLib for task monitoring */
1104 #define INCLUDE_STARTUP_SCRIPT /* execute start-up script */
1105 #define INCLUDE_STAT_SYM_TBL /* create user-readable error status */
1106 #define INCLUDE_SYM_TBL /* symbol table package */
1107 #define INCLUDE_UNLOADER /* object module unloading */
1108 #define INCLUDE_WINDVIEW /* WindView command server */
1109 </pre>
1111 Also, automatic construction/destruction of static objects
1112 should be enabled.<p>
1114 If you use TAO, it's also a good idea to increase the
1115 <code>NUM_FILES</code> parameter from its default of 50 to,
1116 say, 1000.</p><p>
1118 Please note that those VxWorks kernel configuration parameters
1119 are set in the VxWorks configAll.h file. You must rebuild your
1120 VxWorks kernel after modifying that file.</p><p>
1122 If you're first getting started with ACE and/or VxWorks, I recommend
1123 just building the ACE library and tests first. (Some of the ACE
1124 examples, in System_V_IPC, don't build on VxWorks yet.) Then try
1125 running the tests. Please see $ACE_ROOT/tests/README for the latest
1126 status of the ACE tests on VxWorks.</p><p>
1128 Please note that the <code>main</code> entry point is renamed to
1129 <code>ace_main</code> (configurable via ACE_MAIN) on VxWorks with g++,
1130 to comply with its restriction against using <code>main</code>.
1131 In addition, ACE_HAS_NONSTATIC_OBJECT_MANAGER is enabled by default
1132 to cleanly support construction and destruction of static objects.
1133 Please see the <a href="#NonStaticObjectManager">Non-static
1134 ACE_Object_Manager</a> discussion for the important implication
1135 of this feature.</p><p>
1137 ACE threads (VxWorks tasks) can be named, for example, by supplying a
1138 non-null argument to the Thread_Manager spawn routines. However,
1139 names beginning with <code>"==ace_t=="</code> are forbidden because
1140 that prefix is used internally by ACE.</p><p>
1142 You can spawn a new task to run <code>ace_main</code>, using either
1143 VxWorks <code>sp</code>, or ACE'S <a name="spa"><code>spa</code></a>.
1144 <code>spa</code> can be used from the VxWorks shell to pass arguments
1145 to <code>ace_main</code>. Its usage is:
1147 </p><pre><code>
1148 spa ace_main, "arg1" [, ...]
1149 </code></pre>
1151 All arguments must be quoted, even numbers. You can start also ace_main
1152 without spawning another thread by using:<p>
1154 </p><pre><code>
1155 spaef ace_main, "arg1" [, ...]
1156 </code></pre>
1158 ACE also provides the function <code>vx_execae</code> which is capable of running
1159 <code>ace_main</code> in a separate thread, wait for the task to finish and return
1160 the return code from <code>ace_main</code>:
1162 <pre><code>
1163 int vx_execae (FUNCPTR acemain,char* arguments, int prio = 0, int opt = 0, int stacksz = 0);
1164 </code></pre>
1166 You could call this from the VxWorks shell like:
1167 </p>
1168 <pre><code>
1169 my_rc = vx_execae ace_main, "-o server.ior -ORBDottedDecimalAddresses 1"
1170 </code></pre><p>
1172 When <code>prio</code>, <code>opt</code> or <code>stacksz</code> are omitted or specified
1173 as <code>0</code> default values will be used. See the VxWorks shell documentation for the
1174 defaults for <code>prio</code> and <code>opt</code>. For <code>stacksz</code> the default is
1175 <code>ACE_NEEDS_HUGE_THREAD_STACKSIZE</code>.
1176 The <code>arguments</code> string will be parsed and passed on to <code>ace_main</code> as
1177 a regular <code>argc</code> and <code>argv</code>.</p><p>
1179 Be aware of the fact that when you execute <code>ace_main</code> directly from the VxWorks
1180 shell argc will be zero and argv* will also be zero. Using <code>argv[0]</code> will not return
1181 the program name, but will result in a crash.<br>
1182 The ACE helper functions <code>spa</code>, <code>spaef</code> and <code>vx_execae</code> prevent
1183 this problem by building a regular <code>argc</code> and <code>argv</code> which also contain a
1184 valid <code>argv[0]</code> element.</p>
1186 <h3><a name="VxWorks/SharedLibs">Building Shared Libraries for VxWorks</a>.</h3>
1188 <strong>NOTE</strong>: Since VxWorks support is currently being reworked with
1189 an initial focus on static builds the support for shared builds is momentarily
1190 broken. This will be remedied(!) as soon as possible.<p>
1192 ACE supports shared libraries for VxWorks, but only with the g++
1193 compiler. To build shared libraries instead of the default static
1194 libraries, added <code>shared_libs_only=1</code> to either your
1195 <code>ACE_wrappers/include/makeinclude/platform_macros.GNU</code> or
1196 your <code>make</code> invocation. Then, be sure to load the ACE (and
1197 any other) shared library before loading your executable(s).</p><p>
1199 A shared library for VxWorks uses the same code as for a static
1200 (non-shared) library. However, calls to static constructors/
1201 destructors are added. The code in the shared library <strong>must</strong>
1202 be reentrant if you shared it between programs (tasks). The
1203 ACE library meets this requirement.</p><p>
1205 Shared libraries reduce build time, executable size, and load
1206 time of the executable. But, you must manually load the shared
1207 library before loading your executable(s) with a command such as:
1208 </p><pre><code>
1209 -&gt; ld &lt; libACE.so
1210 </code></pre>
1211 Shared libraries can be unloaded the same way an executable
1212 (module) is unloaded.<p>
1214 <strong>NOTE</strong>: Shared libraries on VxWorks aren't the same as
1215 shared libraries on other operating systems. In particular, there is
1216 no support for creating copies of writeable global (static) data in
1217 the shared library. This includes the singleton ACE_Object_Manager
1218 instance pointer. If you share global data between separate programs,
1219 they may not work properly. See the discussion of shared code and
1220 reentrancy in the VxWorks' <em>Programmers Guide</em>.</p><p>
1222 Instead of trying to run separate programs onto a VxWorks target, we
1223 recommend creating just one program, and spawning a thread for each
1224 task. The TAO IDL_Cubit test <a href="TAO/performance-tests/Cubit/TAO/IDL_Cubit/collocation_test.cpp">collocation
1225 test</a> is a good example.</p><p>
1227 </p><h3><a name="VxWorks/LinkToKernel">Linking ACE and/or TAO Libraries into the VxWorks Kernel</a>.</h3>
1229 It's easy to link your ACE and/or TAO libraries into the VxWorks kernel.
1230 Just build <a href="#VxWorks/SharedLibs">shared versions</a>, but
1231 disable the munch step. The easiest way to do that is to set the
1232 <code>LD</code> make variable to the name of your linker. For
1233 example, to build a libACE.so for PowerPC that can be linked into
1234 the kernel:
1235 <pre>% cd $ACE_ROOT/ace
1236 % make LD=ldppc shared_libs_only=1
1237 </pre>
1238 After building the shared lib, link it into the kernel by setting
1239 the <code>MACH_EXTRA</code> make variable in the kernel configuration
1240 Makefile. Then, build the kernel using <code>make exe</code>.<p>
1242 </p><h3><a name="VxWorksTestScript">Using the one-button ACE tests with VxWorks</a>.</h3>
1244 It is possible to generate a script to execute all ACE tests. You can do this by executing
1245 </a></p><blockquote><pre><a name="vxworksscript">% perl run_test.pl -v -o > run_test.vxworks
1246 </a></pre></blockquote>
1248 The ACE tests write their output files in a directory named
1249 <code>log/</code>, below the current (<code>tests</code>) directory.<br/>
1250 </p>
1252 To run the tests from the build directory on an NT host where you crossbuild your
1253 VxWorks ACE/TAO you can set up the Target Server File System (TSFS) in your Target Server
1254 configuration. If you f.i. set the root for the TSFS to the root directory of your builddisk
1255 you can set the default directory for the target by issueing the following command
1256 from a Host shell: '@cd "/tgtsvr/{path to ACE}/ACE_wrappers/tests"'.
1257 The '@' addition makes sure this command is executed for the target environment and not the
1258 local host shell environment.
1259 If you also issue the command 'cd {path to ACE}/ACE_wrappers/tests' you can execute the
1260 generated one button testscript like: '&lt; run_test.vxworks'.
1261 </p>
1263 Running the ACE tests automatically from the ACE autobuild tool using Target Server and Host
1264 shell options is also supported.
1265 </p>
1267 If you don't have NFS included in your VxWorks kernel, you can use these steps, provided by
1268 <a href="mailto:clarence_m_weaver@md.northgrum.com">Clarence M. Weaver</a>,
1269 to run the tests and capture their output:</p><p>
1270 </p><ol>
1271 <li>What I did was create a log directory on the boot NT host of my VxWorks
1272 target.<p>
1273 </p></li><li>I copied all the test applications and the run_test.vxworks script to
1274 the parent of the log directory.<p>
1275 </p></li><li>Using the target shell not the host shell, I "cd" to the directory
1276 containing the script and test programs.<p>
1277 </p></li><li>Invoked the script using <code>&lt; run_test.vxworks</code> from this target shell.<p>
1278 </p></li></ol>
1280 <a href="mailto:Kirk.Davies@pobox.com">Kirk Davies</a> provided this
1281 approach for running the ACE tests on Tornado II:
1283 <ul>
1284 <li>Under Tornado II, I set up the Target Server File System (TSFS), and
1285 the test logs get written to the log subdirectory under that.<p>
1286 </p></li><li>You have to set an environment variable before running the tests:
1287 <pre>putenv("ACE_TEST_DIR=/tgtsvr")
1288 </pre><p>
1289 </p></li></ul>
1291 </p><h3><a name="VxWorks/NT">Building ACE on Tornado/NT hosts for VxWorks targets</a>.</h3>
1292 The following, very useful information was contributed by
1293 <a href="http://people.qualcomm.com/cryan">Chris Ryan</a>
1294 and <a href="mailto:Paul_von_Behren@stortek.com">Paul von Behren</a>.
1295 Please submit corrections, additions, or clarifications to our
1296 the <a href="https://github.com/DOCGroup/ACE_TAO">github project</a>.<p>
1298 <strong>NOTE:</strong>The make (version 3.74) that is provided with
1299 Tornado 2.2 cannot be used to build ACE. A working version is available
1300 from the WindRiver support site, download the
1301 <a href="https://secure.windriver.com/cgi-bin/windsurf/downloads/view_binary.cgi?binaryid=838">
1302 make3_80.gvk_patches</a> and the
1303 <a href="https://secure.windriver.com/cgi-bin/windsurf/downloads/view_binary.cgi?binaryid=100340">
1304 make3_80.tor2_2.new_dependency_rules</a> package and install them.</p><p>
1306 Using the Cygnus tools, this approach works:
1307 </p><ul>
1308 <li>You'll build both your NT and VxWorks executables in the same
1309 workspace (directory hierarchy). This works because the NT
1310 compiler and ACE's Makefiles put their output in different
1311 directories.<p>
1312 </p></li><li>Set up your
1313 <code>ACE_wrappers/include/makeinclude/platform_macros.GNU</code>
1314 as usual for VxWorks. See
1315 <a href="include/makeinclude/platform_vxworks5.5.x.GNU">the
1316 g++/VxWorks platform file</a> for more information.<p>
1317 </p></li><li>Create an <code>ACE_wrappers/ace/config.h</code> file that looks
1318 something like the following.
1319 <pre>#if defined (_MSC_VER) || defined (__BORLANDC__)
1320 # include "ace/config-win32.h"
1321 #else
1322 # include "ace/config-vxworks5.x.h"
1323 #endif
1324 </pre><p>
1325 </p></li><li>Set your <code>ACE_ROOT</code>, <code>CPP_LOCATION</code>,
1326 <code>WIND_BASE</code>, and <code>WIND_HOST_TYPE</code> environment
1327 variables.<p>
1328 </p></li><li>Build for NT, then build for VxWorks.<p>
1329 </p></li></ul>
1331 A few additional Windows Notes, from Paul von Behren:<p>
1332 </p><ul>
1333 <li>Cygnus has created a Win32 API which is compatible with a
1334 "generic" Unix environment. Using this library, they have ported a
1335 large collection of GNU tools to WinNT/95 - including a port of
1336 gcc/g++. See <a href="http://www.cygnus.com/misc/gnu-win32/">http://www.cygnus.com/misc/gnu-win32/</a>
1337 A related link is <a href="ftp://ftp.cygnus.com/pub/gnu-win32/latest/">ftp://ftp.cygnus.com/pub/gnu-win32/latest/</a><p>
1338 </p></li><li>To set up the command-prompt build environment, run
1339 <code>Tornado\host\x86-win32\bin\TorVars.bat</code>. This is done
1340 implicitly within the Tornado IDE.<p>
1341 </p></li><li>To run <code>ace_ld</code>, you still need perl installed -
1342 see <a href="https://www.activestate.com/products/perl">ActiveState Perl</a>
1343 or <a href="http://strawberryperl.com">Strawberry Perl</a>.<p>
1344 </p></li><li>The Tornado IDE will use a standard Makefile for project
1345 builds, but does not have a GUI interface for managing the
1346 Makefile. By default, it will use rules from Makefile in the current
1347 directory and you can configure it to add certain Makefile
1348 targets to the project. If you have <code>ACE_ROOT</code> defined
1349 before starting Tornado, you can specify an ACE Makefile as a Tornado
1350 target and Tornado will then call make from the menu.<p>
1351 </p></li></ul>
1353 And Chris Ryan's instructions for building for VxWorks targets
1354 on Windows NT hosts:
1356 <ol>
1357 <li>Path setting that seems to be working is:<p>
1358 </p><pre> /tornado/host/x86-win32/bin:
1359 /tornado/host/x86-win32/lib/gcc-lib/i386-wrs-vxworks/cygnus-2.7.2-960126:
1360 /tornado/host/x86-win32/i386-wrs-vxworks/bin:
1361 /ace/ace_wrappers/bin:
1362 /gnuwin32/b18/H-i386-cygwin32/bin:
1363 /gnuwin32/b18/tcl/bin:
1364 /WINNT/system32:
1365 /WINNT:
1366 /WINNT/system32/nls/ENGLISH:
1367 /bin
1368 </pre>
1370 Other environment variables:<p>
1371 </p><pre> WIND_BASE=/tornado
1372 SHELL=/bin/sh.exe
1373 TERM=pcbios
1374 TAO_ROOT=/ace/ACE_wrappers.vxworks/TAO
1375 CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.EXE
1376 GCC_EXEC_PREFIX=/tornado/host/x86-win32/lib/gcc-lib/
1377 WIND_HOST_TYPE=x86-win32
1378 ACE_ROOT=/ace/ACE_wrappers.vxworks
1379 </pre>
1381 </li><li><code>/tornado</code> is the root of the Tornado install
1382 (<code>$WIND_BASE</code>).
1384 </li><li><code>/gnuwin32</code> is the root of a Cygnus GNU download and install.
1386 </li><li><code>/bin</code> content is:<p>
1387 </p><pre> aced.dll
1388 cygwin.dll
1389 perl.exe
1390 rm.exe
1391 sh.exe
1392 true
1393 </pre>
1395 <code>aced.dll</code> is produced in an ACE NT source tree according to
1396 documented procedure for Windows VC++ ACE build.
1398 <code>cygwin.dll</code> is from the Cygnus GNU software download and install.
1400 </li><li>Basically, follow documented procedure for ACE build/install on UNIX
1401 platform. Create a <code>$ACE_ROOT/ace/config.h</code> that looks
1402 like:<p>
1403 </p><pre> #include "config-vxworks5.x.h"
1404 </pre>
1406 And create a
1407 <code>$ACE_ROOT/include/makeinclude/platform_macros.GNU</code>
1408 that looks like:<p>
1409 </p><pre>
1410 WIND_BASE = /tornado
1411 WIND_HOST_TYPE = x86-win32
1412 CPU = I80486
1413 include $(ACE_ROOT)/include/makeinclude/platform_vxworks5.5.x.GNU
1414 </pre>
1416 </li><li>When using cygnus windows GNUTools on WinNT you have to start
1417 make with "--unix" option, otherwise WinNT shell cmd.exe is responded and
1418 not sh.exe, i.e.,
1419 <pre> make --unix static_libs_only=1
1420 </pre>
1421 </li></ol>
1423 <h3>TAO on NT Tornado host, VxWorks target.</h3>
1425 <ol>
1426 <li>Build ACE and TAO_IDL in the NT tree as already documented.
1427 Be sure to build ACE's gperf on NT, in
1428 <code>ACE_wrappers/apps/gperf/src</code>.<p>
1430 </p></li><li>Build $TAO_ROOT/tao
1431 <pre> CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.exe
1432 cd $TAO_ROOT/tao
1433 /gnuwin32/b18/H-i386-cygwin32/bin/make
1434 </pre>
1436 </li><li>Build orbsvcs.
1437 <pre> CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.exe
1438 cd $TAO_ROOT/orbsvcs/orbsvcs
1439 /gnuwin32/b18/H-i386-cygwin32/bin/make
1440 </pre>
1442 </li><li>Build $TAO_ROOT/tests<p>
1443 </p></li></ol>
1446 <h3><a href="mailto:Jaffar_Shaikh@Mitel.COM">Jaffar Shaikh's</a>
1447 Notes for Building ACE and TAO for VxWorks on NT host</h3>
1448 <b></b><p><b>Scenario:</b> I was building the ACE and TAO for VxWorks
1449 on NT. The target system was a PPC860 based chassis and another a NT
1450 host based card.</p>
1451 <b><p>Host System:</p>
1452 </b><p>NT 4.0 workstation with 128 M RAM, 266MHz Pentium.</p>
1454 <b><p>Software Needed For Building TAO</p>
1455 </b><p>1) <a href="https://www.activestate.com/products/perl">ActiveState Perl</a>
1456 or <a href="http://strawberryperl.com">Strawberry Perl</a>
1457 </p>
1459 <p>2) Tornado 2.2.1 from Windriver.</p>
1461 <p>3) Cygwin GNU to build TAO. It is available for NT as a freeware
1462 from the <a href="http://www.cygwin.com">Cygwin</a> site</p>
1463 <p>The Cygwin Make (version 3.75) can only build the TAO not the
1464 Tornado II make (version 3.74)</p>
1466 <b><p>Environment Variables:</p>
1467 </b><p>On NT the environment Variables are set as follows, (from
1468 Control Panel-&gt; System -&gt; Environment)</p>
1469 <p>I added following Environment variable entries to PATH </p>
1471 <pre>
1472 C:\Perl\bin\;
1473 C:\tornado\host\x86-win32\bin;
1474 C:\tornado\host\x86-win32\powerpc-wrs-vxworks\bin;
1475 C:\tornado\host\x86-win32\lib\gcc-lib\powerpc-wrs-vxworks\cygnus-2.7.2-960126;
1476 C:\Corba\Ace_wrappers\bin;
1477 C:\Cygwin\bin;
1478 C:\Cygwin\usr\bin;
1479 C:\bin
1480 </pre>
1482 <p>Additional Environmental variables and the values,</p>
1483 <pre>
1484 CPU=PPC860
1485 LD_LIBRARY_PATH=
1486 SHELL=/bin/sh.exe
1487 ACE_ROOT=/Corba/ACE_wrappers
1488 WIND_BASE=/tornado
1489 SHELL=/bin/sh.exe
1490 TERM=pcbios
1491 TAO_ROOT=/Corba/ACE_wrapper/Tao
1492 CPP_LOCATION=/Program Files/Microsoft Visual Studio/VC98/Bin/CL.exe
1493 GCC_EXEC_PREFIX=/tornado/host/x86-win32/lib/gcc-lib/
1494 WIND_HOST_TYPE=x86-win32
1495 PERL_PATH=/perl/bin/perl.exe
1496 </pre>
1498 <b><p>Directories of importance</p>
1499 </b><p>C:\Corba &lt;-- Ace_wrappers (uzipped)</p>
1500 <p>C:\tornado &lt;-- Tornado installed</p>
1501 <p>C:\Perl &lt;-- Perl installed</p>
1502 <p>C:\Cygwin &lt;-- Cygwin installed</p>
1503 <p>C:\bin &lt;-- Copy these files,</p>
1504 <p> Ace.dll, &lt;-- After you build Ace</p>
1505 <p> gperf.exe &lt;-- After you build gperf</p>
1506 <p> Cygwin1.dll, &lt;-- After you install Cygwin</p>
1507 <p> perl.exe, &lt;-- After you install Perl</p>
1508 <p> rm.exe &lt;-- After you install Cygwin</p>
1509 <p> sh.exe &lt;-- After you install Cygwin</p>
1510 <p> true &lt;-- After you install Cygwin</p>
1511 <b><p>Create Files</p>
1512 </b><p>1) C:\Corba\ACE_Wrappers\ace\config.h</p>
1513 <p>with entry</p>
1514 <pre>
1515 #if defined (_MSC_VER) || (__BORLANDC__)
1516 #include "ace/config-win32.h"
1517 #else
1518 #define ACE_HAS_IP_MULTICAST
1519 #include "ace/config-vxworks5.x.h"
1520 #endif
1521 </pre>
1523 <p>2) C:\Corba\ACE_wrappers\include\makeinclude\platform_macros.GNU</p>
1524 <pre>
1525 WIND_BASE = /tornado
1526 WIND_HOST_TYPE = x86-win32
1527 include $(ACE_ROOT)/include/makeinclude/platform_vxworks5.5.x.GNU
1528 ACE_COMPONENTS=FOR_TAO (you may choose this option to build ACE library that supports TAO)
1529 </pre>
1531 <p></p>
1532 <b><p>Steps to Build</p>
1533 </b><p>1) Build Ace.dll under NT</p>
1534 <p>In MS Visual C++ open C:\Corba\ACE_wrappers\ace.sln And build Ace
1535 DLL</p>
1536 <p>Copy Ace.dll in C:\bin</p>
1538 <p>2) Build gperf utility under NT</p>
1539 <p>In MS Visual C++ open
1540 C:\Corba\ACE_wrappers\apps\gperf\src\gperf.sln. Build gperf.exe</p>
1541 <p>Copy gperf.exe to C:\bin</p>
1543 <p>3) Mount Directries in Cygwin</p>
1544 <p>Click on Cygnus Solutions -&gt; Cygwin Bash Shell</p>
1545 <p>Mount following directories by using mount command.</p>
1546 <p>create respective directories first then use mount command </p>
1548 <p>e.g. Create /Corba directory then use $mount -s "C:\Corba"
1549 /Corba</p>
1551 <p>C:\Corba mount to /Corba</p>
1552 <p>C:\tornado mount to /tornado</p>
1553 <p>C:\Perl mount to /perl</p>
1554 <p>C:\Cygwin mount to /cygwin</p>
1555 <p>C:\bin mount to /bin</p>
1556 <p>C:\Program Files mount to /Program Files </p>
1558 <p>4) Build ACE in Cygwin</p>
1559 <p>$cd /Corba/ACE_wrappers/ace </p>
1560 <p>$make static_libs_only=1</p>
1561 <p>This will build your ace library libACE.a for VxWorks. If you use
1562 option shared_libs_only=1 then the build will be libACE.so. The other
1563 options are same as follows.</p>
1565 <p>5) Build TAO in Cygwin</p>
1566 <p>$cd $TAO_ROOT/tao</p>
1567 <p>$make debug=0 optimize=1 static_libs_only=1 minimum_orb=1
1568 </p>
1569 <p>for shared libs use shared_libs_only=1</p>
1571 <p>The minimum Tao does not have following components,</p>
1572 <p>Dynamic Skeleton Interface</p>
1573 <p>Dynamic Invocation Interface</p>
1574 <p>Dynamic Any</p>
1575 <p>Interceptors</p>
1576 <p>Interface Repository</p>
1577 <p>Advanced POA features</p>
1578 <p>CORBA/COM interworking</p>
1580 <p>You may play around with above options to find suitable build for
1581 your needs. For example when you give option debug=1 all the debug
1582 symbols will be created and the build will huge in size. The debug
1583 symbols are necessary when you want to debug your code.</p>
1585 <hr align="left" width="50%">
1587 <h2><a name="android">Building and Installing ACE on Android</a></h2>
1589 <ul>
1590 <li><a href="#android-target">Choosing the Target</a></li>
1591 <li><a href="#android-toolchain">Generating a Toolchain (Optional)</a></li>
1592 <li><a href="#android-building">Building</a></li>
1593 <li><a href="#android-install">Installing ACE on Android</a></li>
1594 <li><a href="#android-logging">Logging</a></li>
1595 <li><a href="#android-openssl">OpenSSL</a></li>
1596 </ul>
1598 <p>ACE can be built for Android by using the <a
1599 href="https://developer.android.com/ndk/">Android Native Development Kit
1600 (NDK)</a>. This is different than the standard way of writing Android
1601 applications in Java which run the on the Android Runtime or the older Dalvik
1602 Virtual Machine. Applications and libraries built using the NDK are native
1603 Linux applications written in C or C++ specifically compiled to run on Android
1604 systems and libraries can be included in normal Android apps. In addition,
1605 applications and libraries built using the NDK have access to Android-specific
1606 APIs much like the ones available to Java-based Android applications.
1607 </p>
1609 <p><b>NOTE: ACE requires NDK r18 or later. Building with the NDK directly requires NDK r19 or later.</b></p>
1611 <div class="boxed">
1612 <p><b>Windows Users:</b> These instructions are written for a Unix based
1613 platform like Linux, but can also be used on Windows. If you are using an
1614 virtualized Linux environment like Windows Subsystem for Linux (WSL), Docker,
1615 or a traditional VM, then you can use the Linux version of the NDK and ignore
1616 rest of this note and all the other Windows specific notes.
1617 </p>
1619 <p>If that is not the case, you should also pay attention to the notes marked
1620 with "<b>Windows Users:</b>" in addition to the rest of the instructions. In
1621 addition to the Windows version of the Android NDK, you will also need
1622 <a href="https://www.msys2.org">MSYS2 for Unix utilities that ACE needs</a>.
1623 </div>
1625 After downloading the NDK, you will have to decide on what target you want to
1626 build for, which is covered in the next section, then decide if you want to
1627 build directly using the NDK or using
1628 <a href="#android-toolchain">a generated standalone toolchain</a>. Generating a
1629 toolchain is optional and only really makes sense if you're building for just
1630 one architecture/API level pair and don't need to keep the entire NDK around.
1632 <h3><a name="android-toolchain">Choosing the Target</a></h3>
1634 <p>To build ACE for Android you need to know the specific Android target you
1635 want. The specific target is defined by two things:</p>
1637 <dl class="indent">
1638 <dt>- The minimal API level to target.</dt>
1639 <dd>A lower level means larger amount of potential users but also
1640 potentially less features. Android has <a
1641 href="https://source.android.com/setup/start/build-numbers">many API levels
1642 to target</a>. They roughly correspond to the versions of Android.
1643 </dd>
1644 <dt>- The CPU architecture to target (Also called the Application Binary
1645 Interface or ABI by the NDK documentation).</dt>
1646 <dd>In addition to ARM, Android also supports x86 and MIPS,
1647 although support for MIPS has been dropped from the NDK. <a
1648 href="https://developer.android.com/ndk/guides/abis">This is the official
1649 documentation on the ABIs</a>. These are the ABIs that ACE supports at the
1650 time of writing and must be passed to ACE as <code>android_abi</code>:
1651 <!-- Check to see if any architectures have been added or removed. If so
1652 update this list and the table below as well-->
1653 <dl id="android_abis">
1654 <dt><code>armeabi-v7a</code></dt>
1655 <dd>32-bit ARM. Builds with NEON extensions enabled by default. Include
1656 <code>android_neon := 0</code> in your <code>platform_macros.GNU</code>
1657 if you want to support processors without NEON support.</dd>
1658 <dt><code>arm64-v8a</code></dt>
1659 <dd>64-bit ARM, Sometimes referred to as <code>aarch64</code>.</dd>
1660 <dt><code>x86</code></dt>
1661 <dd>32-bit x86</dd>
1662 <dt><code>x86_64</code></dt>
1663 <dd>64-bit x86</dd>
1664 </dl>
1665 <p><b>
1666 It should be noted that starting in August 2019, the Google Play
1667 Store will require new apps to have 64-bit libraries if they have native
1668 libraries. 32-bit native libraries will still be supported but apps must
1669 also have 64-bit libraries. Look up any restrictions that may affect apps
1670 you want to publish on the Play Store, including targeted API level
1671 requirements.
1672 </b></p>
1673 </dd>
1674 </li>
1675 </dl>
1677 <h3><a name="android-toolchain">Generating a Toolchain (Optional)</a></h3>
1679 <p>To generate a toolchain, one use must use
1680 <code>build/tools/make_standalone_toolchain.py</code> in the NDK. A destination must be
1681 chosen and is denoted here as <code>$TOOLCHAIN</code>. For example, to generate a
1682 toolchain targeting 32-bit ARM Android 7.0 "Nougat" (API Level 24) and later: </p>
1683 <p class="indent">
1684 <code>./make_standalone_toolchain.py --arch arm --api 24 --install-dir $TOOLCHAIN</code>
1685 </p>
1686 <p><code>$TOOLCHAIN/bin</code> must be in your <code>$PATH</code> when building ACE and
1687 applications using ACE.</p>
1689 <p>This table shows how the <code>android_abi</code> variable and the
1690 <code>--arch</code> argument correlate:</p>
1691 <table class="indent" id="android_abi_toolchain_table">
1692 <tr>
1693 <th><code>android_abi</code></th>
1694 <th><code>--arch</code></th>
1695 </tr>
1696 <tr>
1697 <td><code>armeabi-v7a</code></td>
1698 <td><code>arm</code></td>
1699 </tr>
1700 <tr>
1701 <td><code>arm64-v8a</code></td>
1702 <td><code>arm64</code></td>
1703 </tr>
1704 <tr>
1705 <td><code>x86</code></td>
1706 <td><code>x86</code></td>
1707 </tr>
1708 <tr>
1709 <td><code>x86_64</code></td>
1710 <td><code>x86_64</code></td>
1711 </tr>
1712 </table>
1714 <div class=boxed>
1715 <p><b>Windows Users:</b>
1716 Android NDK includes Python in <code>prebuilt\windows-x86_64\bin</code> for
1717 64-bit Windows NDKs. For the example above, assuming <code>%NDK%</code> is the
1718 location of the NDK and <code>%TOOLCHAIN%</code> is the desired location of the
1719 toolchain, run this command instead:</p>
1721 <p class="indent">
1722 <code>
1723 %NDK%\prebuilt\windows-x86_64\bin\python.exe
1724 %NDK%\build\tools\make_standalone_toolchain.py
1725 --arch arm --api 24
1726 --install-dir %TOOLCHAIN%</code>
1727 </p>
1729 <p>For Windows <code>%TOOLCHAIN%\bin</code> and the location of the MSYS2
1730 utilities must be in <code>%PATH%</code> when cross compiling ACE. The default
1731 location for these would be <code>C:\msys64\usr\bin</code>.
1732 </div>
1734 <h3><a name="android-building">Building</a></h3>
1736 <ul>
1737 <li>
1738 If building TAO, build the ACE and TAO tools (<code>ace_gperf</code> and
1739 <code>tao_idl</code>) for the host. Follow the <a
1740 href="../TAO/TAO-INSTALL.html">cross compilation setup instructions provide
1741 in TAO-INSTALL.html</a>.
1742 <div class="boxed indent">
1743 <p><b>Windows Users:</b> If cross compiling TAO and the host tools were
1744 built using using Visual Studio, make sure <code>cl.exe</code> can be run
1745 from the environment when building for Android, as <code>tao_idl</code>
1746 will need to use it as a C preprocessor.
1747 </div>
1748 </li>
1749 <li>Setup the Android build<ul>
1750 <li>Create <code>ace/config.h</code>: <code>#include "ace/config-android.h"</code></li>
1751 <li>Create <code>include/makeinclude/platform_macros.GNU</code>:
1752 <ul>
1753 <li>
1754 Set <code>android_abi</code> to one of
1755 <a href="#android_abis">the options above</a>.
1756 If using a standalone toolchain this must match the
1757 <code>--arch</code> argument used according
1758 to <a href="#android_abi_toolchain_table">the table above</a>.
1759 </li>
1760 <li>If using the NDK directly, set <code>android_ndk</code> to the
1761 location of the extracted NDK and <code>android_api</code> to the API
1762 level desired.</li>
1763 <li>Set options for debug and optimization options as desired.</li>
1764 <li>If you want to compile static, add <code>static_libs_only:=1</code></li>
1765 <li>Must include <code>include $(ACE_ROOT)/include/makeinclude/platform_android.GNU</code>.</li>
1766 <li>
1767 If building TAO, set the <code>tao_idl</code> options specified in
1768 the cross compiling instructions in <code>TAO-INSTALL.html</code>
1769 </li>
1770 </ul>
1771 </ul>
1772 </li>
1773 </li>
1774 <li>Generate makefiles (if necessary).</li>
1775 <li>Build with GNU make. If using a standalone toolchain, make sure you
1776 have <code>$TOOLCHAIN/bin</code> in your <code>$PATH</code>.
1777 <div class="boxed indent"><p>
1778 <b>Windows Users:</b> If using a standalone toolchain,
1779 Make sure you have <code>%TOOLCHAIN%\bin</code>
1780 and MSYS2's <code>bin</code> in your <code>%PATH%</code> when building.
1781 If you are cross compiling TAO you will also need a preprocessor for
1782 <code>tao_idl</code> available (See Windows note above).</p>
1783 </div>
1784 </li>
1785 </ul>
1786 </p>
1788 <h3><a name="android-install">Installing ACE on Android</a></h3>
1790 <p>Native applications using the ACE library can be installed onto devices by
1791 several different methods. The files can be include as assets of Java
1792 application and can be written by the Java application into it's executable
1793 program directory. The native application can be downloaded by a Java
1794 application and written into the Java applications executable program
1795 directory. The native application can also be uploaded using the Software
1796 Development Kit's ADB tool. This method requires uploading the native
1797 application to a directory that allows execution and having any output
1798 directed to a writable directory.</p>
1800 <h3><a name="android-logging">Logging</a></h3>
1802 On Android, <code>ACE_Log_Msg</code> (and therefore <code>ACE_DEBUG</code> and
1803 <code>ACE_ERROR</code>) uses Android's logging system (aka Logcat) by default
1804 in addition to <code>stderr</code> because <code>stdout</code> and
1805 <code>stderr</code> are discarded under normal circumstances. To disable this
1806 at runtime, run:
1807 </p>
1809 <pre class="indent">
1810 ACE_LOG_MSG-&gt;clr_flags (ACE_Log_Msg::SYSLOG);
1811 </pre>
1813 <p>To disable this at compile time include these lines in <code>config.h</code>:</p>
1815 <pre class="indent">
1816 #define ACE_DEFAULT_LOG_FLAGS ACE_Log_Msg::STDERR
1817 #define ACE_DEFAULT_LOG_BACKEND_FLAGS 0
1818 </pre>
1820 <h3><a name="android-openssl">OpenSSL</a></h3>
1822 Depending on the features of ACE, TAO, or other software desired, you might need
1823 OpenSSL. On Android, OpenSSL isn't part of the NDK Library and Android
1824 preloads the system SSL library (either OpenSSL or BoringSSL) for the Java
1825 Android API. This means OpenSSL <b>MUST</b> be statically linked to avoid
1826 conflicts with the almost certianly incompatible system SSL library.
1828 To build OpenSSL for Android, please read <code>NOTES.ANDROID</code> that comes
1829 with OpenSSL's source code. The static libraries will used if the shared
1830 libraries are not found. This can be accomplished by either disabling the
1831 generation of the shared libraries by passing <code>no-shared</code> to
1832 OpenSSL's <code>Configure</code> script or just deleting the so files after
1833 building OpenSSL.
1834 </p>
1836 <hr>
1837 <h1><a name="svcsinstall">Building and Installing ACE Network Services</a></h1>
1839 The following explains how to build the ACE <a href="http://www.dre.vanderbilt.edu/~schmidt/ACE-netsvcs.html">network services</a> on <a href="#unixsvcs">UNIX</a> and <a href="#win32svcs">Win32</a>.
1841 <p></p><hr align="left" width="50%"><p>
1842 </p><h2><a name="unixsvcs">Building and Installing ACE Network Services on UNIX</a></h2>
1844 Building and installing ACE Network Services on UNIX is relatively
1845 simple (the <a href="#win32svcs">process</a> for Win32 is different).
1846 Here's what you need to do:<p>
1848 </p><ol>
1850 <li>Build and install ACE on UNIX as described <a href="#unix">earlier</a>. If ACE is built at the root of the ACE
1851 source tree (and ACE has been ported to your platform, of course) the
1852 netsvcs static and shared object libraries should be built
1853 automatically. In addition, the server driver program
1854 (<code>main</code>) contained in <a href="netsvcs/servers/main.cpp">$ACE_ROOT/netsvcs/servers/main.cpp</a>
1855 should also be compiled and ready to run.<p>
1857 </p></li><li>Set your <code>LD_LIBRARY_PATH</code> environment variable to
1858 where the binary version of the ACE netsvcs library. For
1859 example, you probably want to do something like the following<p>
1861 </p><pre><code>
1862 % setenv LD_LIBRARY_PATH $ACE_ROOT/ace:$ACE_ROOT/lib:$LD_LIBRARY_PATH
1863 </code></pre><p>
1865 </p></li><li>By default, if the shared object library is built, the services
1866 are linked into the <code>main</code> driver program dynamically.
1867 To specify which services should be linked in and executed, edit the
1868 <a href="netsvcs/servers/svc.conf">$ACE_ROOT/netsvcs/servers/svc.conf</a>
1869 file. During your editing, you should update information (such as the
1870 default service port numbers) that affects the initialization of
1871 services in this file. Refer to the
1872 <a href="http://www.dre.vanderbilt.edu/~schmidt/ACE-papers.html#config">Service Configurator</a>
1873 documentation to learn how the configuration file is parsed and
1874 how the services are dynamically linked and executed. In
1875 addition, refer to the <a href="http://www.dre.vanderbilt.edu/~schmidt/ACE-netsvcs.html">Network
1876 Services</a> documentation to learn more about how to configure
1877 each network service.<p>
1879 </p></li><li>If you only want to link the services statically, simply remove
1880 or rename the svc.conf file.<p>
1881 </p></li></ol>
1883 <p></p><hr align="left" width="50%"><p>
1884 </p><h2><a name="win32svcs">Building and Installing ACE Network Services on Win32</a></h2>
1886 Once again, there are supplied project for Visual C++ 7.1 or later for
1887 the Network Services.<p>
1889 </p><hr>
1890 <h1><a name="sslinstall">Building and Installing the ACE_SSL Library</a></h1>
1892 <p>The first step for all platforms is to build and install the
1893 <a href="http://www.openssl.org/">OpenSSL</a> distribution. The
1894 ACE_SSL library must then be built according to the instructions
1895 below.</p>
1896 <h2>Unix</h2>
1897 <ol>
1898 <li>Make sure the OpenSSL header file directory is in your compiler's
1899 include path, and that OpenSSL libraries are in your library link/load
1900 path (e.g. <code>LD_LIBRARY_PATH</code>). If you
1901 installed OpenSSL into a set of directories unknown by the compiler,
1902 set the <code>SSL_ROOT</code> environment variable to point to the
1903 top level directory of your OpenSSL distribution, i.e. the one
1904 containing OpenSSL's <code>include</code> and <code>lib</code>
1905 directories.</li>
1906 <li>Build ACE as described above. When building ACE, add
1907 <code>ssl=1</code>
1908 to your <code>make</code>
1909 command line invocation, or add it to your
1910 <code>platform_macros.GNU</code> file.</li>
1911 <li>Build the ACE_SSL library in the <tt>$ACE_ROOT/ace/SSL</tt>
1912 directory. The <code>ACE_ROOT</code> environment variable should be set
1913 prior to this point.</li>
1914 </ol>
1915 <h2>Microsoft Visual Studio</h2>
1916 <ol>
1917 <li>Set the <code>SSL_ROOT</code> environment variable to the location
1918 of the directory containing the OpenSSL <code>inc32</code> and
1919 <code>out32dll</code> directories.
1920 <li>Add <code>ssl=1</code> to your MPC
1921 <code>$ACE_ROOT/bin/MakeProjectCreator/config/default.features</code>
1922 or <code>$ACE_ROOT/local.features</code> file.
1923 <li>At the moment you are using OpenSSL v1.1 or
1924 newer also add <code>openssl11=1</code> to your MPC
1925 <code>$ACE_ROOT/bin/MakeProjectCreator/config/default.features</code>
1926 or <code>$ACE_ROOT/local.features</code> file.
1927 <li>Re-run MPC to add
1928 support for building the ACE_SSL library to your MSVC++
1929 workspaces and projects.
1930 <li>Open the <code>ACE.sln</code> solution, and refer to the ACE build
1931 and installation instructions above for details on creating a
1932 <code>config.h</code> configuration header for this platform. Once
1933 the <code>config.h</code> file has been created, build the
1934 <code>ACE_SSL</code> project.</li>
1935 </ol>
1936 <h2>Embarcadero C++</h2>
1937 <p>Support for building ACE's ACE_SSL library and TAO's SSLIOP
1938 pluggable protocol with Embarcadero C++ does exist.
1939 <ol>
1940 <li>Set the <code>SSL_ROOT</code> environment variable to the location
1941 of the directory containing the OpenSSL <code>inc32</code> and
1942 <code>out32</code> directories.
1943 <li>Add <code>ssl=1</code> to your MPC
1944 <code>$ACE_ROOT/bin/MakeProjectCreator/config/default.features</code>
1945 or <code>$ACE_ROOT/local.features</code> file, and re-run MPC to add
1946 support for building the ACE_SSL library to your Embarcadero C++ makefiles.
1947 <li>Build ACE and TAO.
1948 </ol>
1949 </p>
1951 <hr><p>
1952 </p><h1><a name="guireactor_install">Building and Using GUI Reactors Libraries</a></h1>
1953 There is a general method for building and using <code>ACE_Reactors</code> for various GUI
1954 libraries.
1955 <h2> Building GUI Reactor Library </h2>
1956 <ol>
1957 <li>Try to generate build files using MPC. Inspect the output of MPC to find out which features are
1958 necessary to build given reactor. Add these features to
1959 <code>ACE_wrappers/bin/MakeProjectCreator/*.features</code> file, or pass them directly to MPC
1960 using <code>-features</code> command line option. For example, for <code>FlReactor</code> the procedure
1961 consists of five steps
1962 <ol>
1963 <li> In the first pass one gets that <code>x11</code> (X11 libraries) is missing.<br>
1964 <code>$ mwc.pl -type gnuace
1965 Skipping ACE_FlReactor (ace_flreactor.mpc), it requires x11.
1966 </code></li>
1967 Ensure that <code>X11</code> libraries are installed, then pass <code>x11=1</code> feature to MPC.
1968 <li>In the second pass one gets that <code>gl</code> (OpenGL library) is missing.<br>
1969 <code>$ mwc.pl -type gnuace -features x11=1 ace.mwc
1970 Skipping ACE_FlReactor (ace_flreactor.mpc), it requires gl.
1971 </code></li>
1972 Ensure that <code>OpenGL</code> libraries are installed, then pass <code>gl=1</code> feature to MPC.
1973 <li>In the third pass one gets that <code>fl</code> (Fast Light Toolkit) is missing.<br>
1974 <code>$ mwc.pl -type gnuace -features x11=1,gl=1 ace.mwc
1975 Skipping ACE_FlReactor (ace_flreactor.mpc), it requires fl.
1976 </code></li>
1977 Ensure that <code>Fast Light Toolkit</code> libraries are installed, then pass <code>fl=1</code>
1978 feature to MPC.
1979 <li>In the fourth pass one gets that <code>ace_flreactor</code> feature is missing<br>
1980 <code>$ mwc.pl -type gnuace -features x11=1,gl=1,fl=1 ace.mwc
1981 Skipping ACE_FlReactor (ace_flreactor.mpc), it requires ace_flreactor.
1982 </code></li>
1983 Allow MPC to generate makefiles for <code>FlReactor</code> by setting <code>ace_flreactor=1</code> feature.
1984 <li>In the last pass one obtains files for building <code>FlReactor</code>.<br>
1985 <code>$ mwc.pl -type gnuace -features x11=1,gl=1,fl=1,ace_flreactor=1 ace.mwc
1986 </code></li>
1987 </ol>
1988 Currently to simplify MPC generation some of features are turned on by default in
1989 <code>ACE_wrappers/bin/MakeProjectCreator/global.features</code>. For examples to generate
1990 files related with Fl one has to provide only fl=1 feature. To obtain a more fine grained controll
1991 over MPC generation process one may modify <code>ACE_wrappers/bin/MakeProjectCreator/*.features</code>
1992 files.
1993 </li>
1994 <li> Required build files are generated now, it is enough then to invoke build tool.
1995 For example for under <code>MPC::gnuace</code> one has to call
1996 <code>make fl=1</code>. For <code>MPC::vc7</code> target all features are
1997 encoded in generated project files, thus it is enough to compile ACE using MSVC.
1998 </li>
1999 </ol>
2000 The build procedure leads to a specific GUI Reactor library. For example, for
2001 <code>Qt</code> and <code>Linux </code> one gets <code>libQtReactor.so</code>, while for
2002 <code>Windows</code> the results are shared <code>QtReactor.dll</code> and import
2003 <code>QtReactor.lib</code> libraries or their variants depending on build options.
2004 When compiling TAO also GUI related libraries are created like <code>libTAO_QtResource.so</code>.
2005 <h2> Using GUI Reactor Library </h2>
2006 Here one has at least three use cases:
2007 <ol>
2008 <li><b>Applications with their own build system.</b>
2009 To use ACE support for GUI one has to include specific GUI headers and
2010 link with specific <code>ACE_[GUI]Reactor</code> library. When using TAO support for GUI one has
2011 also to link with specific <code>TAO_[GUI]Resource</code> library.</li>
2012 <li><b>Applications with build system using MPC.</b>
2013 In general, it is better to create specific base projects for using ACE GUI support in such application.
2014 Base projects provided by ACE <code>ACE_wrappers/bin/MakeProjectCreator/[ace,tao]_[gui][reactor,resource].mpb</code>
2015 may be an examples of how to do this.</li>
2016 <li><b>Internal ACE applications like tests or examples.</b>
2017 MPC project for internal ACE application using GUI support should be derived from
2018 <code>ace_[gui]reactor.mpb</code> base projects. To employ TAO support for GUI one should derive
2019 the project from <code>tao_[gui]resource.mpb</code> These base projects ensure that all necessary libraries
2020 are linked to the application, specifies features necessary to build a project and moreover impose a
2021 build order consistant with ACE. For example, the application project using <code>XtReactor</code> should be
2022 derived from <code>ace_xtreactor.mpb</code>.</li>
2023 </ol>
2024 <h2>Notes on specific GUI Reactors</h2>
2025 <ul>
2026 <li> <code>QtReactor</code></li>
2027 The build is controlled by <code>ace_qtreactor</code> [1 by default] feature.
2028 To build this reactor one has to provide feature <code>qt</code> [0 by default] (Qt library). Moreover,
2029 it is assumed that <code>Qt</code> was installed in a standard way
2030 and <code>QTDIR</code> points to <code>Qt</code> installation folder. To build TAO
2031 support for <code>Qt</code> one should use <code>tao_qtresource</code> [1 by default] feature.
2032 <li> <code>XtReactor</code></li>
2033 The build is controlled by <code>ace_xtreactor</code> [1 by default] feature.
2034 To build this reactor one has to provide the following features: <code>x11</code> [1 by default]
2035 (X11 libraries) and <code>xt</code> [1 by default] (X11 Toolkit).
2036 Moreover, some examples and tests related with <code>XtReactor</code>
2037 needs additionall features namely either <code>motif</code> [0 by default] (Motif/Lesstif libraries) or
2038 <code>athena</code> [0 by default] (Athena widgets). To build TAO
2039 support for <code>xt</code> one should use <code>tao_xtresource
2040 </code> [1 by default] feature.
2041 <li> <code>TkReactor</code></li>
2042 The is controlled by <code>ace_tkreactor</code> [1 by default] feature. To build this reactor one has to provide
2043 <code>tk</code> [0 by default] (Tcl libraries) feature. To build TAO
2044 support for <code>Tk</code> one should use <code>tao_tkresource</code> [1 by default] feature.
2045 <li> <code>FlReactor</code></li>
2046 The build is controlled by <code>ace_flreactor</code> [1 by default] feature.
2047 To build this reactor one has to provide the following features: <code>x11</code>
2048 [1 by default] (X11 libraries),
2049 <code>gl</code> [1 by default] (OpenGl) and <code>fl</code>
2050 [0 by default] (Fast Light Toolkit). To build TAO
2051 support for <code>Fl</code> one should use <code>tao_flresource</code> [1 by default] feature.
2052 <strong>MS Windows:</strong> The paths to <code>fltkdll</code> and
2053 <code>OpenGL32</code> libraries, as well as <code>fltk</code> header files
2054 should be setup manually for succesfull compilation. Obviosuly,
2055 <code>x11</code>switch is ignored for this platform.</li>
2056 </ul>
2058 <hr>
2059 <h1><a name="installnotes">Installation Notes</a></h1>
2061 <ul>
2062 <li><b>Windows (Windows NT, 2000, XP, 2003, etc., and Windows '9x/ME) </b><p>
2064 Please see the <a href="#NonStaticObjectManager">Non-static
2065 ACE_Object_Manager</a> discussion below.</p><p>
2067 </p></li><li><b><a name="Linux">Linux</a></b><p>
2069 ACE has been ported to Linux on
2070 Intel, PowerPC platforms. If you use a RedHat 5.x
2071 distribution, it's best to use RedHat 5.1 or later. ACE works
2072 without any modifications on RedHat 5.1 and later, and on
2073 Debian 2.1 on Intel. Use the
2074 <code>platform_linux.GNU</code> and <code>ace/config-linux.h</code>
2075 in your <code>platform_macros.GNU</code> and
2076 <code>config.h</code> files, respectively. The same
2077 files can be used on PowerPC, with LinuxPPC
2078 1999 (R5), with glibc 2.1.1.</p><p>
2080 If you run out of memory, it's easy to add virtual memory on
2081 Linux. Please see the <code>mkswap</code> man page. You'll
2082 need at least 256 to 300 Mb of virtual memory (RAM + swap) to
2083 compile all of ACE+TAO. The <a href="#resource_requirements">System
2084 Resource Requirements section</a> has some suggestions on how
2085 to reduce the memory requirement.</p><p>
2087 The glibc 2.0 dynamic loader isn't thread safe. If you want to
2088 use the Invocation API you'll have to set
2089 <code>LD_BIND_NOW=true</code>. If you want to use
2090 <code>dlopen</code>, you should use <code>RTLD_NOW</code>. The
2091 dynamic loader in glibc 2.1 is thread safe.</p><p>
2093 <strong>NOTE:</strong> The TAO NameService uses IP multicasting
2094 by default, though it is not required. IP multicast on Linux
2095 requires the following:</p><p>
2097 </p><ul>
2098 <li>Enable IP multicast in the Linux kernel. It is enabled in
2099 the default RedHat 5.1 kernel. In older distributions, you
2100 can enable it by rebuilding your kernel with CONFIG_IP_MULTICAST
2101 enabled.<p>
2102 </p></li><li>Enable IP multicast in ACE. It is enabled by default in
2103 <code>ace/config-linux.h</code>. If you don't use
2104 IP multicast, add <code>#define ACE_HAS_IP_MULTICAST 0</code>
2105 to your <code>ace/config.h</code> before building ACE.<p>
2106 </p></li><li>There must be a network interface that is up and supports
2107 multicast. If you have linuxconf, it's easiest to use that
2108 to add a network route for multicast (224.0.0.0) on one of
2109 your network interfaces, such as <code>eth0</code>. If
2110 you don't have or use linuxconf, try adding a multicast
2111 routing table entry using something like this:<p>
2112 </p><pre> <code># route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0</code>
2113 </pre><p>
2114 </p></li></ul>
2116 Some of the ACE tests fail on older, pre-glibc2 Linux platforms,
2117 such as RedHat 4.2. The problems are with threads and
2118 thread-specific storage.</p><p>
2120 </p></li><li><b>SCO UNIX</b><p>
2122 ACE has been ported to SCO UNIX using the GNU g++ 2.7.2
2123 compiler. Arturo Montes &lt;<a href="mailto:mitosys@colomsat.net.co">mitosys@colomsat.net.co</a>&gt;
2124 maintains this code. In addition, he also maintains a version
2125 of <a href="http://www.cs.wustl.edu/%7Eschmidt/ACE_wrappers/FSU-threads.tar.gz">FSU pthreads</a>.</p><p>
2127 </li><li><b> FreeBSD </b><p>
2129 FreeBSD is a fast evolving platform. However, it has the
2130 advantage of having standard releases. At this moment, ACE is
2131 only perodically tested against -stable (3.1R) and we rely a lot
2132 on FreeBSD users' feedbacks. </p><p>
2134 Notice that on older FreeBSD, <code>ld.so</code> only looks for
2135 so libraries with <b>version number</b> appended. ACE makefiles
2136 create symlinks for most shared libraries if
2137 <code>versioned_so</code> is defined to 1 in
2138 <code>$ACE_ROOT/ace</code> with appropriate ACE version.
2139 However, this does not work for libACE.so itself so you have to
2140 create it manually (If you figure out how to do this, please let
2141 us know) like this: </p><p>
2143 <code>ln -sf $ACE_ROOT/ace/libACE.so $ACE_ROOT/ace/libACE.so.4.5</code></p><p>
2145 On newer FreeBSD (3.0 or later,) this is no longer necessary.</p><p>
2147 </p></li><li><b>NetBSD</b><p>
2149 Like older FreeBSD, NetBSD's <code>ld.so</code> also requires
2150 versioned .so files.</p><p>
2152 </p></li><li><b>OpenBSD</b><p>
2154 ACE has been ported to OpenBSD 3.1 and GNU g++ 2.95.3.</p><p>
2156 As with FreeBSD and NetBSD, OpenBSD requires versioned .so
2157 files. This is currently handled by the build files and no
2158 additional work is needed.</p><p>
2160 ACE has been ported to OpenBSD with and without pthreads
2161 enabled. When using pthreads, though, C++ exceptions must be
2162 disabled. This is a known problem with the current release of
2163 OpenBSD (see www.openbsd.org, bug #1750). ACE emulated
2164 exceptions work fine.</p><p>
2166 Compiling TAO may require the user data segment size
2167 restrictions and possibly other options to be increased. This
2168 is done by modifying the default user class in /etc/login.conf
2169 or by adding a new class and modifying the master passwer file
2170 accordingly.</p><p>
2172 </p></li><li><b> UnixWare </b> <p>
2174 Steve Huston &lt;<a href="mailto:shuston@riverace.com">shuston@riverace.com</a>&gt;
2175 has ported ACE to work with UnixWare 2.01 and g++.</p><p>
2177 Ganesh Pai &lt;<a href="mailto:gpai@voicetek.com">gpai@voicetek.com</a>&gt;
2178 subsequently did the port for version 2.1.2, also with g++.</p><p>
2180 Phil Mesnier &lt;<a href="mailto:mesnier_p@ociweb.com">
2181 mesnier_p@ociweb.com</a>&gt; updated the port to support
2182 UnixWare 7.1.0, with help from Michael Meissnitzer
2183 &lt;<a href="mailto:michael.meissnitzer@siemens.at">
2184 michael.meissnitzer@siemens.at</a>&gt;, Christian Klepp &lt;
2185 <a href="mailto:christian.klepp@siemens.at">christian.klepp@siemens.at
2186 </a>&gt; and Engelbert Staller &lt;<a href="mailto:engelbert.staller@siemens.at">
2187 engelbert.staller@siemens.at</a>&gt;
2188 Building ACE (and TAO) on Unixware 7.1.0 requires a very specific
2189 g++ build environment. In particular, you must build and install
2190 g++ 2.95.2, along with binutils 2.9.1. The order (and the declaration
2191 of configuration) is extremely important. Using the gcc compiler
2192 provided on the Skunkware CD on a pentium system, here is the recipe
2193 I used to build a working environment (as root):<br>
2194 </p><pre> mkdir /usr/local/newgnu
2195 &lt; ftp and untar binutils-2.9.1 &gt;
2196 &lt; ftp and untar gcc-2.95.2 &gt;
2197 mkdir -p build/binutils build/gcc
2198 cd build/binutils
2199 ../../binutils-2.9.1/configure i386-sco-sysv4
2200 gmake # takes a long time
2201 gmake install # this creates /usr/local/i386-sco-sysv4/...
2202 mkdir /usr/local/i486-pc-sysv5/bin
2203 cd /usr/local/i486-pc-sysv5/bin
2204 for a in /usr/local/i386-sco-sysv4/bin/*; do ln -s $a .; done
2205 #links all the newly installed utilities
2207 cd /usr/local/newgnu/build/gcc
2208 ../../gcc-2.95.2/configure --with-gnu-as --with-gnu-ld
2209 gmake bootstrap # takes a long time
2210 gmake install
2211 mkdir /usr/local/i586-UnixWare7.1.0-sysv5/bin
2212 for a in /usr/local/i386-sco-sysv4/bin/*; do ln -s $a .; done
2213 </pre>
2214 Once done, ACE and TAO will successfully build and link.<p>
2216 </p></li><li><b><a name="LynxOS">LynxOS</a></b><p>
2218 ACE builds and runs properly on LynxOS 4.0 for Intel
2219 and PowerPC targets. LynxOS 2.x and 3.x are no longer supported.
2221 If you run out of memory on LynxOS, these might help:</p><p>
2223 </p><ul>
2224 <li>Increase the limits in <code>/etc/starttab</code>,
2225 then reboot system. We use these limits:
2226 <pre># Data, stack, and core file limits (in Kbytes)
2227 80000
2228 16000
2229 102400</pre><p>
2230 </p></li><li>Enable or expand virtual memory, with something like:
2231 <pre># mkcontig /swap 320
2232 # prio 17 vmstart /swap</pre>
2233 See the <code>mkcontig</code> and <code>vmstart</code>
2234 man pages, and <code>/bin/rc</code>.<p>
2235 </p></li></ul>
2237 Please see the comments in the
2238 <a href="include/makeinclude/platform_lynxos.GNU">ACE
2239 platform_lynxos.GNU file</a> for information on, and an
2240 example of, tailoring for your particular platform.<p>
2242 NOTE: if you want to use IP multicast on LynxOS, be sure to add
2243 this line to your <code>/net/rc.network</code>, and reboot:</p><p>
2244 </p><pre><code>
2245 /bin/route add "224.0.0.0" "$my_name"
2246 </code></pre>
2248 </li><li><strong>VxWorks</strong><p>
2250 David Levine has
2251 ported ACE to VxWorks 5.2/5.3/5.3.1/5.4 with the GreenHills
2252 1.8.8/1.8.9, g++ and diab compilers that are distributed with
2253 VxWorks/Tornado. It is not possible to use VxWorks 5.4
2254 and earlier with ACE anymore because the compilers delivered with
2255 5.4 and earlier don't support the C++ features ACE needs.</p><p>
2257 At this moment <a href="https://www.remedy.nl">Remedy IT</a> is upgrading
2258 and stabilizing ACE/TAO support for Tornado 2.2/VxWorks 5.5.1.
2259 Since the existing support for previous VxWorks version has been unsupported
2260 and broken for some time and most (potential) users seem to have upgraded to
2261 VxWorks 5.5.1 no backporting effort is done. See also <a href="#vxworks">here</a>.
2262 </p><p>
2264 Tornado 2.2/VxWorks 5.5.1 support IP multicast. That is not enabled
2265 by default in ACE for VxWorks, because it depends on your
2266 kernel configuration. To enable it, add
2267 <code>#define ACE_HAS_IP_MULTICAST</code> to your
2268 <code>ace/config.h</code>.</p><p>
2270 NOTE: In order for the ACE Broadcast and Multicast tests to work the VxWorks kernel
2271 should receive the packages it sends out locally. By default this is not supported.
2272 To enable this behaviour you need to include the IFF_SIMPLEX flag for your required
2273 NIC driver. See the following Windriver <a href="https://secure.windriver.com/cgi-bin/windsurf/techtips/public/viewSum.cgi?4542">SPR 4542</a>
2274 for more information.</p><p>
2276 In addition to all of the other benefits of ACE, it helps work
2277 around some deficiencies with VxWorks. The problems are:</p>
2280 </p><ol>
2281 <li>The program entry point cannot be called "main" with g++. ACE
2282 renames it to "ace_main" (configurable via ACE_MAIN) on VxWorks.
2283 While this may seem trivial, it is important with legacy code.
2284 ACE itself ran into this problem.<p>
2286 </p></li><li>argc/argv isn't used with VxWorks entry points. ACE provides
2287 a wrapper function that transparently converts shell command
2288 line arguments to argc/argv form. See <a href="#spa">below</a>
2289 for details.<p>
2291 </p></li></ol>
2293 Please note that ACE uses one of the spare fields in the Wind
2294 River task control block, spare4, for thread-specific storage.
2295 This field is specified in only one place, in ace/OS_NS_Thread.inl, so it
2296 can easily be changed to one of the other spare fields, if
2297 necessary.</p><p>
2299 ACE destroys dynamically
2300 allocated singletons in the ACE library. But, they may not
2301 properly destroy some static objects. If you have trouble
2302 running a program multiple times, it may be necessary to unload
2303 the module, using unld, and reload it between runs.
2304 Alternatively, you could try calling <code>cplusDtors</code> and
2305 then <code>cplusCtors</code> between runs.</p><p>
2307 </p></li><li><b>MVS OpenEdition</b> <p>
2309 All of ACE has been ported to OpenEdition by Chuck Gehr &lt;<a href="mailto:gehr@sweng.stortek.com">gehr@sweng.stortek.com</a>&gt;.
2310 The ACE library, all the tests and most of the examples and apps
2311 build clean. There are still some problems that need to be
2312 ironed out:</p><p>
2314 MVS does not support the dynamic linking dl...() calls that the
2315 Service Configurator uses to dynamically link services at run
2316 time. As a result, all the examples and apps that use a svc.conf
2317 file (for dynamically configuring service objects) do not work,
2318 however, most of these apps can be built/run statically. Also,
2319 the Svc_Conf_l.cpp and Svc_Conf_y.cpp files are generated using
2320 flex and yacc on a ascii (not ebcdic) machine and as a result
2321 they don't work very well with ebcdic svc.conf files. We should
2322 be able to regenerate these files on MVS but MVS doesn't have
2323 flex. This is something that needs to be done.</p><p>
2325 Some of the tests do not execute properly. This is a minority
2326 and over time the goal is to get to 100%.</p><p>
2328 The make scheme for some of the apps still doesn't work
2329 perfectly on MVS. This is mainly due to the way shared
2330 libraries are handled on MVS. See <a href="#mvs">additional
2331 build tips for MVS</a> for more on this.</p><p>
2333 </p></li><li><strong>QNX Neutrino</strong><p>
2335 ACE has been ported to <a href="http://www.qnx.com/products/os/neutrino.html">QNX Neutrino
2336 2.0</a>. We cross-compile for Neutrino on a QNX4 host using g++
2337 2.8.1, using the <a href="ace/config-qnx-neutrino.h">ace/config-qnx-neutrino.h</a>
2338 and <a href="include/makeinclude/platform_qnx_neutrino.GNU">include/makeinclude/platform_qnx_neutrino.GNU</a>
2339 configuration files. Many of the ACE tests succeed, though some
2340 fail. As the porting effort progresses, we hope to eliminate
2341 these failures. If you know of fixes, please send them to
2342 us.</p><p>
2343 </p></li><li><strong>QNX RTP</strong><p>
2345 ACE has been ported to <a href="http://get.qnx.com/">QNX RTP
2346 </a>. We compile for QNX RTP using the GCC compiler shipped with the
2347 distribution, using the <a href="ace/config-qnx-rtp.h">ace/config-qnx-rtp.h</a>
2348 and <a href="include/makeinclude/platform_qnx_rtp_gcc.GNU">include/makeinclude/platform_qnx_rtp_gcc.GNU</a>
2349 configuration files.
2350 Many of the ACE tests succeed, though some
2351 fail. As the porting effort progresses, we hope to eliminate
2352 these failures. If you know of fixes, please send them to
2353 us.</p><p>
2354 <strong><blink><font color="#ff0000">WARNING:</font></blink></strong>
2355 Under the current version of QNX RTP ACE fails if compiled with
2356 inline=0 . </p><p>
2358 </p></li><li><strong>PharLap ETS</strong><p>
2360 ACE has been ported to Ardence's
2361 <a href="http://www.ardence.com/embedded/products.aspx?ID=71">PharLap ETS</a>
2362 version 13. The port was originally done for Pharlap 9.1 and MSVC 6,
2363 but has been updated to Pharlap ETS 13 with Visual Studio .NET 2003
2364 (VC7.1).</p><p> To build for PharLap, you'll need to use MPC to
2365 generate .sln/.vcproj files with the ETS configurations. For example:
2366 <pre>
2367 cd \ace\ACE_wrappers
2368 perl bin/mwc.pl -type vc71 -relative ACE_ROOT=C:/ace/ACE_wrappers -relative TAO_ROOT=C:/ace/ACE_wrappers/TAO -value_template configurations='"ETS Debug"' -value_template configurations+='"ETS Release"' -name_modifier *_ETS TAO_ACE.mwc
2369 </pre>
2370 That command will generate the same .sln and .vproj files as for
2371 regular Windows builds with VC7.1, but they'll have names with an
2372 <code>_ETS</code> suffix and will include the "ETS Debug" and
2373 "ETS Release" configurations.</p><p>
2374 After generating the needed VC7.1 files, use the ace/config-pharlap.h
2375 configuration file, and the instructions
2376 for building on Windows. Building the ACE library is the same as
2377 for regular Windows platforms, except you choose one of the PharLap
2378 ETS configurations to build within Visual Studio.
2379 For an example of how to build binaries, see the tests directory.
2380 The tests_pharlap_msvc.lnk file is a LinkLoc commands file that the
2381 ACE tests are built with. It is likely that local sites may need
2382 to adjust this file for their target environment.
2383 </p><p>
2384 When executing programs on the target system, it is possible that not
2385 all of the VC++ support DLLs are resident on the target. In particular,
2386 the debug-supporting DLLs may not be present. If you require these, be
2387 sure to add those needed. For example, on the standard LabVIEW RT 8.2
2388 distribution using Pharlap ETS, the following DLLs must be copied to
2389 the target before being able to run Debug programs:
2390 <ul>
2391 <li>msvcp71d.dll</li>
2392 <li>msvcr71d.dll</li>
2393 </ul>
2394 </p><p>
2395 <note>To build ACE for National Instruments' LabVIEW RT, use
2396 the Pharlap ETS information above, but add the following line to your
2397 config.h file:
2398 <pre>
2399 #define ACE_PHARLAP_LABVIEW_RT
2400 </pre>
2401 This setting makes the necessary adjustments for LabVIEW's implementation
2402 of Pharlap ETS.</note>
2404 <note>By default, the ACE tests log their output/results to the
2405 system console on Pharlap ETS. To change this behavior and make the
2406 test output log to a file in the <code>log</code> directory under the
2407 current working directory while executing, add the following line to
2408 your config.h file:
2409 <pre>
2410 #define ACE_PHARLAP_TESTLOG_TO_FILE
2411 </pre>
2412 This setting has no affect on TAO tests which always write test output
2413 to stdout.
2414 </note>
2416 </p></li><li><strong>Mac OS X (10.2.x)</strong><p>
2418 </p><p>ACE builds and runs on Mac OS X 10.2.x, but the following are
2419 needed to build it:</p>
2421 <p>1. The latest version of the Apple Developer Tools
2422 (December 2002)</p>
2423 <p>2. The dlcompat library (obtained either through Fink or
2424 SourceForge)</p>
2426 <p>When creating $ACE_ROOT/ace/config.h for Mac OS X, you need
2427 to add the following if you obtained dlcompat via Fink:</p>
2429 <p>#define ACE_NEEDS_DL_UNDERSCORE</p>
2431 <p>You'll also need to do:</p>
2433 <p>setenv DYLD_LIBRARY_PATH $ACE_ROOT/ace:$ACE_ROOT/lib</p>
2434 <p>setenv MACOSX_DEPLOYMENT_TARGET 10.2</p>
2436 <p>Currently, all ACE tests pass except Process_Mutex_Test and
2437 MEM_Stream_Test. Also, Mac OS X doesn't yet support *nix
2438 aio_* calls, and ACE does not know anything about Mach.</p>
2440 <p>The work to port ACE to Mac OS X was done by several people,
2441 John Zorko
2442 &lt;<a href="mailto:j.zorko@att.net">j.zorko@att.net</a>&gt; is
2443 only one of them.</p>
2445 </p></li><li><strong>iPhone/iPod Touch/iPad</strong><p>
2447 </p><p>ACE builds and runs on the iPhone/iPod Touch/iPad Hardware
2448 and Simulator. Keep in mind that ACE/TAO needs to be built
2449 statically since Apple does not allow third party dynamic libraries
2450 to be deployed on the hardware. The following are needed to build ACE:</p>
2452 <p>1. The iPhone SDK.</p>
2453 <p>2. When creating $ACE_ROOT/ace/config.h, include
2454 config-macosx-iphone-hardware.h if you want to deploy on the
2455 hardware, include config-macosx-iphone-simulator.h if you want
2456 to deploy on the simulator. Even though those includes are named
2457 after the iPhone, the includes work for iPhone/iPod Touch, and iPad.</p>
2458 <p>3. You need to define two environment variables. The first is
2459 IPHONE_TARGET. Set IPHONE_TARGET to SIMULATOR if you want to deploy
2460 on SIMULATOR. Set IPHONE_TARGET to HARDWARE if you want to deploy on
2461 the hardware device.</p>
2462 <p>4. When creating $ACE_ROOT/include/makeinclude/platform_macros.GNU,
2463 include 'include $(ACE_ROOT)/include/makeinclude/platform_macosx_iphone.GNU'
2464 in the file.</p>
2468 </li></ul>
2471 <hr>
2472 <h2><a name="g++">Compiling ACE with GNU g++</a></h2>
2474 If you use the GNU GCC g++ compiler please note the following:
2476 <ul>
2477 </p></li><li>ACE/TAO needs g++ 4.8 or better. Older versions are not usable anymore<p>
2479 </p></li><li>Make sure to update your gcc <code>config.status</code>
2480 file. This file is produced when installing gcc; it specifies
2481 where to install the binary files that gcc uses. For example,
2482 it specifies whether to use Solaris's <code>/usr/ccs/bin</code>
2483 binary utils or GNU binary utils. The
2484 <code>config.status</code> file is an output of the gcc
2485 <code>configure</code> script; it is preferable to use the
2486 <code>--prefix</code> option to <code>configure</code> instead
2487 of hacking its output.<p>
2489 NOTE: if you do use the GNU linker, you might need to change
2490 the <code>-G</code> flag to <code>-shared</code> in
2491 the <code>SOFLAGS</code> definition in your
2492 <code>include/makeinclude/platform_macros.GNU</code>.</p><p>
2494 </p></li><li>Don't get too confused about contradictory statements in
2495 the gcc documentation. It was written by different
2496 people...<p>
2498 </p></li><li>Make sure that the linker invoked by gcc produces code
2499 that initializes static objects. Please see gcc's
2500 documentation for using <code>collect2</code>.<p>
2502 </p></li></ul>
2505 <hr><p>
2506 </p><h2><a name="minimum_build">What Do I Need to Build for TAO?</a></h2>
2507 Toshio Hori &lt;toshi@etl.go.jp&gt; provided these suggestions on building
2508 just what's needed for (a subset of) TAO:<p>
2510 I usually make:
2511 </p><pre> $ACE_ROOT/ace,
2512 $ACE_ROOT/apps/gperf,
2513 $TAO_ROOT/tao,
2514 $TAO_ROOT/TAO_IDL, and
2515 $TAO_ROOT/orbsvcs/orbsvcs
2516 </pre>
2517 and the whole make takes less than an hour on my Solaris 7 for intel,
2518 Pentium-III/550MHz, 256MB memory, 512MB swap machine. (Top secret: I
2519 renice the 'make' process to the highest priority, -20... ;-)
2521 To save time and space, I set
2522 <pre> TAO_ORBSVCS = Naming Time Trader ImplRepo
2523 </pre>
2524 in <code>$ACE_ROOT/include/makeinclude/platform_macros.GNU</code> also. See
2525 <a href="TAO/docs/configurations.html#orbsvcs">TAO's orbsvcs
2526 library customization instructions</a> for more information.<p>
2529 </p><hr><p> </p><h2><a name="resource_requirements">System Resource
2530 Requirements</a></h2> The amount of system resources required to build
2531 ACE and TAO varies greatly. The required system resources are
2532 influenced by OS and compiler platform, build options, and component
2533 configurations. As a rough guide, the typical peak memory requirement
2534 can be well over 512 MB (notably, for TAO's orbsvcs). Depending on
2535 your OS and compiler configuration, an <strong>entire</strong> build
2536 of ACE and TAO can use well over 4 GB of disk space. It's usually not
2537 necessary to build <strong>all</strong> of ACE and TAO, though.<p>
2539 Much less disk space is required for just the libraries. For example,
2540 see the <a href="docs/ACE-subsets.html#ACE%20Library%20Size%20Breakdown">ACE
2541 library subset sizes</a>.</p><p>
2543 If you run out of memory when building, you might consider trying
2544 some or all of these suggestions:</p><p>
2545 </p><ul>
2546 <li>Enable or increase virtual memory. If you're on a <a href="#Linux">Linux</a> or <a href="#LynxOS">LynxOS</a> platform,
2547 please see the appropriate sections above.<p>
2548 </p></li><li>Disable/enable optimization and/or debugging. See the
2549 <a href="#flags">Makefile Flags</a> discussion for information
2550 on how to do that via ACE's Makefiles.<p>
2551 </p></li><li>If you're using g++, try removing <code>-pipe</code> from
2552 <code>CFLAGS</code> in your
2553 <code>include/makeinclude/platform_macros.GNU</code> file.<p>
2554 </p></li><li>Restrict the components that you build. For ACE and TAO, see the
2555 discussion of <code>ACE_COMPONENTS</code> in the
2556 <a href="docs/ACE-subsets.html">ACE subsets</a> page. For TAO's
2557 orbsvcs, see the discussion of <code>TAO_ORBSVCS</code> in
2558 <a href="TAO/docs/configurations.html#orbsvcs">orbsvcs Library configuration information</a>.<p>
2560 If disk space is a problem, disabling debugging should greatly
2561 reduce object code, and therefore, library size. This is especially
2562 true with g++.</p><p>
2564 Toshio Hori &lt;toshi@etl.go.jp&gt; provided these tips for reducing
2565 disk space usage:</p><p>
2567 To save space on a Unix machine, I usually run
2568 'find . -name \*.sln -o -name \*.vcproj -o -name \*.bmak | xargs rm -f'
2569 in $ACE_ROOT at first after I untar the distribution. They are
2570 meaningless in my environment (Files named '*.sln' and '*.vcproj' are
2571 used for MSVC++ and files named '*.bmak' are for Embarcadero C++
2572 Builder.)</p><p>
2574 Finally, to save space, may want to run 'make clean' after 'make'. It
2575 removes generated object files and leaves libraries/executables
2576 intact. If you want to remove any of the libraries/executables, as
2577 well, try 'make realclean'.</p><p>
2579 </p></li></ul>
2581 <p></p><hr><p>
2582 </p><h1 name="MPC">General MPC information</a></h1>
2585 The <A HREF="
2586 http://htmlpreview.github.io/?https://github.com/DOCGroup/MPC/blob/master/docs/html/MakeProjectCreator.html">
2587 Makefile Project Creator (MPC)</A> is a tool that takes platform and
2588 building tool generic files (mpc files) as input, which describe basic
2589 information needed to generate a "project" file for various build
2590 tools, including Make, NMake, Visual C++ 6, Visual C++ 7, etc. Please
2591 see <a href="MPC/docs/USAGE">USAGE</a>, <a
2592 href="MPC/docs/README">README</a> for documentation on MPC.
2593 </p>
2596 A common usage for creating a Windows workspace containing just the
2597 core ACE and TAO libraries and executables is the following:
2598 </p>
2600 <pre><code>
2601 C:> cd %TAO_ROOT%
2602 C:> %ACE_ROOT%\bin\mwc.pl -type vs2019 TAO_ACE.mwc
2603 </pre></code>
2606 Replace vs2019 with whatever project type you want to use. On Linux and
2607 other UNIX platform use the gnuace type:
2608 </p>
2610 <pre><code>
2611 % cd $TAO_ROOT
2612 % $ACE_ROOT/bin/mwc.pl -type gnuace TAO_ACE.mwc
2613 </pre></code>
2616 This creates the appropriate GNUmakefiles. Additional information on
2617 how to obtain, configuration, and build ACE+TAO using MPC appear at
2618 the OCI <A
2619 HREF="http://www.theaceorb.com/faq/index.html#HowToBuildACEandTAOonWindows">FAQ</A>.
2620 </p>
2623 If you are attempting to generate project files using MPC, and you get
2624 the following error message:
2625 </p>
2627 <pre>ERROR: Unable to find the MPC modules in /builds/ACE_wrappers/MPC.
2628 You can set the MPC_ROOT environment variable to the location of MPC.
2629 </pre>
2632 You need to do one of the following:
2633 </p>
2635 <ol>
2636 <li>If you have already obtained MPC, either move it underneath the
2637 ACE_wrappers directory or set your MPC_ROOT environment variable to point
2638 to the full path of MPC.</li>
2639 <li>Check out MPC from the DOC Group git repository
2640 and set your MPC_ROOT environment variable.</li>
2641 </ol>
2644 You can check
2645 out MPC from the DOCGroup git repository using the following command.
2646 </p>
2648 <pre>git clone https://github.com/DOCGroup/MPC.git MPC
2649 </pre>
2652 The <A HREF="MPC/docs/README">README</A> and <A HREF="MPC/docs/USAGE">USAGE</A> files in the MPC/docs directory are an up-to-date
2653 source of documentation, however it is not a complete set of
2654 documentation. The TAO Developer's Guide from OCI starting with the
2655 1.3a version contains more information about MPC.
2656 </p>
2659 The MPC chapter from the TAO Developer's Guide is available at <a
2660 href="http://downloads.ociweb.com/MPC/">
2661 http://downloads.ociweb.com/MPC/</a>. Some of MPC has changed since
2662 this version, but it is largely accurate. An updated version will be
2663 available as newer versions of the TAO Developer's Guide are released.
2664 In the meantime, please see the README and USAGE files in the MPC
2665 directory.
2666 </p>
2669 </p><h1><a name="eclipse">Working with ACE in Eclipse</a></h1>
2673 The Eclipse CDT C++ development environment can be used to develop ACE applications. You can configure a new CDT project to build ACE using either a local source distribution or checking out ACE from CVS in Eclipse. These are the steps to create the CDT project to build ACE.
2674 </p>
2677 <h2>To create an Eclipse project for ACE starting from CVS:</h2>
2678 <ol>
2679 <li>In the "CVS Repository Exploring" perspective, navigate to the module containing ACE.</li>
2680 <li>Checkout the module using "Check Out As" and select the "project configured using the New Project Wizard" option.</li>
2681 <li>Select "Standard Make C++ Project" for the project type.</li>
2682 <li>Follow the steps outlined above, up to the point of running make, for building ACE on your platform. Use "path_to_your_eclipse_workspace"/"project_name" as your $ACE_ROOT.
2683 <li>If you had to regenerate the makefiles using MPC, select the root folder for your poject and use the import wizard to add them to your project.</li>
2684 <li>Select the root folder for the project and use the "Create Make Target" wizard to setup the appropriate make command and options.</li>
2685 <li>Select the root folder and run "Build Make Target." This will build ACE.</li>
2686 </ol>
2687 </p>
2692 <h2>To create an Eclipse project for ACE from a local source distribution:</h2>
2693 <ol>
2694 <li>Launch the "New Project Wizard" in Eclipse.</li>
2695 <li>Select "Standard Make C++ Project" for the project type.</li>
2696 <li>On the project name page, uncheck the "use default" location option and replace the default path with the path to your source distribution.</li>
2697 <li>Follow the steps, up to the point of running make, for building ACE on your platform.
2698 <li>If you had to regenerate the makefiles using MPC, select the root folder for your poject and use the import wizard to add them to your project.</li>
2699 <li>Select the root folder for the project and use the "Create Make Target" wizard to setup the appropriate make command and options.</li>
2700 <li>Select the root folder and run "Build Make Target." This will build ACE.</li>
2703 </ol>
2704 </p>
2706 </p>
2708 <hr><p>
2709 </p><h1><a name="advanced">Advanced Topics</a></h1>
2711 <ul>
2712 <li><a href="docs/ACE-porting.html">Porting ACE and TAO to a New OS Platform</a>
2713 </li><li><a href="#NonStaticObjectManager">Non-static ACE_Object_Manager</a>
2714 </li><li><a href="#cloning">Cloning the Source Tree</a>
2715 </li><li><a href="#mvs">Additional Build Tips for MVS</a>
2716 </li><li><a href="#flags">Makefile Flags</a>
2717 </li><li><a href="docs/ACE-SSL.html">ACE SSL effort</a>
2718 </li></ul>
2720 <p></p><hr align="left" width="50%"><p>
2721 </p><h2><a name="NonStaticObjectManager">Non-static
2722 ACE_Object_Manager</a></h2> The ACE_Object_Manager can be instantiated
2723 as a static object, can be instantiated on the stack of the main
2724 program thread, or can be explicitly instantiated and destroyed by the
2725 application with <code>ACE::init ()</code> and <code>ACE::fini
2726 ()</code>. The comments in the header file,
2727 <a href="ace/Object_Manager.h"><code>ace/Object_Manager.h</code></a>, as well as Section 1.6.3 in
2728 <a href="http://www.riverace.com/docs">The ACE Programmer's Guide</a>
2729 provide more detail.<p>
2731 <strong><blink><font color="#ff0000">NOTE:</font></blink></strong>
2732 Special requirements are imposed on applications if the
2733 ACE_Object_Manager is instantiated, by ACE, on the stack of the main
2734 thread. This behavior is selected by defining
2735 <code>ACE_HAS_NONSTATIC_OBJECT_MANAGER</code> in
2736 <code>ace/config.h</code>. Again, see the ACE Object_Manager header file,
2737 <a href="ace/Object_Manager.h"><code>ace/Object_Manager.h</code></a> for more information. One of
2738 these requirements is discussed here, because it is so important.
2739 Please note that <code>ACE_HAS_NONSTATIC_OBJECT_MANAGER</code> is
2740 defined in the distributed ACE <code>config.h</code> headers for
2741 VxWorks and Win32.</p><p>
2743 The important requirement is that the program <strong>must</strong>
2744 declare its <code>main</code> function with two arguments, even if
2745 they're not used, and with <code>int</code> return type:
2747 </p><pre><code>
2749 main (int, char *[])
2750 </code></pre>
2752 If you don't declare <code>main</code> <strong>exactly</strong> that
2753 way, then you'll see a link error about <code>ace_main_i</code> being
2754 undefined.<p>
2756 Alternatively, this feature can be disabled by commenting out the
2757 #define ACE_HAS_NONSTATIC_OBJECT_MANAGER in the
2758 <code>ace/config.h</code>. But, that will make repeated testing more
2759 difficult on VxWorks. And, you'd either have to call static
2760 constructors and destructors manually or unload/load the program
2761 between runs. On Win32, disabling the feature can possibly lead to
2762 shutdown difficulties.</p><p>
2764 <strong><blink><font color="#ff0000">WARNING:</font></blink></strong>
2765 <code>ACE_HAS_NONSTATIC_OBJECT_MANAGER</code> assumes that your
2766 <code>main</code> function is named <code>main</code>. Any violation
2767 of this assumption is at your peril. If you really need to call your
2768 entry point something other than <code>main</code>, you'll need to
2769 construct and destroy the ACE_Object_Manager. The best way to do that
2770 is to call <code>ACE::init ()</code> and <code>ACE::fini ()</code>.
2771 Or, see the <code>#define</code> of <code>main (int, char *[])</code>
2772 in <a href="ace/OS_main.h"><code>ace/OS_main.h</code></a> to see how ACE does
2773 that for entry points named <code>main</code>.
2775 </p><p></p><hr align="left" width="50%"><p>
2776 </p><h2><a name="cloning">Cloning the Source Tree</a></h2>
2778 On UNIX platforms, we typically like to support multiple platform
2779 builds using the same ACE source tree. This idiom is supported by ACE
2780 using the $ACE_ROOT/bin/create_ace_build.pl script.
2782 To clone the source tree, create ./build and ./build/{your build name}
2783 subdirectories under the ACE_wrappers directory.
2784 Then invoke the create_ace_build.pl script to clone the source tree using
2785 soft links from your build directory back to the actual sources.
2786 Here is an example:</p><p>
2788 </p><pre>% cd ACE_wrappers
2789 % mkdir build build/build-SunOS5
2790 % perl bin/create_ace_build.pl -a -v build-SunOS5
2791 % cd build/build-SunOS5
2792 % setenv ACE_ROOT $cwd
2793 % make
2794 </pre><p>
2796 This will establish a complete tree of links. In addition, make sure
2797 you set your <code>LD_LIBRARY_PATH</code> to
2798 <code>$ACE_ROOT/lib:$LD_LIBRARY_PATH</code> on SVR4 UNIX
2799 platforms.</p><p>
2801 When you do a make in the $ACE_ROOT directory you will be producing
2802 object code that is not stored in the same place as the original
2803 source tree. This way, you can easily build another platform in a
2804 parallel tree structure.</p><p>
2806 See the comments at the top of the create_ace_build.pl script for
2807 further usage information.
2809 </p><p></p><hr align="left" width="50%"><p>
2810 </p><h2><a name="mvs">Additional Build Tips for MVS</a></h2>
2812 For all intents and purpose, MVS OpenEdition (OE) is another flavor of
2813 UNIX, therefore, the instructions under <a href="#aceinstall">Building
2814 and Installing ACE on Unix</a> can be used along with the following
2815 additional tips:<p>
2817 You can get a copy of GNU make that has been ported to MVS OpenEdition from
2818 the <a href="http://www.s390.ibm.com/products/oe/index.html">IBM OpenEdition web site</a>.
2819 ACE's make scheme generates compile commands that have options and
2820 operands interspersed. By default, the c89/cc/c++ compiler expects all options to
2821 precede all operands. To get around this, you must set a special
2822 compiler environment variable (_CXX_CCMODE) to 1 which tells the compiler
2823 to allow options and operands to be interspersed.</p><p>
2825 Note that the environment variable <code>LD_LIBRARY_PATH</code> is
2826 called <code>LIBPATH</code> on MVS.</p><p>
2828 Shared objects are built a little different on MVS than on
2829 other UNIX implementations. This has been accounted for in the makefiles
2830 that come with ACE When the linker (via the cxx command) builds the
2831 libACE.so file it will also create a file called libACE.x. This is a
2832 side-deck file and it must be included in subsequent link edits with
2833 application code. For more information on this see the C/C++ MVS
2834 Programming Guide. If you want to build your application statically,
2835 i.e., using libACE.a instead of libACE.so, you can set ACELIB to
2836 ACELIB_STATIC in platform_mvs.GNU.</p><p>
2838 When the libACE.so file is built (via the MVS pre-linker and binder), you
2839 will get a rc=4 from the pre-linker. This is ok. This is due to some
2840 warnings about unresolved references which should get resolved during the
2841 link step. Note, however, there shouldn't be any unresolved references
2842 from the binder (linkage editor). You can get pre-link and link maps by
2843 uncommenting the PMAP and LMAP lines in the platform_mvs.GNU file.
2845 </p><p></p><hr align="left" width="50%"><p>
2846 </p><h2><a name="flags">Makefile Flags</a></h2>
2848 GNU make provides many options to customize its operation. See its
2849 documentation for more information. One example is that for multi-cpu
2850 UNIX machines you will be able to build faster if you use:<p>
2852 </p><pre><code>
2853 % make -j <em>n</em>
2854 </code></pre><p>
2856 which allows parallel compilation. The number <i>n</i> should
2857 typically be the number of CPUs. It is likely that builds will be
2858 faster even on single-CPU UNIX machines with <code>make -j
2859 2</code>.</p><p>
2861 ACE further supports the following flags. They can be enabled either
2862 on the command line, e.g., "make purify=1", or added to your
2863 <code>platform_macros.GNU</code>. To disable the option,
2864 set the flag to null,
2865 e.g., "make debug=". Some flags support setting to 0 disable, e.g.,
2866 "make debug=0". debug=1 is enabled in the platform files that are
2867 released with ACE.</p><p>
2869 Please note that the effects of a flag may be platform specific.
2870 Also, combinations of certain flags may or may not be allowed on
2871 specific platforms, e.g., debug=1 opt=1 is supported by g++ but
2872 not all other C++ compilers.</p><p>
2874 If you use Purify or Quantify: purify or quantify <strong>must</strong>
2875 be on your <code>PATH</code>. By default, ACE puts the Purify/Quantify
2876 caches below <code>/tmp</code>. To override that, set the
2877 <code>PURE_CACHE_BASE_DIR</code> variable, either in your environment
2878 or on the <code>make</code> make command line, to the destination
2879 directory for your instrumented libraries.</p><p>
2881 </p><pre>Flag Description
2882 ---- -----------
2883 debug Enable debugging; see DCFLAGS and DCCFLAGS.
2884 exceptions Enable exception handling (not supported by all platforms).
2885 include_env Support old-style ACE_TRY_ENV declarations in methods.
2886 This switch is necessary for compiling TAO applications
2887 in the native exception configuration that were written
2888 for TAO versions before 1.2.2.
2889 In TAO 1.2.2, new macros were introduced that supercede
2890 the direct ACE_TRY_ENV declarations. These are the
2891 ACE_ENV_ARG macros that are defined in ace/CORBA_macros.h
2892 and are documented in docs/exceptions.html.
2893 This switch only affects the exceptions=1 configuration.
2894 It is for backward compatibility only.
2895 There will be warnings about unused _ACE_environment_variable
2896 parameters when using include_env=1.
2897 If possible, do not use it, but instead change your TAO
2898 applications to use the ACE_ENV_ARG macros.
2899 inline Enable ACE inlining. Some platforms enable inlining by
2900 default, others do not.
2901 optimize Enable optimization; see OCFLAGS and OCCFLAGS.
2902 pace Enable PACE as the underpinnings of ACE_OS.
2903 probe Enable ACE_Timeprobes.
2904 profile Enable profiling; see PCFLAGS and PCCFLAGS.
2905 purify Purify all executables.
2906 quantify Quantify all executables.
2907 repo Use GNU template repository (g++ with repo patches only).
2908 rtti Enable run-time type identification. On some platforms,
2909 it is enabled by default, so this is ignored.
2910 shared_libs If migrating from prior version use <code>shared_libs_only</code>
2911 static_libs If migrating from prior version use <code>static_libs_only</code>
2912 shared_libs_only Only build shared libraries. Ignored if no SHLIBs are
2913 specified by the Makefile, as in performance-tests/Misc.
2914 static_libs_only Only build static libraries.
2915 threads Build with thread support.
2916 xt Build with Xt (X11 Toolkit) support.
2917 fl Build with FlTk (Fast Light Toolkit) support.
2918 tk Build with Tk (Tcl/Tk) support.
2919 qt Build with Qt (Trolltech Qt) support.
2920 ssl Build with OpenSSL support.
2921 rapi Build with RAPI
2922 split Build the library by first splitting up the ACE source
2923 to several files, with one object code entity for each
2924 source file. This allows an application that is linked
2925 with ACE to extract _exactly_ what it needs from the
2926 library, resulting in a smaller executable. Setting this
2927 to 1 overrides debug to 0.
2929 Usually, users do not need to be concerned with make targets.
2930 Just enter "make" on the command line to build. A few notable
2931 targets are listed below.
2933 Target Description
2934 ------ -----------
2935 show_statics Lists all static objects in object files built for
2936 current directory. Only supported for g++.
2937 show_uninit Lists all uninitialized in object files built for
2938 current directory. Only supported for g++.
2940 </pre>
2942 </p><hr>
2944 <h2><a name="power">Building from git</a></h2>
2946 If users are building from our <a href="https://github.com/DOCGroup/ACE_TAO">Git repository</a> the
2947 GNUmakefiles, and project files for building on various platforms will
2948 not be available. Git users are expected to <a href="#generate_using_mpc">generate them</a>
2949 using <a href="https://raw.githubusercontent.com/DOCGroup/MPC/master/docs/README">MPC</a> before building ACE or TAO.
2950 We point out some suggestions below to get bootstrapped
2951 quickly.
2953 <ul>
2954 <li>You can clone all code easily from our git repository.
2955 <ul>
2956 <code>git clone https://github.com/DOCGroup/ACE_TAO.git</code>
2957 </ul>
2958 </p></li><li>Please make sure that you have <a href="http://www.perl.org/">
2959 perl</a> installed, preferably perl
2960 5.8 or higher. Users on Win32 based platforms are recommended to use
2961 <a href="https://www.activestate.com/products/perl"> Active
2962 State Perl</a> or <a href="http://strawberryperl.com">Strawberry Perl</a>.
2963 We use both perl versions without problems. We have
2964 ran into problems trying to use the cygwin version of perl on Win32
2965 based platforms. <p>
2966 </p></li>
2967 <a name="generate_using_mpc"></a>
2968 <li>To build ACE and associated tests, examples,
2969 and associated utility libraries with GNUmakefiles, you must
2970 generate GNUmakefiles with MPC:<p>
2971 <code> $ACE_ROOT/bin/mwc.pl -type gnuace ACE.mwc</code> </p>
2972 <p>On Windows, with Visual Studio 2015, you must generate solution and project files with MPC:<p>
2974 <code> $ACE_ROOT/bin/mwc.pl -type vc14 ACE.mwc </code> </p><p>
2976 On Windows, with Visual Studio 2017, you must generate solution and project files with MPC:<p>
2977 <code> $ACE_ROOT/bin/mwc.pl -type vs2017 ACE.mwc </code> </p>
2979 On Windows, with Visual Studio 2019, you must generate solution and project files with MPC:<p>
2980 <code> $ACE_ROOT/bin/mwc.pl -type vs2019 ACE.mwc </code> </p>
2981 </li><li>If you want to build TAO and its associated libraries
2982 please see <a href="TAO/TAO-INSTALL.html">TAO-INSTALL</a> for details.
2983 </li></ul>
2985 <hr><p>
2986 Back to the <a href="https://www.dre.vanderbilt.edu/~schmidt/ACE.html">ACE</a>
2987 home page.
2988 </p><p>
2989 <!--<EM>
2990 Visitor #
2991 from
2992 <EM><br> -->
2994 <!-- hhmts start -->
2996 <!-- hhmts end -->
2999 </p></body></html>