summaryrefslogtreecommitdiff
path: root/ACE-INSTALL.html
blob: bdaff25fe112c45df4a676bf0bb66e8b24ffde68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
<HTML>
<!-- $Id$ -->

<HEAD>
  <TITLE>Building and Installing ACE and Its Network Services</TITLE>
  <link rev=made href="mailto:schmidt@cs.wustl.edu">
</HEAD>

<BODY text = "#000000"
link="#000fff"
vlink="#ff0f0f"
bgcolor="#ffffff">

<HR>
<H3>Building and Installing ACE and Its Network Services</H3>

<H4>Synopsis</H4>

The file explains how to build and install ACE and its Network
Services on the various OS platforms and compilers that it has been
ported to.  Please consult the <A HREF="ChangeLog">ChangeLog</A> file
to see whether any recent changes to the release will affect your
code.  In addition, you might want to read the ACE <A
HREF="ACE.FAQ.html">FAQ</A> before building and installing ACE.

<H4>Document Index</H4>

<UL>
<LI><A HREF="#platforms">Supported Platforms and Compilers</A>
<LI><A HREF="#aceinstall">Building and Installing ACE</A>
<LI><A HREF="#svcsinstall">Building and Installing ACE Network Services</A>
<LI><A HREF="#advanced">Advanced Topics</A>
</UL>

<P><HR><P>
<H3><A NAME="platforms">Supported Platforms and Compilers</A></H3>

The ADAPTIVE Communication Environment has been ported and tested
extensively on a wide range of C++ compilers and uni-processor and
multi-processor OS platforms including Win32 (i.e., WinNT and Win95),
most versions of UNIX (e.g., SunOS 4.x and 5.x, SGI IRIX, DG/UX,
HP-UX, OSF/1, AIX, Linux, and SCO), <A
HREF="http://www.wrs.com">VxWorks</A>, and MVS OpenEdition.  If you
have a problem compiling the ACE wrappers on the platforms shown below
please send email to the <A HREF="mailto:ace-users@cs.wustl.edu">ACE
mailing list</A> and we'll try to fix it for you.

