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