File: README.md

package info (click to toggle)
zeroc-ice 3.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 80,200 kB
  • sloc: cpp: 358,081; java: 226,068; cs: 102,006; python: 28,230; objc: 27,003; php: 7,490; ruby: 7,122; yacc: 2,946; ansic: 2,488; xml: 1,594; lex: 1,241; makefile: 386; sh: 44
file content (139 lines) | stat: -rw-r--r-- 4,103 bytes parent folder | download
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
# Building Ice for MATLAB

This document describes how to build and install Ice for MATLAB from source.

ZeroC provides Ice for MATLAB [toolboxes][1] for all recent versions of MATLAB
on Windows, so building Ice for MATLAB from source is usually unnecessary.

* [Prerequisites](#prerequisites)
* [Build Instructions](#build-instructions)
* [Packaging the Ice Toolbox](#packaging-the-ice-toolbox)
* [Using Ice for MATLAB](#using-ice-for-matlab)
  * [Search Path](#search-path)
  * [Slice Files](#slice-files)
  * [Loading the Library](#loading-the-library)
  * [Running the Tests](#running-the-tests)
    * [Running the Tests Manually](#running-the-tests-manually)
    * [Running the Automated Tests](#running-the-automated-tests)

### Prerequisites

The build system requires MATLAB 2016a or later for Windows, Visual Studio 2015
and a Perl installation.

### Build Instructions

Open a Visual Studio x64 command prompt, `VS2015 x64 Native Tools Command
Prompt`. In this Command Prompt, change to the `matlab` subdirectory:
```
cd matlab
```

Now you're ready to build Ice for MATLAB:
```
msbuild msbuild\ice.proj
```

To build in debug mode instead:
```
msbuild msbuild\ice.proj /p:Configuration=Debug
```

Upon completion, a build in release mode generates the following components:

 - Ice for C++11 libraries, located in `cpp\bin\x64\Release`
 - slice2matlab executable, located in `cpp\bin\x64\Release`
 - ice.mexw64 MEX file, located in `matlab\lib\x64\Release`
 - Prototype and thunk files, located in `matlab\lib\x64\Release`
 - MATLAB code for core Slice files, located in `matlab\lib\generated`
 - MATLAB code for test Slice files, located in `matlab\test\**\generated`

The MATLAB extension depends on Ice for C++ components from the `cpp`
subdirectory, and those are built if required. It is also possible to build the
MATLAB extension using Ice C++ NuGet packages by setting the `ICE_BIN_DIST`
msbuild property to `cpp`:

```
msbuild msbuild\ice.proj /p:ICE_BIN_DIST=cpp
```

### Packaging the Ice Toolbox

Use the following command to build the Ice toolbox package:
```
msbuild msbuild\ice.proj /t:Package
```

This creates the toolbox package `msbuild\ice-<Ice Version>-<MATLAB Version>.mltbx`.

You can install the toolbox from within MATLAB by double-clicking on the file.

### Using Ice for MATLAB

#### Search Path

To use a source build, add the following directories to your MATLAB path:
 - `matlab\lib`
 - `matlab\lib\generated`
 - `matlab\lib\x64\Release`

#### Slice Files

Use `slice2matlab` to compile your Slice files. Run `slice2matlab -h` for a
description of its command-line options. You can place the generated `*.m`
files anywhere you like, but the enclosing directory must be in your MATLAB
path.

#### Loading the Library

The Ice for MATLAB library can be loaded with this command:
```
loadlibrary('ice', @iceproto)
```

The MEX file depends on `bzip2.dll` and several Ice DLLs that are part of the
Ice for C++ distribution. The build copies all DLL dependencies to the
`matlab\lib\x64\Release` directory.

#### Running the Tests

The Ice for MATLAB tests are located in `matlab\test`.

Since Ice for MATLAB only supports client functionality, you need test servers
from a different language mapping.

##### Running the Tests Manually

In a Command Prompt, start a test server from your chosen server language
mapping.

In MATLAB, change to a test directory:
```
cd matlab\test\...
```

Now you can start the MATLAB test client. Assuming the server is running on
the same host, use this command:
```
client({})
```

If you started the server on a different host, use this command instead:
```
client({'--Ice.Default.Host=<addr>'})
```

Replace `<addr>` with the host name or IP address of the server host.

##### Running the Automated Tests

Assuming you've installed Ice for Python, run `allTests.py`:
```
python allTests.py
```

This script automatically starts a Python server for each MATLAB client.
MATLAB clients are executed using a minimized MATLAB interpreter
and the test output is copied to the Command Prompt window.

[1]: https://zeroc.com/downloads/ice