<DL>
<DT> <B>Win32 (Windows NT and Windows '95) </B><P>

<DD> All of ACE has been ported to the Win32 API (which includes
	  Windows NT and Windows '95).  The entire release now
	  compiles using the Microsoft Visual C++ 4.0 compiler (the
	  2.0 compiler should also work, but I haven't tested it
	  recently).  ACE can be built as both a static and dynamic
	  library, using the Win32 installation process described
	  below. <P>

<DT> <B> Sun OS 5.x/4.x (a.k.a. Solaris 2.x/1.x) using Sun CC 3.0.1, Sun
     C++ 4.0.x, Centerline C++ 2.x, and GNU gcc 2.7.x. </B> <P> 

<DD> All the source code and tests should build and run without
	  any problems on the Solaris and SunOS platforms using the 
	  Sun C++ compilers. <P>

<DT> <B> Sun OS 4.1.x using Centerline C++ 2.x, Sun CC 3.x, and Lucid
  Energize 3.2. </B> <P>

<DD> Note that shared libraries do not interact very well with
	  Centerline C++ or Sun C++ on SunOS 4.1.x.  This is due to
	  odd behavior of the SunOS 4.1.x linker, which (1) does not
	  properly call constructors of global objects within shared
	  libraries and (2) does not call the init() and fini()
	  functions in shared libraries, even though the manual claims
	  that these functions are called!  In particular, this means
	  that the tests in the directory
	  $(ACE_ROOT)/tests/Service_Configurator/IPC-tests/server/
	  will not work for statically linked services... <P>

	  Some versions of SunOS 4.1.x do not contain the
	  /usr/lib/libnsl.a library.  This library seems to be
	  optional since System V Transport Layer Interface (TLI)
	  support is optional on SunOS 4.1.x (in contrast, it's the
	  "preferred" transport interface on Solaris). <P>

	  The best work-around for now is probably to either add a
	  dummy libnsl.a in /lib (which may not be feasible) or simply
	  comment out the line: <P>

	  LIBS += -lnsl <P>

	  in the <CODE>$ACE_ROOT/include/makeinclude/wrapper_macros.GNU</CODE>
	  file.  Naturally, any programs (e.g., the TLI_SAP tests)
	  that use the TLI wrappers aren't going to work! <P>

	  Note that on SunOS 4.x you may get warnings from the linker
	  that "archive has no table of contents; add one using
	  ranlib(1)" for certain libraries (e.g., libASX.a,
	  libThreads.a, and libSPIPE.a).  This occurs since SunOS 4.x
	  does not support these features. <P>

<DT> <B> AIX </B> <P>

<DD> The ACE port to AIX assumes that the user has installed the
	  AIX patch containing the dl*() APIs.  To use these APIs, IBM
	  has created a separate product (free to AIX licensees)
	  called shared library hookable symbols (or slhs/6000).  If
	  you don't have this patch, the sv* commands for compiling
	  and linking will not be present on the system. <P>

	  BTW, here's a technique from Rob Jordan &lt<A
     HREF="mailto:jordan@hursley.ibm.com">jordan@hursley.ibm.com</A>&gt  
     that can reduce the size of the ACE libraries by
	  about one third, and can also be applied to applications.  It works
	  by optimising the sharing of template functions, which are created in an
	  ``unusual'' way under AIX. It also speeds up compilation. <P>

	  Here's how to optimise the ACE library generation: <P>

	  Look at the <A
HREF="http://www.cs.wustl.edu/~schmidt/ACE_wrappers/ace/Makefile">Makefile</a>
	  in <CODE>$ACE_ROOT/ace</CODE>. Create a file called
	  <CODE>ACE_All_Src.cpp</CODE>, and add a line to #include
	  each of the source files
	  listed under <CODE>FILES=</CODE> in the Makefile. Create a
	  file called <CODE>ACE_All_Tmp.h</CODE>
	  and add a line to #include each of the .h files listed under
	  <CODE>TEMPLATE_FILES=</CODE> in the Makefile. Now update the Makefile so that
	  <CODE>FILES=ACE_All_Src</CODE> and <CODE>TEMPLATE_FILES=ACE_All_Tmp</CODE>. <P>

<DT> <B> Linux and SCO 4.2 </B> <P>

<DD> ACE has been ported to <A
HREF="http://www.cs.wustl.edu/~cleeland/ace/">Linux</A> and SCO UNIX
using the GNU G++
     2.7.2 compiler. <P>

<DT> <B> SGI IRIX 5.x </B> <P>

<DD> ACE builds fine using the SGI C++ and GNU GCC compilers for
	  IRIX 5.x.  I haven't tried this on IRIX 6.x, but I assume 
	  that will work too.  If anyone can get ACE working with 
	  IRIX 6.x pthreads please let me know.<P>

<DT> <B> HP-UX 9.x and 10.x </B> <P>

<DD> The current HP/UX C++ compiler is incredibly lame and has
	  problems compiling ACE templates and achieving template
	  closure.  I've heard that the next release is better...
	  In the meantime, you might try using GNU GCC or SunC++
	  on HP/UX. <P>

<DT> <B> OSF/1 3.2 and 4.0 (a.k.a. Digital UNIX 4.0a) </B> <P>

<DD> The current OSF/1 C++ 5.4 compiler still seems to have problems
with ACE's templates. It compiles the lib and test programs, although
giving warnings about template usage.  Most tests run, some dump core.
Hopefully newer compiler releases will alleviate these problems.  <P>
 
GNU gcc 2.7.2.1 compiles without problems. All tests run (besides
minor problems).  Thanks to Thilo Kielmann &lt<A
HREF="mailto:kielmann@informatik.uni-siegen.de">
kielmann@informatik.uni-siegen.de</A>&gt and David Trumble &lt<A
HREF="mailto:trumble@cvg.enet.dec.com">trumble@cvg.enet.dec.com</A>&gt
for help with this port. <P>

<DT><B> UnixWare 2.01 </B> <P>
<DD>
     Steve Huston &lt<A HREF="mailto:shuston@riverace.com">shuston@riverace.com</A>&gt
	has ported ACE to work with UnixWare 2.01 and
	  its standard C++ compiler.

<DT><STRONG>VxWorks</STRONG> <P>
<DD>
     <A HREF="http://www.cs.wustl.edu/~levine/">David Levine</A> &lt<A
HREF="mailto:levine@cs.wustl.edu">levine@cs.wustl.edu</A>&gt has
ported ACE to VxWorks 5.2/5.3/5.3.1 with the GreenHills 1.8.8
and g++ 2.7.2 compilers.<P>

In addition to all of the other benefits of ACE, it helps
work around some deficiencies with VxWorks 5.3/5.3.1.
These apply only with g++, at least thru version 2.7.2.
That is the version that is shipped with Tornado 1.0.1/
VxWorks 5.3.1.  The problems are:<P>

<OL>
  <LI> There a gory problem with munch that is severely aggravated
       by the presence of a static in the Wind River/g++ iostream.h.
       ACE hides this and provides an easy-to-use workaround in the
       very unlikely situation where it becomes a problem.
       Please see ace/config-vxworks5.2-g++.h for more information.<P>

  <LI> Unsigned long long support is not available with the g++ that
       is distributed with Tornado 1.0.1/VxWorks 5.3.1.  The
       documentation says that it is supported, but try using it :-)
       Wind River technical support will verify this.  ACE provides
       its own 64-bit unsigned integer type, ACE_hrtime_t, so you
       don't even have to worry about this problem if you use it.<P>

  <LI> The program entry point cannot be called ``main''.  ACE
       renames it to ``ace_main'' on VxWorks.  While this may seem
       trivial, it is important with legacy code.  ACE itself ran
       into this problem.<P>
</OL>

In addition, as noted <A HREF="#g++">below</A> following the
discussion of the g++ -fno-implicit-templates option,
-fno-implicit-templates is broken.  And, -O2 is not supported on some
targets.<P>

