summaryrefslogtreecommitdiff
path: root/cpp/install/common/README.DEMOS
blob: 0b26c086a4eff008545152ee47e1f1e4f4cb528d (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
Building the Demos
==================

This section describes how to build the demos included in the Ice demo
distribution. Check the 'Platform Specific Notes' section to see if
there are extra details relevant to your platform.

The demo archive contains sample programs for each language mapping
that Ice supports. Not all demos will build against all Ice
distributions. Distributions for specific platform/tool combinations
may not support every Ice language mapping.

The build systems included in the demo distribution are either
'makefile' based or 'ant' based. The C++ and C# demos use makefiles and
the Java demos use the Apache Foundation's ant build tool.

NOTE: The Ruby, Python and PHP demos do not need to be built.

The Unix makefiles for C++ and C# require GNU gmake 3.80 or later. If
your system does not come with GNU make, you can find information on
how to acquire it at the following link:

http://www.gnu.org/software/make/

The Windows makefiles for C++ and C# require Microsoft NMAKE 1.5.2. If
you do not have NMAKE installed on your system, you can obtain it as
part of the Microsoft Platform SDK:

http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en

The Ice for Java demos require Ant 1.6.3, but we recommend using the
most recent release available. Ant can be obtained at:

http://ant.apache.org/bindownload.cgi

To build the demos you need to:

  - Configure your system according to the directions in the main
    README file (for binary distributions) or the platform-specific
    INSTALL file (if you built Ice from sources).

  - On Linux or Unix:

    If you are using a non-RPM installation, set the environment
    variable ICE_HOME to point to your Ice installation. For example,
    in a Bash shell:

    $ export ICE_HOME=$HOME/testing/Ice-@ver@

    You also need need add $ICE_HOME/lib to your library search path,
    unless you create the symbolic link /opt/Ice-@mmver@ (see the top-
    level README). For example:

    $ export LD_LIBRARY_PATH=$ICE_HOME/lib:$LD_LIBRARY_PATH

  - On Windows:

    Set the environment variable ICE_HOME to point to your Ice
    installation, and add %ICE_HOME%\bin to your PATH. For example:

    c:\>set ICE_HOME=c:\Ice-@ver@
    c:\>set PATH=%ICE_HOME%\bin;%PATH%

    Edit Ice-@ver@-demos/config/Make.rules.mak and set CPP_COMPILER to
    the appropriate value for your compiler.

  - Build the demos. For example:

    On Linux or Unix:

        # C++ demos
	cd Ice-@ver@-demos/demo
	gmake

	# C# demos
	cd Ice-@ver@-demos/democs
	gmake

	# Java demos
	cd Ice-@ver@-demos/demoj
	ant

    On Windows:

	:: C++ demos
	cd Ice-@ver@-demos\demo
	nmake /f Makefile.mak

	:: C# demos
	cd Ice-@ver@-demos\democs
	nmake /f Makefile.mak

	:: Java demos
	cd Ice-@ver@-demos\demoj
	ant


Platform specific notes
=======================


Building the C++ demos using Borland C++ Builder
------------------------------------------------

The C++ build system included in the demo archive is nmake-based and
requires that you open a Windows console (Command Line) and run
commands from the command prompt. The Borland installer typically
configures the Windows environment so you should not need additional
configuration to run the Borland C++ compiler from the command line.


Building the C++ demos using Microsoft C++ Environments
-------------------------------------------------------

These instructions apply to all supported versions of Microsoft C++
development environments.

The C++ build system included in the demo archive is nmake-based and
requires that you open a Windows console (Command Line) and configure
the environment for your development tools.

If you prefer building the demos from the IDE, please download the
appropriate Ice installer for your version of Microsoft Visual C++
or download the Ice source distribution.

To build from the console, you may need to take steps to configure
your environment for your compiler. This usually involves running a
file named vcvars32.bat (Visual C++ 6.0) or vsvars32.bat (VS .NET
2003 and VS 2005). A quick, but not definitive, test is to try
running "cl" or "nmake" from a console window. If you are using VS
.NET 2003 or VS 2005, there should be a shortcut in your development
tool's Start menu entry named "Visual Studio Command Prompt". Click
on this to start a console window with your development environment
already configured.


Building the demos on Windows using Mono, Cygwin, etc.
------------------------------------------------------

Building the demos with Mono using the NMAKE makefiles or using
Cygwin and the gmake makefiles is not currently supported.


Running the Ice Demos
=====================

Most demos consist of a single server and client. The instructions to
run a demo depend on the programming language. Instructions for each
language are included below. Some demo directories contain README
files if additional steps are necessary.


Running the C++ demos
=====================

To run a demo, open a terminal terminal window, change to the desired
demo directory, and enter the following command to run the server:

$ ./server

To run the client, open another terminal window, also change to the
desired demo directory, and run:

$ ./client


Running the Java demos
======================

To run the demos you need to add classes to your CLASSPATH.

For example on Linux or Unix with a bash shell:

$ export CLASSPATH=classes:$CLASSPATH

And on Windows:

> set CLASSPATH=classes;%CLASSPATH%

To run a demo, open a terminal window, change to the desired demo
directory, and enter the following command to run the server:

$ java Server

To run the client, open another terminal window, also change to the
desired demo directory, and run:

$ java Client


Running the C# demos
====================

The C# demos are only supported on Linux or Windows, and the Ice
for C# runtime is included only in the Linux and Windows
distributions.

To run a demo, open a terminal window, change to the desired demo
directory, and enter the following command to run the server:

$ ./server.exe

To run the client, open another terminal window, also change to the
desired demo directory, and run:

$ ./client.exe


Running the Python demos
========================

To run a demo, open a terminal window, change to the desired demo
directory, and enter the following command to run the server:

$ python Server.py

To run the client, open another terminal window, also change to the
desired demo directory, and run:

$ python Client.py


Running the Ruby demos
======================

Ice provides only client demos in Ruby since Ice for Ruby does not
support server-side activities. In order to run a sample client, you
must first start its corresponding server from another Ice language
mapping, such as C++:

# for example in the /tmp/Ice-@ver@/demo/Ice/hello directory
$ server

To run the client, open another terminal window, change to the
corresponding demo directory, and run:

# for example in the /tmp/Ice-@ver@/demorb/Ice/hello directory
$ ruby Client.rb


Running the PHP demos
=====================

Two PHP demos are provided in the demophp directory.

The Ice extension for PHP is provided as a dynamically-loadable shared
library (lib/IcePHP.so) in the Linux binary distribution. On all other
Unix platforms, you'll need to build PHP and the Ice extension from
source code. Please refer to the INSTALL file included in the IcePHP
source distribution for more information.

The example in demophp/Ice/hello demonstrates the use of the Ice
extension for PHP in a dynamic Web page, whereas the example in
demophp/Ice/value requires PHP's command line interpreter. Both
examples require that an Ice server be available; a matching server
from any of the other language mappings can be used. A README file is
provided in each of the example directories.

Note that you must modify the php.ini files in each demo directory to
match your PHP installation and ensure that the Ice extension is
loaded properly.