Debian Codegraph @

docs/manual/chapters/install.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
4
5 <chapter id="MAGICS_Install" label="0">
6 <title>Installing Magics</title>
7
8 <xi:include href="../phrases/chapterinfo_mod.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
9
10 <section id="Install_Overview">
11 <title>Overview</title>
12 <para>For <productname>Magics</productname> the GNU autotools were chosen for the installation routine. These are the standard installation tools for most free and commercial software packages to date on Unix.</para>
13 <para/>
14 <para>Autotools’ main task is to generate Makefiles for the desired platform on which Magics will be used. This is necessary,
15 because the various platforms differ from each other in
16 various ways, such as compiler options and library/include paths.</para>
17 <para/>
18 <para>Autotools themselves do not need to be installed on the system of the customer. A Unix shell script called <application>configure</application> is supplied
19 with Magics which is executed by the person installing Magics. The script will then run some tests on the customer's system to find out
20 if required third-party software libraries are available and notes their locations (paths). Based on this information the script produces
21 the Makefiles needed to compile and install Magics.</para>
22
23 <section id="Install_Binary_Versions">
24 <title>Binary versions</title>
25 <para>Magics and third-party dependent software packages might also be available as binary packages for you platform in form
26 of RPMs. You might find them by going to the software search services, such as for OpenSuSE
27 and SLES at http://software.opensuse.org/search (select "Search options" - "Include users' home projects").</para>
28 </section>
29 <section id="Install_Static_Shared">
30 <title>Static versus shared library</title>
31 <para>Magics can be built as a static library and as a shared library. Using Magics as a shared library has an impact on how it is used. With a shared library it is not only necessary that the library is accessible at the time of compilation but also at run-time. Changes to the system, such as the removal of an old shared library might cause programs linked with this library to fail. For more information about the use of the shared library please read section “User setup” in chapter 2.</para>
32 <para/>
33 <para>The advantages of using shared libraries are that the size of executables will be smaller and that a different version of Magics can be used without recompiling the executable (if the libraries are binary compatible).</para>
34 </section>
35 </section>
36
37 <section id="Install_Requirements">
38 <title>Requirements</title>
39 <section id="Install_Requirements_third_party">
40 <title>Third-party software </title>
41 <para>The following list of software should be installed on your system before you try to install Magics. If you use a package manager,
42 such as RPM, to install software make sure to include the corresponding development packages with the header files. The <application>configure</application>
43 script will test for these libraries and give error messages if one of them is missing.</para>
44 <orderedlist>
45 <listitem>
46 <para>NetCDF library with C++ interface (http://www.unidata.ucar.edu/software/netcdf/)</para>
47 </listitem>
48 <listitem>
49 <para>Expat XML parser</para>
50 </listitem>
51 <listitem>
52 <para>GhostScript (especially the fonts!) </para>
53 </listitem>
54 </orderedlist>
55 <para/>
56 <para>Optional for raster output (PNG) you should also install:</para>
57 <orderedlist>
58 <listitem>
59 <para>Cairo graphics library (1.4.10 or later - www.cairographics.org)</para>
60 </listitem>
61 <listitem>
62 <para>gd library (2.0.32 or later - www.libgd.org )</para>
63 </listitem>
64 </orderedlist>
65 </section>
66
67 <section id="Install_Requirements_ecmwf">
68 <title>ECMWF support libraries</title>
69 <para>To read GRIB and BUFR data formats these two libraries, provided by ECMWF without charge, need to be installed on your system before Magics is installed:</para>
70 <orderedlist>
71 <listitem>
72 <para>GribAPI ( 1.9.8 or higher ) - www.ecmwf.int/products/data/software/grib_api.html</para>
73 </listitem>
74 <listitem>
75 <para>EmosLib ( 376 or higher) - www.ecmwf.int/products/data/software/download/interpolation.html</para>
76 </listitem>
77 </orderedlist>
78
79 <para>When installing these two packages please be aware of the following:</para>
80 <itemizedlist>
81 <listitem><para>GribAPI should be installed first</para></listitem>
82 <listitem><para>Magics internally works only in double floating point precision and therefore requires the double precision version of EmosLib.</para></listitem>
83 <listitem><para>EmosLib requires a Fortran 90 compiler with Cray pointer support (Portland Pgf90 7.2 and GFortran 4.2 and newer).</para></listitem>
84 <listitem><para>We strongly recommend to use the <function>-fPIC</function> compiler options to compile 64 bit version of GribAPI and Emoslib.</para></listitem>
85 </itemizedlist>
86 </section>
87
88 <section id="Install_compilation">
89 <title>Compilation environment</title>
90 <para>At ECMWF, Opensuse 10.3/11.3 Linux systems (32 and 64bit) were used for testing. Any C++ Compiler which supports features required for the ANSI C++ standard
91 from 1998 (STL, namespaces, templates) should work. At ECMWF we tested GCC’s g++ 4.x successfully. A Fortran compiler is not
92 required for the compilation of Magics, but is needed if you want to use the Fortran interface or compile a dependent Fortran library (Emoslib).</para>
93 </section>
94 </section> <!-- Install_Requirements -->
95
96
97 <section id="Install_compile">
98 <title>Compilation and installation</title>
99 <para>To compile and install the Magics graphics library, the installer must first unpack the *.tar.gz file, provided by ECMWF, to a temporary location.</para>
100 <para><command>tar -xzvf Magics++-2.14.0.tar.gz</command></para>
101
102 <section id="Install_configure">
103 <title>Generating the Makefiles with configure</title>
104
105 <para>After changing into the unpacked Magics directory, the user then has to run the configure script. The script gives the user feedback on what requirements are
106 fulfilled and what software is still required. Table 1 gives an overview of the different options of configure. More options of the script are available and can be listed
107 by typing <command>./configure --help</command> in the console. The default (without any options) will compile a shared library only and install it in /usr/local/.</para>
108
109 <informaltable frame="all">
110 <!--<title>Options of the configure scripts</title>-->
111
112 <tgroup cols="3">
113 <thead>
114 <row>
115 <entry>
116 <para>Option</para>
117 </entry>
118 <entry>
119 <para>Explanation</para>
120 </entry>
121 <entry>
122 <para>Default</para>
123 </entry>
124 </row>
125 </thead>
126 <tbody>
127 <row>
128 <entry>
129 <para>--help</para>
130 </entry>
131 <entry>
132 <para>Outputs all options of configure.</para>
133 </entry>
134 <entry>
135 <para/>
136 </entry>
137 </row>
138 <row>
139 <entry>
140 <para>--prefix=/your/path/</para>
141 </entry>
142 <entry>
143 <para>Directory in which Magics will be installed.</para>
144 </entry>
145 <entry>
146 <para>/usr/local</para>
147 </entry>
148 </row>
149 <row>
150 <entry>
151 <para>--enable-metview</para>
152 </entry>
153 <entry>
154 <para>Required if Magics is build to be used for Metview 4.</para>
155 </entry>
156 <entry>
157 <para>no</para>
158 </entry>
159 </row>
160 <row>
161 <entry>
162 <para>--enable-raster</para>
163 </entry>
164 <entry>
165 <para>Enables raster image output (GIF, GD_PNG, JPEG).</para>
166 </entry>
167 <entry>
168 <para>yes</para>
169 </entry>
170 </row>
171 <row>
172 <entry>
173 <para>--enable-cairo</para>
174 </entry>
175 <entry>
176 <para>Enables the Cairo output driver (PNG, EPS, PDF)</para>
177 </entry>
178 <entry>
179 <para>yes</para>
180 </entry>
181 </row>
182 <row>
183 <entry>
184 <para>--enable-bufr</para>
185 </entry>
186 <entry>
187 <para>Enables BUFR support (Emoslib is required)</para>
188 </entry>
189 <entry>
190 <para>no</para>
191 </entry>
192 </row>
193 <row>
194 <entry>
195 <para>--enable-grib</para>
196 </entry>
197 <entry>
198 <para>Enables GRIB 1/2 support</para>
199 </entry>
200 <entry>
201 <para>yes</para>
202 </entry>
203 </row>
204 <row>
205 <entry>
206 <para>--with-grib-api=&lt;path&gt;</para>
207 </entry>
208 <entry>
209 <para>Gives the location where GribAPI is installed</para>
210 </entry>
211 <entry>
212 <para>/usr/local</para>
213 </entry>
214 </row>
215 <row>
216 <entry>
217 <para>--enable-netcdf</para>
218 <para>--with-netcdf=&lt;path&gt;</para>
219 </entry>
220 <entry>
221 <para>Enables netCDF support</para>
222 <para>Set location of NetCDF libs</para>
223 </entry>
224 <entry>
225 <para>yes</para>
226 <para>/usr/local</para>
227 </entry>
228 </row>
229 <row>
230 <entry>
231 <para>--enable-static</para>
232 <para>--disable-shared</para>
233 </entry>
234 <entry>
235 <para>Compiles static library instead of shared one.</para>
236 </entry>
237 <entry>
238 <para>no</para>
239 <para>yes</para>
240 </entry>
241 </row>
242 <row>
243 <entry>
244 <para>--enable-python</para>
245 <para>--with-python-include-dir</para>
246 <para>--with-python-lib-dir</para>
247 <para>--with-numpy</para>
248 </entry>
249 <entry>
250 <para>Enables Python interface.</para>
251 </entry>
252 <entry>
253 <para>no</para>
254 <para></para>
255 <para></para>
256 <para></para>
257 </entry>
258 </row>
259 <row>
260 <entry>
261 <para>--libdir=&lt;path&gt;</para>
262 </entry>
263 <entry>
264 <para>Directory where libs are installed (on some 64bit it needs to be
265 $prefix/lib64)</para>
266 </entry>
267 <entry>
268 <para>$prefix/lib</para>
269 </entry>
270 </row></tbody></tgroup>
271 </informaltable>
272 <para>Even if a feature is enabled by the installer it might be still disabled by the <function>configure</function> script
273 if the necessary dependent software cannot be detected. Installers should check carefully the output of the <function>configure</function> script.
274 </para>
275
276 <para>The C, C++ and Fortran compilers are chosen by configure. This can be overwritten by
277 setting the variables CC, CXX and F77, on the configure command line, to the preferred
278 compiler. Further the variable CXXFLAGS can be used to set compiler flags for optimisation
279 or debugging. For example, it is recommented to use CXXFLAGS="-O2 -mtune=native" or any other optimisation to compile Magics.</para>
280 <para>The most important option is --prefix. Setting the prefix defines where your Magics
281 library and executables will be installed. This path is later important for the user
282 setup.</para>
283 <para>The options to enable/disable output formats allow you to customise your installation. For
284 example, if you have problems on your system with support libraries (see previous section),
285 you might want to try to disable the raster output. The <firstterm>GD</firstterm> and
286 <firstterm>Cairo</firstterm> libraries are responsible for most third-party dependencies.
287 </para>
288
289 <para><emphasis>Be aware when using Portland Fortran compilers and g++:</emphasis> The
290 PGF90 compiler cannot handle C++ exceptions from the GNU compiler in static libraries.
291 In this case we suggest to first build only the static library, using </para>
292 <para>./configure --disable-exceptions --disable-shared --enable-static F77=pgf90</para>
293 <para>plus any other configure option you want, and compile afterwards the shared version of the library. By setting the variable F77 the user can hard code the Fortran compiler chosen by configure (in this case pgf90 ).</para>
294 </section> <!-- Install_configure -->
295
296 <section id="Install_compile_code">
297 <title>Compiling the code</title>
298 <para>After the configure script has run successfully, the user can compile the library by
299 typing <command>make</command> in the same directory.</para>
300 </section>
301
302 <section id="Install_compile_testing">
303 <title>Testing your build</title>
304 <para>The Magics code contains a directory called <emphasis>test</emphasis> in which, in
305 separate subdirectories, tests for the various interfaces of Magics are provided. Test
306 programs in Fortran, C, Python and MagML are compiled and run if <command>MAGPLUS_HOME=$PWD make check</command>
307 is invoked from the root directory. (Note that the <command>MAGPLUS_HOME</command> needs to be set!)</para>
308
309 <para>The output of the tests should verified before the library is installed.
310 This setup does not check if the user setup (see chapter 2) is correct, but the code in test
311 can be used to do so. More examples of source code and MagML files can be found on the Magics
312 web page.</para>
313 </section>
314
315 <section id="Install_library">
316 <title>Installing the library</title>
317 <para>Once the build and tests have been successfully completed, the command <command>make install</command> copies the library into the correct location on the system. Administrator
318 permission might be required, depending on the installation directory. You might want to run <command>make -n install</command> first, which will show you what will be installed where, without performing
319 any changes to your system.</para>
320 <para>To free space, the temporary unpacked source directory can be cleaned of the object files with <command>make clean</command> after a successful installation.</para>
321 </section>
322
323 <section id="Build_RPM">
324 <title>Building RPMS</title>
325 <para>To ease installations over multiple systems or to enable easy re-installation, Magics allows the building of RPMS.
326 By typing the command <command>make rpms</command> a tarball is build and the binary package generated this requires a full compilation.
327 The generated RPMS can be installed with the command <command>sudo rpm -i name.rpm</command> and deinstalled by <command>sudo rpm -e name</command>.</para>
328 </section>
329
330 </section> <!-- Install_compile -->
331
332
333
334
335 <section id="faq">
336 <title>FAQ</title>
337 <para><emphasis>Why do I get the error message while loading shared libraries: libMagPlus.so.1: cannot open shared object file: No such file or directory when running a Magics executable?</emphasis></para>
338 <para>You need to alter your $LD_LIBRARY_PATH variable, as described in section “User setup”. The variable needs to contain the path to your Magics library.</para>
339 <para/>
340 <para><emphasis>Why do I get a message about a missing / not found libpgc.so when trying to run a Magics executable?</emphasis></para>
341 <para>If your EmosLib is compiled with Portland’s Pgf90, it requires this library as shared library at run-time. You need to alter your $LD_LIBRARY_PATH variable,
342 as described in chapter 2.</para>
343 <para/>
344 <para><emphasis>Can I install Magics++ in the same directory as I have installed Magics 6?</emphasis></para>
345 <para>Yes, it should be possible. The libraries have different names for configuration files and use different directories (share instead of coast). You might however prefer a clear separation if you start to phase out Magics 6.</para>
346 <para/>
347 <remark>
348 <para><emphasis>How can I change the coastline files?</emphasis></para>
349 <para>Coastline files are given in NetCDF format. Have a look at the directory gshhs in the main Magics directory. There you will find the program which produces the NetCDF files. You can create your own data files gshhs files at http://rimmer.ngdc.noaa.gov/coast/ .</para>
350 <para/>
351 <para><emphasis>Can I add GIS information, such as rivers and borders to my plots?</emphasis></para>
352 <para>Yes. Information about political borders and rivers have been added with the new coastline files. </para>
353 <para/>
354 </remark>
355 <para><emphasis>Why have the Printercap file and the frame in my PostScript disappeared?</emphasis></para>
356 <para>With version 2.4 of Magics we have changed the set-up of how the PostScript driver was internally organised. The Printercap configuration file was created in the past to accommodate differences between printers. This is nowadays no issue any more. Out of the same reason PostScript output was scaled down to 95% to allow room for Printer alignment problems. From version 2.4 onwards the scaling is, as in all other drivers, set back to 100% of the page size.</para>
357 <para/>
358 <para><emphasis>Why did version 2.6 of Magics was followed by version 2.8?</emphasis></para>
359 <para>With Magics 2.4 we introduced a new numbering scheme where the sub version indicates how stable the version of Magics is. Odd numbers (2.5, 2.7, …) indicate unstable development versions and even numbers (2.4, 2.6, 2.8, …) indicate versions we think are stable and tested enough to be used in your applications.</para>
360 <para/>
361 <para><emphasis>How can I report bugs or ask for help?</emphasis></para>
362 <para>Please write an email to [email protected] . Please compress any larger files you might need to attach with gzip.</para>
363 <para/>
364 </section>
365
366 <section id="Install_Quick_Guide">
367 <title>Quick installation guide</title>
368 <para>This is a list of commands needed to install Magics. It is assumed “&gt;” is the shell prompt. The Magics version number may vary.</para>
369 <para/>
370 <para>&gt;tar -xzf Magics++-2.14.0.tar.gz</para>
371 <para>&gt;cd Magics++-2.14.0</para>
372 <para>&gt;./configure –prefix=/path/to/where/you/install/Magics++-2.14.0</para>
373 <para>checking build system type... i686-suse-linux</para>
374 <para/>
375 <para>&gt; make</para>
376 <para>&gt; make install</para>
377 <para>&gt; setenv MAGPLUS_HOME /path/to/where/you/install/Magics++-2.14.0</para>
378 <para>&gt; make check &lt;&lt; running the test programs</para>
379 <para>&gt; cd test/fortran</para>
380 <para>&gt; ./coast</para>
381 <para/>
382 </section>
383 <section id="Install_Licence">
384 <title>Licence</title>
385 <para>Copyright 2008-2011 European Centre for Medium-Range Weather Forecasts (ECMWF)</para>
386 <para/>
387 <para>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at </para>
388 <para/>
389 <para> http://www.apache.org/licenses/LICENSE-2.0</para>
390 <para/>
391 <para>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. </para>
392 <para/>
393 <para>See the License for the specific language governing permissions and limitations under the License.</para>
394 </section>
395 </chapter>