The current version of ACE, 4.3, has limited support for destroying
static objects after program termination on VxWorks.  To destroy
static objects, the module must be unloaded, using unld.  Static
constructors are called when loading the module, with ld.<P>

<DT><B>MVS OpenEdition</B> <P>

<DD>
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.
The ACE library, all the tests and most of the examples and apps build
clean.  There are still some problems that need to be ironed out: <P>

   MVS does not support the dynamic linking dl...() calls that the Service
   Configurator uses to dynmically link services at run time. As a result, all
   the examples and apps that use a svc.conf file (for dynamically configuring
   service objects) do not work, however, most of these apps can be built/run
   statically.  Also, the Svc_Conf_l.cpp and Svc_Conf_y.cpp files are generated
   using flex and yacc on a ascii (not ebcdic) machine and as a result they don't
   work very well with ebcdic svc.conf files.  We should be able to regenerate 
   these files on MVS but MVS doesn't have flex.  This is something that needs
   to be done. <P>

   Some of the tests do not execute properly.  This is a minority and over time
   the goal is to get to 100%. <P>

   The make scheme for some of the apps still doesn't work perfectly on MVS. 
   This is mainly due to the way shared libraries are handled on MVS.  See
   <A HREF="#mvs">additional build tips for MVS</A> for more on
   this. <P>
</DL>

<HR>
<H4><A NAME="g++">Compiling ACE with GNU C++</A></H4>

If you use the GNU GCC C++ compiler please note the following: <P>
	
<UL>
 	<LI> Earlier versions of G++ may not compile certain
	  parts of ACE correctly due to compiler bugs.  Please
	  upgrade to G++ 2.7.2 or greater. <P>

	<LI> Make sure to update your gcc "config.status" file -
	  this specifies whether your gcc install uses, for
	  example, Solaris's "/usr/ccs/bin" binary utils or
	  GNU binary utils. <P>

        <LI> Make sure that the linker invoked by GCC produces code 
	  that initializes static objects.  Please see GCC's 
	  documentation for using <CODE>collect2</CODE>.<P>

	<LI> By default, gcc (thru version 2.7.2, at least) uses
	  implicit template instantiation.  Besides wasting space,
	  this breaks the use of ACE_Singleton:  instead of one
	  singleton instance, there could be one instance per object
	  (.o) file that "sees" the template.  Therefore, we have
	  overridden this default in ACE by enabling the
	  -fno-implicit-templates option to CCFLAGS in all
	  include/makeinclude/platform_*.GNU files that set CXX to g++.<P>

	<LI> The disadvantage of this approach is that you must
	  add template specializations for all templates that your
	  application uses to your own code.  (The ACE libraries are
	  self-contained:  you don't need to add the templates that
	  they use internally.)  Examples of template specializations
	  occur in quite a few ACE .cpp files; see
	  apps/Gateway/Gateway/Proxy_Handler.cpp for one example.
	  An easy way to figure out what template instantiations are
	  need is to try to build your executable and pipe the output
	  through c++filt.  The linker will report the missing
	  instantiations as undefined symbols.  Iteration may be
	  necessary, if the template instantiations themselves reference
	  other templates.<P>

	<LI> Alternatively, you could apply the Cygnus template repository
	  patches and use the -repo option instead of
	  -fno-implicit-templates.  Please see the g++ FAQ and gcc
	  manual for more information.  The g++ FAQ indicates that
	  a new implementation of templates planned for version 2.8
	  will eliminate the restriction against static data members
	  in template classes, which would allow ready implementation
	  of a correct ACE_Singleton.  A final alternative is to
	  remove the -fno-implicit-templates option from the CCFLAGS
	  macro in your include/makeinclude/platform_macros.GNU, and
	  thereby use the default g++ implicit template instantiation.<P>

	<LI> Thanks to Thilo Kielmann &lt;kielmann@informatik.uni-siegen.de&gt;
	  for reporting the problem with ACE_Singleton on g++, and
	  for helping to find and implement these solutions.<P>

	<LI> On VxWorks only, g++ (thru version 2.7.2, at least, distributed
	  with Tornado 1.0.1/VxWorks 5.3.1), -fno-implicit-templates is
	  broken.  In addition, -O2 is not supported on some targets.<P>

</UL>

<P><HR><P>

<H3><A NAME="aceinstall">Building and Installing ACE</A></H3>

The following explains how to build the ACE on <A
HREF="#unixsvcs">UNIX</A> and <A HREF="#win32svcs">Win32</A>.

<H4><A NAME="unix">Building and Installing ACE on UNIX</A></H4>

Building and installing ACE on UNIX is relatively simple (the <A
HREF="#win32">process</A> for Win32 is different).  Here's what you
need to do: <P>

<OL>
<LI> Install GNU make 3.7 or greater on your system (available via
   anonymous ftp from prep.ai.mit.edu in the pub/gnu directory). <P>

<LI> Add an environment variable called ACE_ROOT that contains the
   name of the root of the directory where you keep the ACE wrapper
   source tree.  The ACE recursive Makefile scheme needs this information. 
   There are several ways to set the ACE_ROOT variable.  For
     instance, in my .login file I have the following entry: <P>

