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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="STYLESHEET" href="MakeProjectCreator.css" charset="ISO-8859-1"
type="text/css">
<title>MPC: CDT6 Project Type</title>
</head>
<body>
<div>
<h1 class="Head1">CDT6 Project Type documentation</h1>
<div>
<h3 class="Head2">Background/Abstract</h3>
<li class="body">The <em>CDT6 Project Type</em> generates project files utilizable
by Eclipse's CDT plugin, version 6. This is the version
generally available/compatible with the Eclipse "Galileo" release.
The project type generates eclipse projects from generic mpc
files. These Eclipse/CDT projects can then be imported into a user's
workspace and built using CDT's internal builder.</li>
<li class="body">MPC's CDT6 Project Type currently supports Linux
and Windows as both host and target platforms.</li>
</div>
<div>
<h3 class="Head2">Pre-requisites</h3>
<ul>
<li class="body">The following software items are required and
in the execution path (as well as any of their respective dependencies):
<dl>
<dt>Eclipse Galileo</dt>
<dd>Standard download from <a href="http://www.eclipse.org/downloads">http://www.eclipse.org/downloads</a>.</dd>
<dt>CDT 6.0</dt>
<dd>This comes packaged together with Eclipse Galileo in the
<a
href="http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/heliosr">Eclipse
IDE for C/C++ Development</a>.</dd>
<dt>Eclipse-compatible toolchain</dt>
<dd>On linux platforms, this should just be the standard
installation of the GNU toolchain for that linux distribution. On
Windows, Eclipse uses the <a href="http://www.mingw.org">MinGW</a>
toolchain, available for download. Suggested tool set is <a
href="http://sourceforge.net/downloads/mingw/Automated%20MinGW%20Installer/MinGW%205.1.6/MinGW-5.1.6.exe/">Automated
MinGW Installer</a>.</dd>
<dt>a compatible <tt>make</tt> tool</dt>
<dd>This does not need to be a full-featured GNU make, but it
must be in the PATH as an executable named <em>make</em>. On
Linux, the standard GNU make suffices. On Windows, <a
href="http://gnuwin32.sourceforge.net/packages/make.htm">the
<em>make</em> package from GNUWin32</a> is a good choice.</dd>
</dl>
<li class="body">The default value of 256Mb for Eclipse's Java
VM heap size is insufficient for building projects the size of
ACE/TAO/CIAO. A minimum of 768Mb or more is suggested. This can be
done on the command line launch of eclipse, or in the
<em class="Code">eclipse.ini</em> file.</li>
</ul>
</div>
<div>
<h3 class="Head2">Usage</h3>
<p class="Body">
For every <em class="Code">project <var>myprojname</var> { }</em> in mpc files, the CDT6 project type
generates a corresponding "eclipse project" directory of the form
<em class="Code">cdt_<var>myprojname</var></em>. The CDT6 Project Type
uses Eclipse's <em>linked resource</em> feature to work around
Eclipse's usual requirement that source files reside inside the Eclipse project
directory. However, the linked resource feature also comes with
restrictions; see <a href="#fullpath">the note</a> for details.
</p>
<h4 class="Head5">Generic workflow</h4>
<p class="Body">
Presuming .mpc files already exist:
</p>
<ol>
<li><p class="Body">Generate projects using <em class="Code">-type cdt6</em>.</p></li>
<li><p class="Body">Import projects into an Eclipse workspace.</p></li>
</ol>
<h4 class="Head5">Workflow for building ACE/TAO</h4>
<ol>
<li><p class="Body">Check out a copy of ACE/TAO.</p></li>
<li><p class="Body">Configure ACE/TAO for your target(s) by setting up
<em class="Code">config.h</em>.</p>
</li>
<li><p class="Body">Set up environment variables (<var>ACE_ROOT</var>,
<var>TAO_ROOT</var>, etc.), <var>PATH</var>,
<var>LD_LIBRARY_PATH</var> (or similar), etc.</p>
</li>
<li><p class="Body">Verify settings in <em class="Code">global.features</em> and, if changes
are necessary, make appropriate changes in
<em class="Code">default.features</em>.</p>
</li>
<li><p class="Body">Generate projects using <em class="Code">-type cdt6</em> insuring the
use of <em class="Code">mwc.pl</em> from within ACE, e.g.,</p>
<blockquote>
<p class="Code">$ cd $TAO_ROOT</p>
<p class="Code">$ mwc.pl -type cdt6 TAO_ACE.mwc</p>
</blockquote>
<p class="Body"><em class="Code">mwc.pl</em> will churn for awhile.</p>
</li>
<li><p class="Body"><em>Suggestion:</em> Verify that <strong>Project->Build
Automatically</strong> is unchecked (has no checkmark to its
immediate left). If this is left on, then the build will start as
soon as the import in the next step begins, and it will build everything.</p></li>
<li><p class="Body">From within Eclipse (preferably an otherwise-empty workspace) select
<strong>File->Import...</strong> and perform the following actions:</p>
<ol type="a">
<li><p class="Body">Choose <strong>General->Existing Projects Into
Workspace</strong> and click <strong>Next</strong></p></li>
<li><p class="Body">In "Select Root Directory:" text field, enter the full path
to the directory <em>above</em> ACE, TAO, etc. (you can also use
the "Browse" feature to select the directory from the GUI). For
example, if you checked everything out into
<em class="Code">/home/joedeveloper/acetao</em> and ACE and TAO are in a
peer layout under that directory, you would enter
<em class="Code">/home/joedeveloper/acetao</em> in the text field.
</p></li>
<li><p class="Body">Eclipse will scan all the subdirectories looking for existing
projects; this can take a few minutes for something as large as
TAO or CIAO. <strong>NOTE:</strong> If you have previously run
MPC to generate CDT projects with one workspace
(<em class="Code">.mwc</em> file) and then ran it later with a different
workspace without removing the projects from the first
generation, Eclipse will still find those projects for import.
See <a href="#remove_projects">the note on removing generated
projects</a> for information on how to do that.</p></li>
<li><p class="Body"><strong>Be sure that the checkbox next to <em>Copy projects
into workspace</em> is <em>UN</em>checked.</strong> Copying projects into
the workspace unnecessarily duplicates files, plus we have found
that Eclipse can get confused with file paths sometimes (though
sometimes it will work).</p></li>
<li><p class="Body">Feel free to use <em>Working Sets</em> or not. You may also
choose to import a subset of the discovered projects by
manipulating them in the list, however, experience suggests that
the list is ignorant of dependency interactions between projects,
so you must manage that manually (<em>i.e.</em>, you could import
a project, but not projects upon which the first depends, and
that first project would then fail to build).</p></li>
<li><p class="Body">Click <strong>Finish</strong> to proceed with the import.</p></li>
</ol>
<p class="Body">
Eclipse will now start populating the <em>Projects</em> pane with
projects. If you didn't uncheck <strong>Build
Automatically</strong>, then builds will start. Regardless, the
C++ indexer will run in the background across the source of all projects.</p></li>
</ol>
<h4 class="Head5">Building A Project</h4>
<p class="Body">
To build a project or set of projects, select the project (or
projects) in the <em>Project</em> pane, then select
<strong>Project->Build Project</strong>. Eclipse will evaluate
<em>ALL</em> dependencies automatically, though not necessarily
quickly.
</p>
<p class="Body">
<em>Hint:</em> a good choice to get all of ACE/TAO built is to
choose the <em>Naming Service</em> project.
</p>
</div>
<div>
<h3 class="Head2">Multiple Platforms</h3>
<p class="Body">
Just as a project created within CDT can be set up to support
multiple platforms, so too can projects generated via MPC. To the
extent possible, the platforms are represented in generated projects
in the same way as they are in "native" projects (though there will
be some differences).
</p>
<h4 class="Head5">Generating Projects with Multiple Platform Support</h4>
<p class="Body">
Platforms are named in a list called <em class="Code">platforms</em> in the
CDT6 template (much like other MPC templates). The list defaults to
the platform on which <em class="Code">mwc.pl</em> is run. To generate for
another platforms, or for additional platforms, you must provide
<em class="Code">platforms</em> with the list of platforms to generate.
</p>
<p class="Body">
Generate projects using a similar incantation to the default (from
above) using <em class="Code">-type cdt6</em> and <em class="Code">-value_template
platform="<platform_list>"</em>, insuring the
use of <em class="Code">mwc.pl</em> from within ACE, e.g.,
<blockquote>
<p class="Code">$ cd $TAO_ROOT</p>
<p class="Code">$ mwc.pl -type cdt6 -value_template platforms="linux cellppu" TAO_ACE.mwc</p>
</blockquote>
</p>
<p class="Body">
Platforms are defined as scopes in <tt>templates/cdt6platforms.mpt</tt>.
</p>
<h4 class="Head5">Cross-Compilation</h4>
<p class="Body">
Cross-compilation is handled the same as a platform; the target is
the platform. If you want to generate for cross-compilation, the
cross-compiler information must be defined in a scope (typically
named for the target type) in
<tt>templates/cdt6platforms.mpt</tt>. If a scope does not exist for
the target, follow <a href="#addplatform">the instructions for adding
a new platform.</a>
</p>
<p class="Body">
In the example given above, <em class="Code">cellppu</em> is the name of the
platform for cross-compilation.
</p>
<h4 class="Head5">Adding a New Platform<a name="addplatform"></a></h4>
<p class="Body">
To add a new platform, particularly one for cross-compilation, it's
probably easiest to start from an existing scope, e.g.,
<em class="Code">cellppu</em>. For cross-compilation where the cross-compiler
toolchain is GNU Compiler-based, you will need to provide the names
of the various executables in the toolchain in the values
<em class="Code">as</em>, <em class="Code">ar</em>, <em class="Code">cc</em>, and
<em class="Code">cxx</em>. And, optionally, <em class="Code">ccld</em> and/or
<em class="Code">cxxld</em> if the linker used for linking C and C++
executables, respectively, is different from the respective
compiler. CDT expects these to be in the path.
</p>
</div>
<div>
<h3 class="Head2">Notes</h3>
<ol>
<li><p class="Body">
There is no generated workspace. Eclipse's concept of workspace is
very different from MPC's, and there is no way to generate a
workspace. Eclipse's workspace concept doesn't permit sharing
among machines or developers or even checking a workspace into
version control.
</p></li>
<li><p class="Body">The Eclipse "workspace" and MPC project + source must not be in the
same directory hierarchy. For example, if you chose to have
Eclipse store its workspace in
<em class="Code">/home/joedeveloper/workspace</em>, you may not put your
MPC project+source under that directory. However, putting the
MPC project+source under <em class="Code">/home/joedeveloper/acetao</em>
or similar, <em>i.e.</em>, as a <em>peer</em> to the workspace
directory, is fine.
</p></li>
<li><p class="Body"><a name="fullpath"></a>CDT6 uses Eclipse's <em>linked
resource</em> feature to work around the usual requirement that
all source code reside in Eclipse project directories. These
act similar to Unix symbolic links. While convenient so that a
developer is not required to conform to Eclipse's directory
layout, it comes at a price: the target of the link must be
specified as a full path. The consequence of this restriction is
that, once the CDT6 projects get generated, the source should
not move in the filesystem.</p></li>
<li><p class="Body"><a name="remove_projects"></a>MPC's CDT Project Generator
creates directories named <em class="Code">cdt_*</em> for projects, similar
to how the GNUACE generator generates makefiles of the form
<em class="Code">GNUmakefile.*</em>. To remove all CDT projects from a
directory hierarchy, on Linux you can use a command such as:</p>
<blockquote>
<p class="Code">$ find . -name 'cdt_*' -print | xargs rm -rf</p>
</blockquote>
</li>
<li><p class="Body">Perfect hash generation using the IDL compiler is not
currently working because the IDL compiler cannot find the
<em class="Code">gperf</em> executable. This may be a <em class="Code">PATH</em>
issue, "installation" issue, or an mpc file dependency issue. The
IDL compiler works but does not generate perfect hash lookups.</p></li>
</ol>
</div>
</div>
</body> </html>
|