[47c4c7d] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[8dfc5c3] | 7 | <!ENTITY swig-download-http "&sourceforge-dl;/swig/swig-&swig-version;.tar.gz">
|
---|
[47c4c7d] | 8 | <!ENTITY swig-download-ftp " ">
|
---|
[5eb179fa] | 9 | <!ENTITY swig-md5sum "7c3e46cb5af2b469722cafa0d91e127b">
|
---|
[191b5a5] | 10 | <!ENTITY swig-size "7.7 MB">
|
---|
[5eb179fa] | 11 | <!ENTITY swig-buildsize "118 MB (1.3 GB with tests)">
|
---|
| 12 | <!ENTITY swig-time "0.2 SBU (add 9.3 SBU for tests; both using parallelism=4)">
|
---|
[47c4c7d] | 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="swig" xreflabel="SWIG-&swig-version;">
|
---|
| 16 | <?dbhtml filename="swig.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
| 23 | <title>SWIG-&swig-version;</title>
|
---|
| 24 |
|
---|
| 25 | <indexterm zone="swig">
|
---|
| 26 | <primary sortas="a-swig">SWIG</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
| 30 | <title>Introduction to SWIG</title>
|
---|
| 31 |
|
---|
| 32 | <para>
|
---|
| 33 | <application>SWIG</application> (Simplified Wrapper and Interface
|
---|
| 34 | Generator) is a compiler that integrates <application>C</application>
|
---|
| 35 | and <application>C++</application> with languages including
|
---|
[191b5a5] | 36 | <application>Perl</application>,
|
---|
| 37 | <application>Python</application>,
|
---|
| 38 | <application>Tcl</application>,
|
---|
| 39 | <application>Ruby</application>,
|
---|
| 40 | <application>PHP</application>,
|
---|
| 41 | <application>Java</application>,
|
---|
| 42 | <application>C#</application>,
|
---|
| 43 | <application>D</application>,
|
---|
| 44 | <application>Go</application>,
|
---|
| 45 | <application>Lua</application>,
|
---|
| 46 | <application>Octave</application>,
|
---|
| 47 | <application>R</application>,
|
---|
| 48 | <application>Scheme</application>, and
|
---|
| 49 | <application>Ocaml</application>.
|
---|
| 50 | <application>SWIG</application> can
|
---|
[47c4c7d] | 51 | also export its parse tree into <application>Lisp</application>
|
---|
| 52 | s-expressions and <application>XML</application>.
|
---|
| 53 | </para>
|
---|
| 54 | <para>
|
---|
| 55 | <application>SWIG</application> reads annotated
|
---|
| 56 | <application>C/C++</application> header files and creates wrapper
|
---|
| 57 | code (glue code) in order to make the corresponding
|
---|
| 58 | <application>C/C++</application> libraries available to the listed
|
---|
| 59 | languages, or to extend <application>C/C++</application> programs
|
---|
| 60 | with a scripting language.
|
---|
| 61 | </para>
|
---|
| 62 |
|
---|
[9029db2] | 63 | &lfs101_checked;
|
---|
[47c4c7d] | 64 |
|
---|
| 65 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 66 | <itemizedlist spacing="compact">
|
---|
| 67 | <listitem>
|
---|
| 68 | <para>
|
---|
| 69 | Download (HTTP): <ulink url="&swig-download-http;"/>
|
---|
| 70 | </para>
|
---|
| 71 | </listitem>
|
---|
| 72 | <listitem>
|
---|
| 73 | <para>
|
---|
| 74 | Download (FTP): <ulink url="&swig-download-ftp;"/>
|
---|
| 75 | </para>
|
---|
| 76 | </listitem>
|
---|
| 77 | <listitem>
|
---|
| 78 | <para>
|
---|
| 79 | Download MD5 sum: &swig-md5sum;
|
---|
| 80 | </para>
|
---|
| 81 | </listitem>
|
---|
| 82 | <listitem>
|
---|
| 83 | <para>
|
---|
| 84 | Download size: &swig-size;
|
---|
| 85 | </para>
|
---|
| 86 | </listitem>
|
---|
| 87 | <listitem>
|
---|
| 88 | <para>
|
---|
| 89 | Estimated disk space required: &swig-buildsize;
|
---|
| 90 | </para>
|
---|
| 91 | </listitem>
|
---|
| 92 | <listitem>
|
---|
| 93 | <para>
|
---|
| 94 | Estimated build time: &swig-time;
|
---|
| 95 | </para>
|
---|
| 96 | </listitem>
|
---|
| 97 | </itemizedlist>
|
---|
| 98 |
|
---|
| 99 | <bridgehead renderas="sect3">SWIG Dependencies</bridgehead>
|
---|
| 100 |
|
---|
| 101 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 102 | <para role="required">
|
---|
| 103 | <xref linkend="pcre"/>
|
---|
| 104 | </para>
|
---|
| 105 |
|
---|
| 106 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 107 | <para role="optional">
|
---|
[31d0f0d] | 108 | <xref linkend="boost"/> for tests, and any of the languages mentioned
|
---|
[47c4c7d] | 109 | in the introduction, as run-time dependencies
|
---|
| 110 | </para>
|
---|
| 111 |
|
---|
| 112 | <para condition="html" role="usernotes">
|
---|
| 113 | User Notes: <ulink url="&blfs-wiki;/swig"/>
|
---|
| 114 | </para>
|
---|
| 115 | </sect2>
|
---|
| 116 |
|
---|
| 117 | <sect2 role="installation">
|
---|
| 118 | <title>Installation of SWIG</title>
|
---|
| 119 |
|
---|
| 120 | <para>
|
---|
| 121 | Install <application>SWIG</application> by running the following
|
---|
| 122 | commands:
|
---|
| 123 | </para>
|
---|
| 124 |
|
---|
[191b5a5] | 125 | <screen><userinput>./configure --prefix=/usr \
|
---|
[477418d2] | 126 | --without-maximum-compile-warnings &&
|
---|
[47c4c7d] | 127 | make</userinput></screen>
|
---|
| 128 |
|
---|
| 129 | <para>
|
---|
[3aee187] | 130 | To test the results, issue: <command>PY3=1 make -k check TCL_INCLUDE=</command>.
|
---|
[191b5a5] | 131 | The unsetting of the variable <envar>TCL_INCLUDE</envar> is
|
---|
| 132 | necessary since it is not correctly set by
|
---|
[5101276] | 133 | <emphasis>configure</emphasis>. The tests are only executed for the
|
---|
| 134 | languages installed on your machine, so the disk space and SBU values
|
---|
| 135 | given for the tests may vary, and should be considered as mere orders of
|
---|
[3aee187] | 136 | magnitude. <!-- Phase out P2 support
|
---|
| 137 | If you have <xref linkend="python2"/> installed, the Python-3
|
---|
[191b5a5] | 138 | tests are not run. You can run tests for Python-3 by issuing
|
---|
[a0e6e8dd] | 139 | <command>PY3=1 make check-python-examples</command> followed by
|
---|
[3aee187] | 140 | <command>PY3=1 make check-python-test-suite</command>. --> According to
|
---|
[a0e6e8dd] | 141 | <application>SWIG</application>'s documentation, the failure of some
|
---|
[5eb179fa] | 142 | tests should not be considered harmful. The go tests are buggy and may
|
---|
| 143 | generate a lot of meaningless output.
|
---|
[47c4c7d] | 144 | </para>
|
---|
| 145 |
|
---|
| 146 | <para>
|
---|
| 147 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 148 | </para>
|
---|
| 149 |
|
---|
| 150 | <screen role="root"><userinput>make install &&
|
---|
| 151 | install -v -m755 -d /usr/share/doc/swig-&swig-version; &&
|
---|
| 152 | cp -v -R Doc/* /usr/share/doc/swig-&swig-version;</userinput></screen>
|
---|
| 153 | </sect2>
|
---|
| 154 |
|
---|
| 155 | <sect2 role="commands">
|
---|
| 156 | <title>Command Explanations</title>
|
---|
| 157 |
|
---|
[477418d2] | 158 | <para>
|
---|
| 159 | <parameter>--without-maximum-compile-warnings</parameter>: disables
|
---|
| 160 | compiler ansi conformance enforcement, which triggers errors in
|
---|
| 161 | the <application>Lua</application> headers (starting with Lua 5.3).
|
---|
| 162 | </para>
|
---|
| 163 |
|
---|
[47c4c7d] | 164 | <para>
|
---|
| 165 | <option>--without-<language></option>: allows disabling the
|
---|
| 166 | building of tests and examples for <language>, but all the
|
---|
| 167 | languages capabilities of <application>SWIG</application> are always
|
---|
[cd074c2] | 168 | built. <!--We use it for <application>Clisp</application>, because the
|
---|
| 169 | SWIG implementation is very incomplete and a lot of tests fail. -->
|
---|
[47c4c7d] | 170 | </para>
|
---|
[5101276] | 171 |
|
---|
[47c4c7d] | 172 | </sect2>
|
---|
| 173 |
|
---|
| 174 | <sect2 role="content">
|
---|
| 175 | <title>Contents</title>
|
---|
| 176 |
|
---|
| 177 | <segmentedlist>
|
---|
| 178 | <segtitle>Installed Programs</segtitle>
|
---|
| 179 | <segtitle>Installed Library</segtitle>
|
---|
| 180 | <segtitle>Installed Directories</segtitle>
|
---|
| 181 |
|
---|
| 182 | <seglistitem>
|
---|
| 183 | <seg>
|
---|
| 184 | swig and ccache-swig
|
---|
| 185 | </seg>
|
---|
| 186 | <seg>
|
---|
| 187 | None
|
---|
| 188 | </seg>
|
---|
[8c7390c] | 189 | <seg>
|
---|
[10f9bb45] | 190 | /usr/share/doc/swig-&swig-version; and
|
---|
[5101276] | 191 | /usr/share/swig
|
---|
[47c4c7d] | 192 | </seg>
|
---|
| 193 | </seglistitem>
|
---|
| 194 | </segmentedlist>
|
---|
| 195 |
|
---|
| 196 | <variablelist>
|
---|
| 197 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 198 | <?dbfo list-presentation="list"?>
|
---|
| 199 | <?dbhtml list-presentation="table"?>
|
---|
| 200 |
|
---|
| 201 | <varlistentry id="swig-prog">
|
---|
| 202 | <term><command>swig</command></term>
|
---|
| 203 | <listitem>
|
---|
| 204 | <para>
|
---|
| 205 | takes an interface file containing C/C++ declarations and
|
---|
| 206 | SWIG special instructions, and generates the corresponding
|
---|
[4c24eb0a] | 207 | wrapper code needed to build extension modules
|
---|
[47c4c7d] | 208 | </para>
|
---|
| 209 | <indexterm zone="swig swig-prog">
|
---|
| 210 | <primary sortas="b-swig">swig</primary>
|
---|
| 211 | </indexterm>
|
---|
| 212 | </listitem>
|
---|
| 213 | </varlistentry>
|
---|
| 214 |
|
---|
| 215 | <varlistentry id="ccache-swig">
|
---|
| 216 | <term><command>ccache-swig</command></term>
|
---|
| 217 | <listitem>
|
---|
| 218 | <para>
|
---|
| 219 | is a compiler cache, which speeds up re-compilation of
|
---|
[4c24eb0a] | 220 | C/C++/SWIG code
|
---|
[47c4c7d] | 221 | </para>
|
---|
| 222 | <indexterm zone="swig ccache-swig">
|
---|
| 223 | <primary sortas="b-ccache-swig">ccache-swig</primary>
|
---|
| 224 | </indexterm>
|
---|
| 225 | </listitem>
|
---|
| 226 | </varlistentry>
|
---|
| 227 |
|
---|
| 228 | </variablelist>
|
---|
| 229 | </sect2>
|
---|
[4c24eb0a] | 230 |
|
---|
[47c4c7d] | 231 | </sect1>
|
---|