<pre><code>
% setenv ACE_ROOT /home/cs/faculty/schmidt/ACE_wrappers <P>
</code></pre>

However, if you're building a number of versions of ACE (e.g., for
different OS platforms or for different releases of ACE) you might use
the following approach:

<pre><code>
% setenv ACE_ROOT $cwd 
</code></pre>

<LI> Edit the $ACE_ROOT/ace/OS.h file to update things like default
   hostname and port numbers you'd like the programs in the
   $ACE_ROOT/{apps,tests} directories to use by default. <P>
 
<LI> Set the $ACE_ROOT/ace/config.h file to point to the appropriate
   platform/compiler-specific header configurations (such as
   config-sunos5-sunc++-4.x.h).  This file contains the #defines that
   are used throughout ACE to indicate which features your system
   supports (see the $ACE_ROOT/ace/OS.h file for many
   examples of how the ACE build configuration is affected by these
   macro settings). <P>

   There are config files for most versions of UNIX.  If there isn't a
   version of this file that matches your platform/compiler, you'll
   need to make one.  Please send me email if you get it working so I
   can add it to the master ACE release. <P>

<LI> Set the $ACE_ROOT/include/makeinclude/platform_macros.GNU file
   to point to the appropriate platform/compiler-specific Makefile
   configurations (e.g., platform_sunos5_sunc++.GNU).  This file
   contains the compiler and Makefile directives that are
   platform/compiler-specific <P>

<LI> Note that since ACE builds shared libraries, you'll need to set
   LD_LIBRARY_PATH to whereever you put the binary version of the
   ACE library.  For example, you probably want to do something like
   the following <P>

<pre><code>
% setenv LD_LIBRARY_PATH $ACE_ROOT/ace:$LD_LIBRARY_PATH <P>
</code></pre>

<LI> When all this is done, hopefully all you'll need to do is type:<P>

<pre><code>
% make <P>
</code></pre>

   at the root of the ACE source tree.  This will build the static and
   shared object libraries and build the tests and the sample
   applications. <P>
</OL>

<P><HR><P>
<H4><A NAME="win32">Building and Installing ACE on Win32</A></H4>

The installation process for NT is a bit different than UNIX.  We
assume you're using MSVC++ 4.x (things are a little different for the
2.0 version...). <P>

<UL>
<LI> <B>SET UP THE ACE FILES</B>. <P>

   Create a directory accessible via Windows NT (e.g., C:\ACE) and
   copy all of ACE into it.  This directory will be $ACE_ROOT in
   the following discussion.  Then copy either config-win32-msvc4.0.h
   or config-win32-msvc2.0.h (depending on your compiler of course) to
   config.h.  Note that files like ChangeLog may do strange things on
   NT since they are symbolic links (which aren't supported under NT). <P>

   The easiest thing to do is just use the default ace.mpd and ace.mak
   files distributed with the release.  Open workspace ace.mpd to
   build ACE as a DLL.  This included project assumes that you have
   set the "global" include path to include $ACE_ROOT.  This can
   be done via the following MSDEV menu item: <P>

   Tools/Options/Directories/Show_Directories_For:Include_Files. <P>

   If you choose not to use the given project, then the following
   bullets explain how to build ACE with MSDEV. <P>
   
<OL>
<LI> CREATE A PROJECT WORKSPACE. <P>

   Start by making a new project.  It should be rooted at
   $ACE_ROOT.  We normally browse to $ACE_ROOT, and select
   "ace" as the project name.  This will cause MSDEV to use the
   $ACE_ROOT/ace directory to store the project files.  The actual
   directory and project name are unimportant, but we'll assume you
   named the project "ace."  Select the dynamic link library option
   and say "ok."  By default, the config-win32*.h files are set up to
   build DLLs.  If you choose to build ACE as a static library you'll
   need to unset ACE_HAS_DLL in the config-win32*.h file and select
   the static link library option when creating a project workspace.<P>

<LI> INSERT FILES INTO PROJECT.  <P>

   Go into the Insert menu and select "Files into project".  If you're
   building a static library, select all the *.cpp files in
   $ACE_ROOT/ace into the project.  If you're building a dll, you
   need to omit the files in ACE which contain template class
   definitions.  You can find out which files this is by looking at
   the TEMPLATE_FILES target in the $ACE_ROOT/ace/Makefile.<P>
   
   Once you've selected the files and pressed "ok" it should take a
   few seconds or so to for MSDEV to create the project.  (Note that
   in MSVC2.0 there isn't an Insert menu, so go into the Project Menu
   and then "Files" and from there insert all the *.cpp files.)  When
   including the files on windows 95, it may ask you to select fewer
   files than *.cpp.  Just do A-M and N-Z or something similar. <P>

<LI> SET THE INCLUDE PATH. <P>

   Go into Options section of the Tools menu.  Add the $ACE_ROOT
   directory to the default directory search path.  This is necessary
   since all ACE #include files refer to themselves via ace/Foo.h.
   Then add $ACE_ROOT\ace to the default library search path.
   This means that you can now use relative paths for linking apps
   with ace.lib.  You may skip this step if you have set
   Tools/Options/Directories/Include_Files to include
   $ACE_ROOT. <P>

   If you are going to compile ACE with UNICODE on, please add UNICODE
   to the pre-processor definitions through: <P>

   Build -&gt; Settings -&gt; C/C++ -&gt; Preprocessor -&gt; Preprocessor
   definitions<P>

<LI> SET UP THE LINKER.<P>

   You might want to link with the wsock32.lib into the ACE project,
   as well, so that you don't have to include it with every
   applications link setup.  Do this by including wsock32.lib in the
   project through Insert/Files_into_project. <P>

   When building a DLL we must ensure that both dll and exe are using
   the same libraries In order to allow standard C library functions
   to share common variables (particular <CODE>errno</CODE>) across dll
   and exe boundaries.  Go to
   Build/Settings/C++/Category:Code_Generation.  Set Use run-time
   library to "Multithreaded DLL" or "Debug Multithreaded DLL"
   depending on whether you're building a release or a debug version
   respectively.<P>

   When building a static lib: Go to
   Build/Settings/C++/Category:Code_Generation and set run-time
   library to "Debug Multithreaded" (or just "Multithreaded"). <P>

<LI> BUILD. <P>

   Go to the Build menu and select "Build ace.{lib,dll}".  The first
   time this happens it will rebuild all the dependencies.  This may
   take a while (i.e., 3 to 15 minutes, depending on whether you use
   Samba, PC-NFS, native NTFS, etc.).  Eventually, this process
   will stop and from you won't have to rebuild the dependencies then
   on (thank God...).<P>
   
   At this point, the compiler should be happily chugging away on the
   ACE files. <P>

<LI> USING ace.lib. <P>

When it's done, you should have a static or dynamic library
   called ace.lib.  You can use this to link with test applications
   (such as those in the $ACE_ROOT/examples directory).  This
   process is described below.<P>
</OL>

<LI> <B>MAKING TEST APPLICATIONS FOR WIN32</B> <P>

<OL>
<LI> CREATE THE PROJECT. <P>

   As before, make a new project for each application.  We've been
   using Console Applications.  Insert the appropriate .cpp files into
   the project. <P>

<LI> SET THE INCLUDE PATH.<P>

   In Build/Settings/C++/Category:Preprocessor, add $ACE_ROOT to
   "Additional include directories". If you've set the
   Tools/Options/Directories/Include_Files to include $ACE_ROOT,
   then you don't need to do this.<P>

<LI> MODIFY SETTINGS. <P>

   To enable MSVC++ to handle both SEH and destructors together in the
   same code, we need to remove the /GX flag. Go to
   Build/Settings/C++/Category:C++ Language. By default, the flag
   "Enable Exception Handling" should be checked. Click on it to mark
   it unchecked. The flag /GX will disappear from Project_Options. <P>

<LI> SET UP THE LINKER. <P>

   You'll also need to tell MSVC++ what libraries to link with.  In
   Build/Settings/Link, add "$ACE_ROOT/ace/Debug/ace.lib" to the
   Object/library modules.  If you've set
   Tools/Options/Directories/Library_Files to include
   $ACE_ROOT/ace, you can just add "ace.lib" to the Object/library
   modules instead of the complete path. <P>

   When using ACE as a DLL: Go to
   Build/Settings/C++/Category:Code_Generation.  Set Use run-time
   library to "Multithreaded DLL" or "Debug Multithreaded DLL"
   depending on whether you're building a release or a debug version
   respectively.<P>

   When using ACE as a static lib: Go to
   Build/Settings/C++/Category:Code_Generation and set the run-time
   library to "Debug Multithreaded" (or just "Multithreaded"). <P>

   If you're using WinSock, you will also need to add wsock32.lib to
   this line if you haven't inserted into the ACE project already.<P>

<LI> BUILD.

   You should now be able to build the .exe. <P>
</OL>

<LI> <B> BUILDING ACE ON A WIN32 MACHINE THAT LACKS A NETWORK CARD </B><P>

You may want to run ACE on a non-networked machine. To do so, you must
install TCP/IP and configure it to ignore the absence of a network
card.  This is one method: <P>

<OL>
        <LI>  Run Control Panel
        <LI>  Choose Network from Control Panel
        <LI>  Add Adapter: MS Loopback Adapter
        <LI>  Configure MS Loopback Adapter with 802.3 (default)
        <LI>  Add Software: TCP/IP Protocol
        <LI>  Configure TCP/IP Protocol with a valid IP address and subnet mask.
            Leave everything else at the default settings.
        <LI>  Add Software: Workstation
        <LI>  Exit and Restart System
        <LI>  Run Control Panel again
        <LI> Choose Services from Control Panel
        <LI> The following services are not necessary and may
            be set to Disabled Startup: <BR>
                Alerter<BR>
                Computer Browser<BR>
                Net logon<BR>
                Messanger<BR>
        <LI> Choose Network from Control Panel
        <LI> Confirm the following setup. This is all you need to run ACE:<BR>
                Installed Software:<BR>
                Computer Browser<BR>
                MS Loopback Adapter Driver<BR>
                TCP/IP Protocol<BR>
                Workstation<BR>
                Installed Adapter Cards:<BR>
                MS Loopback Adapter<P>
</OL>

</UL>

<HR>
<H4><A NAME="vxworks">Building and Installing ACE on VxWorks</A></H4>
For the most part, you should be able to follow the instructions above
to build ACE and applications that use it.  Use the
<a href="#unix">Unix instructions</a> for Unix hosts, or
<a href="#win32">Win32</a> instructions for Windows NT hosts.<P>

You'll have to let ACE know the target type at compile time.
There are several ways to do this; please see the
$ACE_ROOT/include/makeinclude/platform_vxworks5.x_g++.GNU
platform file for detailed information.<P>

The VxWorks platform_vxworks*.GNU files are set up so that shared
libraries are not built on VxWorks.  Only static libraries,
with .a extension, are built.  Therefore, it's not necessary
to set the LD_LIBRARY_PATH environment variable on your host
system when building for VxWorks targets.<P>

These non-default VxWorks kernel configuration <code>#defines</code>
are required with ACE:<P>

<pre>
#define INCLUDE_CPLUS		/* include C++ support */
#define INCLUDE_CPLUS_IOSTREAMS	/* include iostreams classes */
#define INCLUDE_POSIX_ALL       /* include all available POSIX functions */
</pre>

For completeness, here are the non-default <code>#defines</code> that
we use for VxWorks 5.3.1/g++ 2.7.2:

<pre>
#define INCLUDE_CPLUS		/* include C++ support */
#define INCLUDE_CPLUS_IOSTREAMS	/* include iostreams classes */
#define INCLUDE_CONFIGURATION_5_2 /* pre-tornado tools */
#define INCLUDE_DEBUG           /* pre-tornado debugging */
#define INCLUDE_LOADER          /* object module loading */
#define INCLUDE_NET_SYM_TBL     /* load symbol table from network */
#define INCLUDE_SYM_TBL_SYNC	/* synchronize host and target symbol tables */
#define INCLUDE_NFS             /* nfs package */
#define INCLUDE_PING		/* ping() utility */
#define INCLUDE_POSIX_ALL       /* include all available POSIX functions */
#define INCLUDE_RDB             /* remote debugging package */
#define INCLUDE_RLOGIN          /* remote login */
#define INCLUDE_RPC		/* rpc package */
#define INCLUDE_SECURITY	/* shell security for network access */
#define INCLUDE_SHELL           /* interactive c-expression interpreter */
#define INCLUDE_SHOW_ROUTINES   /* show routines for system facilities*/
#define INCLUDE_SPY             /* spyLib for task monitoring */
#define INCLUDE_STARTUP_SCRIPT  /* execute start-up script */
#define INCLUDE_STAT_SYM_TBL    /* create user-readable error status */
#define INCLUDE_SYM_TBL         /* symbol table package */
#define INCLUDE_UNLOADER        /* object module unloading */
#define INCLUDE_WINDVIEW	/* WindView command server */
</pre>

It probably wouldn't take much effort to modify the
ACE library to not require <code>INCLUDE_CPLUS_IOSTREAMS</code>,
if necessary.

If you're first getting started with ACE and/or VxWorks,
I recommend just building the ACE library and tests first.
Then try running the tests.  Please see $ACE_ROOT/tests/README
for the latest status of the ACE tests on VxWorks.<P>

<HR>
<H3><A NAME="svcsinstall">Building and Installing ACE Network Services</A></H3>

The following explains how to build the ACE <A
HREF="ACE-netsvcs.html">network services</A> on <A
HREF="#unixsvcs">UNIX</A> and <A HREF="#win32svcs">Win32</A>.

<H4><A NAME="unixsvcs">Building and Installing ACE Network Services on UNIX</A></H4>

Building and installing ACE Network Services on UNIX is relatively
simple (the <A HREF="#win32svcs">process</A> for Win32 is different).
Here's what you need to do: <P>

<OL>

<LI> Build and install ACE on UNIX as described <A
HREF="#unix">earlier</A>.  If ACE is built at the root of the ACE
source tree (and ACE has been ported to your platform, of course) the
netsvcs static and shared object libraries should be built
automatically.  In addition, the server driver program
(<CODE>main</CODE>) contained in <A
HREF="http://www.cs.wustl.edu/~schmidt/ACE_wrappers/netsvcs/servers/main.cpp">
$ACE_ROOT/netsvcs/servers/main.cpp</A> should also be compiled and ready to run.<P>

<LI> Set your LD_LIBRARY_PATH environment variable to where the binary
     version of the ACE netsvcs library.  For example, you probably
     want to do something like the following <P>

<pre><code>
% setenv LD_LIBRARY_PATH $ACE_ROOT/ace:$LD_LIBRARY_PATH <P>
</code></pre>

<LI> By default, if the shared object library is built, the services
     are linked into the <CODE>main</CODE> driver program dynamically.
     To specify which services should be linked in and executed, edit the
<A
HREF="http://www.cs.wustl.edu/~schmidt/ACE_wrappers/netsvcs/servers/svc.conf">
$ACE_ROOT/netsvcs/servers/svc.conf</A> file.  During your editing,
     you should update information (such as the default service port
     numbers) that affects the initialization of services in this
     file.  Refer to the <A HREF="ACE-papers.html#config">Service Configurator</A>
     documentation to learn how the configuration file is parsed and
     how the services are dynamically linked and executed.  In
     addition, refer to the <A HREF="ACE-netsvcs.html">Network
     Services</A> documentation to learn more about how to configure
     each network service. <P>

<LI> If you only want to link the services statically, simply remove
     or rename the svc.conf file. <P>

</OL>

<H4><A NAME="win32svcs">Building and Installing ACE Network Services on Win32</A></H4>

The installation process for ACE network services on Win32 is a bit
different than UNIX.  We assume you're using MSVC++ 4.x (things are a
little different for the 2.0 version...). <P>

<UL>
<LI> Build and install ACE on Win32 as described <A
HREF="#win32">earlier</A>. <P>

<LI> Just like installing the ace directory under ACE_wrappers,
     install the new netsvcs directory under ACE_wrappers by copying
     all the appropriate files, include netsvcs.mdp and netsvcs.mak. <P>

<LI> The easiest thing to do is to use the default netsvcs.mdp and
     netsvcs.mak files distributed with the release.  Open the
     netsvcs.mdp workspace to build netsvcs as a DLL.  This project
     assumes that you have set the ``global'' include path to include
     $ACE_ROOT/netsvcs/lib.  This can be done via the following
     MSDEV menu item:

   Tools/Options/Directories/Show_Directories_For:Include_Files. <P>

<LI> If you choose not to use the given project, the following bullets
     explain how to build the ACE netsvcs DLL with MSDEV.<P>
   
<OL>
<LI> CREATE A PROJECT WORKSPACE. <P>

   Start by making a new project.  It should be rooted at
   $ACE_ROOT/netsvcs/lib.  We normally browse to
   $ACE_ROOT/netsvcs, and select "netsvcs" as the project name.
   This will cause MSDEV to use the $ACE_ROOT/netsvcs/lib
   directory to store the project files.  The actual directory and
   project name are unimportant, but we'll assume you
   named the project "netsvcs."  Select the dynamic link library option
   and say "ok."  By default, the config-win32*.h files are set up to
   build DLLs.  If you choose to build ACE as a static library you'll
   need to unset ACE_HAS_DLL in the config-win32*.h file and select
   the static link library option when creating a project workspace.<P>

<LI> INSERT FILES INTO PROJECT.  <P>

   Go into the Insert menu and select "Files into project".  If you're
   building a static library, select all the *.cpp files in
   $ACE_ROOT/netsvcs/lib into the project.<P>
   
   Once you've selected the files and pressed "ok" it should take a
   few seconds or so to for MSDEV to create the project.  (Note that
   in MSVC2.0 there isn't an Insert menu, so go into the Project Menu
   and then "Files" and from there insert all the *.cpp files.)  When
   including the files on windows 95, it may ask you to select fewer
   files than *.cpp.  Just do A-M and N-Z or something similar. <P>

<LI> SET THE INCLUDE PATH. <P>

   Go into Options section of the Tools menu.  Add the $ACE_ROOT/netsvcs/lib
   directory to the default directory search path.  
   Then add $ACE_ROOT\netsvcs to the default library search path.
   This means that you can now use relative paths for linking apps
   with netsvcs.lib.  You may skip this step if you have set
   Tools/Options/Directories/Include_Files to include
   $ACE_ROOT. <P>

   If you are going to compile ACE with UNICODE on, please add UNICODE
   to the pre-processor definitions through: <P>

   Build -&gt; Settings -&gt; C/C++ -&gt; Preprocessor -&gt; Preprocessor
   definitions<P>

<LI> SET UP THE LINKER. <P>

   When building a DLL we must ensure that both dll and exe are using
   the same libraries in order to allow standard C library functions
   to share common variables (particular <CODE>errno</CODE>) across dll
   and exe boundaries.  Go to
   Build/Settings/C++/Category:Code_Generation.  Set Use run-time
   library to "Multithreaded DLL" or "Debug Multithreaded DLL"
   depending on whether you're building a release or a debug version
   respectively.<P>

   When building a static lib: Go to
   Build/Settings/C++/Category:Code_Generation and set run-time
   library to "Debug Multithreaded" (or just "Multithreaded"). <P>

<LI> BUILD. <P>

   Go to the Build menu and select "Build netsvcs.{lib,dll}".  The first
   time this happens it will rebuild all the dependencies.  This may
   take a while (i.e., 3 to 15 minutes, depending on whether you use
   Samba, PC-NFS, native NTFS, etc.).    Eventually, this process
   will stop and from you won't have to rebuild the dependencies then
   on (thank God...).<P>
   
   At this point, the compiler should be happily chugging away on 
   the netsvcs files. <P>

<LI> USING netsvcs.lib. <P>

When it's done, you should have a static or dynamic library
   called netsvcs.lib.  You can use this to link with test applications,
   including the server driver program.  <P>
</OL>
</UL>

<P><HR><P>
<H3><A NAME="advanced">Advanced Topics</A></H3>

<UL>
<LI><A HREF="#cloning">Cloning the Source Tree</A>
<LI><A HREF="#corba">Building CORBA Versions of ACE</A>
<LI><A HREF="#mvs">Additional Build Tips for MVS</A>
<LI><A HREF="http://www.cs.wustl.edu/~levine/CVS.html">Version Control</A>
<LI><A HREF="http://www.cs.wustl.edu/~cleeland/ace/makefile-hints.html">ACE Makefile hints</a>
</UL>

<H4><A NAME="cloning">Cloning the Source Tree</A></H4>

On UNIX platforms, I typically like to support multiple platform
builds using the same ACE source tree.  This idiom is supported by ACE
using the $(ACE_ROOT)/bin/clone.c program.  To build clone,
perform the following steps: <P>

<pre>
% cd $ACE_ROOT/bin 
% make 
% mv clone ~/bin 
% rehash
</pre><P>

Then create a ./build subdirectory someplace (e.g., under
$ACE_ROOT), and then invoke the top-level Makefile with the
"clone" target, e.g.: <P>

<pre>
% cd $ACE_ROOT 
% mkdir build-SunOS5
% cd build-SunOS5 
% make -f ../Makefile clone 
% setenv ACE_ROOT $cwd 
% make
</pre><P>

This will establish a complete tree of links.  When you do a make in
this directory you will be producing object code that is not stored in
the same place as the original source tree.  This way, you can easily
build another platform in a parallel tree structure. <P>

<B> VERY IMPORTANT! </B> <P>

If you use the "clone trick" discussed above, make sure that the
symbolic links are correctly in place before starting the build.  In
particular, if you plan to clone the tree, it is preferable to do so
before you start a build procedure on the original tree.  This is
because the build procedure create object directories (.obj and
.shobj) and the cloning procedure will clone these directories also.
You would end up with links pointing to object files of another
platform.  If you clone the tree after you've done a build on the
original tree, make sure to remove all ".obj", ".shobj" and (any other
files or directories) in all subdirectories before starting the build
on your cloned tree. <P>

<HR><P>
<H4><A NAME="corba">Building CORBA Versions of ACE</A></H4>

Note that if you are compiling with IONA's Orbix implementation of
CORBA or Visigenix's implementation of CORBA, you'll also need to set
ORBIX_ROOT to point to the root of the Orbix source tree and
ORBELINE_ROOT to point to the root of the ORBeline source tree.  Since
many platforms don't have these CORBA tools the default for ACE does
*not* incorporate them.  Thus, if you are compiling with Orbix or
ORBeline, make sure that you set the symbolic links for
$ACE_ROOT/include/makeinclude/platform_macros.GNU and
$ACE_ROOT/ace/config.h to point to the the config* and platform*
files that have "-orbix" in them!

<P><HR><P>
<H4><A NAME="mvs">Additional Build Tips for MVS</A></H4>

For all intents and purpose, MVS OpenEdition (OE) is another flavor of
UNIX, therefore, the instructions under <A HREF="#aceinstall">Building
and Installing ACE on Unix</A> can be used along with the following
additional tips: <P>

   You can get a copy of GNU make that has been ported to MVS OpenEdition from
   the <A HREF="http://www.s390.ibm.com/products/oe/index.html">IBM OpenEdition web site</A>.
   ACE's make scheme generates compile commands that have options and
   operands interspersed.  By default, the c89/cc/c++ compiler expects all options to
   precede all operands.  To get around this, you must set a special
   compiler environment variable (_CXX_CCMODE) to 1 which tells the compiler
   to allow options and operands to be interspersed. <P>

   Note that the environment variable LD_LIBRARY_PATH is called LIBPATH
   on MVS. <P>

   Shared objects are built a little different on MVS than on
   other UNIX implementations.  This has been accounted for in the makefiles
   that come with ACE   When the linker (via the cxx command) builds the 
   libACE.so file it will also create a file called libACE.x.  This is a 
   side-deck file and it must be included in subsequent link edits with 
   application code.  For more information on this see the C/C++ MVS 
   Programming Guide.  If you want to build your application statically, 
   i.e., using libACE.a instead of libACE.so, you can set ACELIB to 
   ACELIB_STATIC in platform_mvs.GNU. <P>

   When the libACE.so file is built (via the MVS pre-linker and binder), you
   will get a rc=4 from the pre-linker.  This is ok.  This is due to some
   warnings about unresolved references which should get resolved during the
   link step.  Note, however, there shouldn't be any unresolved references
   from the binder (linkage editor).   You can get pre-link and link maps by
   uncommenting the PMAP and LMAP lines in the platform_mvs.GNU file.<P>

<HR><P>
Back to the <A HREF="http://www.cs.wustl.edu/~schmidt/ACE.html">
ACE</A> home page.

<!--#include virtual="/~schmidt/cgi-sig.html" -->
</BODY> 
</HTML>