[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 " ">
|
---|
[5fbbb82] | 9 | <!ENTITY swig-md5sum "baac03a66f3194e5399d4c71d34df1e2">
|
---|
| 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 | <sect1info>
|
---|
| 19 | <date>$Date$</date>
|
---|
| 20 | </sect1info>
|
---|
| 21 |
|
---|
| 22 | <title>SWIG-&swig-version;</title>
|
---|
| 23 |
|
---|
| 24 | <indexterm zone="swig">
|
---|
| 25 | <primary sortas="a-swig">SWIG</primary>
|
---|
| 26 | </indexterm>
|
---|
| 27 |
|
---|
| 28 | <sect2 role="package">
|
---|
| 29 | <title>Introduction to SWIG</title>
|
---|
| 30 |
|
---|
| 31 | <para>
|
---|
| 32 | <application>SWIG</application> (Simplified Wrapper and Interface
|
---|
| 33 | Generator) is a compiler that integrates <application>C</application>
|
---|
| 34 | and <application>C++</application> with languages including
|
---|
[8558044] | 35 | <application>Perl</application>,
|
---|
[191b5a5] | 36 | <application>Python</application>,
|
---|
[8558044] | 37 | <application>Tcl</application>,
|
---|
[191b5a5] | 38 | <application>Ruby</application>,
|
---|
[8558044] | 39 | <application>PHP</application>,
|
---|
[191b5a5] | 40 | <application>Java</application>,
|
---|
[8558044] | 41 | <application>C#</application>,
|
---|
[191b5a5] | 42 | <application>D</application>,
|
---|
[8558044] | 43 | <application>Go</application>,
|
---|
[191b5a5] | 44 | <application>Lua</application>,
|
---|
[8558044] | 45 | <application>Octave</application>,
|
---|
[191b5a5] | 46 | <application>R</application>,
|
---|
| 47 | <application>Scheme</application>, and
|
---|
| 48 | <application>Ocaml</application>.
|
---|
| 49 | <application>SWIG</application> can
|
---|
[47c4c7d] | 50 | also export its parse tree into <application>Lisp</application>
|
---|
| 51 | s-expressions and <application>XML</application>.
|
---|
| 52 | </para>
|
---|
| 53 | <para>
|
---|
| 54 | <application>SWIG</application> reads annotated
|
---|
| 55 | <application>C/C++</application> header files and creates wrapper
|
---|
| 56 | code (glue code) in order to make the corresponding
|
---|
| 57 | <application>C/C++</application> libraries available to the listed
|
---|
| 58 | languages, or to extend <application>C/C++</application> programs
|
---|
| 59 | with a scripting language.
|
---|
| 60 | </para>
|
---|
| 61 |
|
---|
[8b225938] | 62 | &lfs112_checked;
|
---|
[47c4c7d] | 63 |
|
---|
| 64 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 65 | <itemizedlist spacing="compact">
|
---|
| 66 | <listitem>
|
---|
| 67 | <para>
|
---|
| 68 | Download (HTTP): <ulink url="&swig-download-http;"/>
|
---|
| 69 | </para>
|
---|
| 70 | </listitem>
|
---|
| 71 | <listitem>
|
---|
| 72 | <para>
|
---|
| 73 | Download (FTP): <ulink url="&swig-download-ftp;"/>
|
---|
| 74 | </para>
|
---|
| 75 | </listitem>
|
---|
| 76 | <listitem>
|
---|
| 77 | <para>
|
---|
| 78 | Download MD5 sum: &swig-md5sum;
|
---|
| 79 | </para>
|
---|
| 80 | </listitem>
|
---|
| 81 | <listitem>
|
---|
| 82 | <para>
|
---|
| 83 | Download size: &swig-size;
|
---|
| 84 | </para>
|
---|
| 85 | </listitem>
|
---|
| 86 | <listitem>
|
---|
| 87 | <para>
|
---|
| 88 | Estimated disk space required: &swig-buildsize;
|
---|
| 89 | </para>
|
---|
| 90 | </listitem>
|
---|
| 91 | <listitem>
|
---|
| 92 | <para>
|
---|
| 93 | Estimated build time: &swig-time;
|
---|
| 94 | </para>
|
---|
| 95 | </listitem>
|
---|
| 96 | </itemizedlist>
|
---|
| 97 |
|
---|
| 98 | <bridgehead renderas="sect3">SWIG Dependencies</bridgehead>
|
---|
| 99 |
|
---|
| 100 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 101 | <para role="required">
|
---|
[b5e2a6c] | 102 | <xref linkend="pcre2"/>
|
---|
[47c4c7d] | 103 | </para>
|
---|
| 104 |
|
---|
| 105 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 106 | <para role="optional">
|
---|
[31d0f0d] | 107 | <xref linkend="boost"/> for tests, and any of the languages mentioned
|
---|
[47c4c7d] | 108 | in the introduction, as run-time dependencies
|
---|
| 109 | </para>
|
---|
| 110 |
|
---|
| 111 | <para condition="html" role="usernotes">
|
---|
| 112 | User Notes: <ulink url="&blfs-wiki;/swig"/>
|
---|
| 113 | </para>
|
---|
| 114 | </sect2>
|
---|
| 115 |
|
---|
| 116 | <sect2 role="installation">
|
---|
| 117 | <title>Installation of SWIG</title>
|
---|
| 118 |
|
---|
| 119 | <para>
|
---|
| 120 | Install <application>SWIG</application> by running the following
|
---|
| 121 | commands:
|
---|
| 122 | </para>
|
---|
| 123 |
|
---|
[3ddcb52b] | 124 | <screen><userinput>./configure --prefix=/usr \
|
---|
| 125 | --without-javascript \
|
---|
[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. -->
|
---|
[3ddcb52b] | 170 | <!-- Now used for JavaScript because of node CLI changes -->
|
---|
[47c4c7d] | 171 | </para>
|
---|
[5101276] | 172 |
|
---|
[47c4c7d] | 173 | </sect2>
|
---|
| 174 |
|
---|
| 175 | <sect2 role="content">
|
---|
| 176 | <title>Contents</title>
|
---|
| 177 |
|
---|
| 178 | <segmentedlist>
|
---|
| 179 | <segtitle>Installed Programs</segtitle>
|
---|
| 180 | <segtitle>Installed Library</segtitle>
|
---|
| 181 | <segtitle>Installed Directories</segtitle>
|
---|
| 182 |
|
---|
| 183 | <seglistitem>
|
---|
| 184 | <seg>
|
---|
| 185 | swig and ccache-swig
|
---|
| 186 | </seg>
|
---|
| 187 | <seg>
|
---|
| 188 | None
|
---|
| 189 | </seg>
|
---|
[4e207bb] | 190 | <seg>
|
---|
[10f9bb45] | 191 | /usr/share/doc/swig-&swig-version; and
|
---|
[5101276] | 192 | /usr/share/swig
|
---|
[47c4c7d] | 193 | </seg>
|
---|
| 194 | </seglistitem>
|
---|
| 195 | </segmentedlist>
|
---|
| 196 |
|
---|
| 197 | <variablelist>
|
---|
| 198 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 199 | <?dbfo list-presentation="list"?>
|
---|
| 200 | <?dbhtml list-presentation="table"?>
|
---|
| 201 |
|
---|
| 202 | <varlistentry id="swig-prog">
|
---|
| 203 | <term><command>swig</command></term>
|
---|
| 204 | <listitem>
|
---|
| 205 | <para>
|
---|
| 206 | takes an interface file containing C/C++ declarations and
|
---|
| 207 | SWIG special instructions, and generates the corresponding
|
---|
[4c24eb0a] | 208 | wrapper code needed to build extension modules
|
---|
[47c4c7d] | 209 | </para>
|
---|
| 210 | <indexterm zone="swig swig-prog">
|
---|
| 211 | <primary sortas="b-swig">swig</primary>
|
---|
| 212 | </indexterm>
|
---|
| 213 | </listitem>
|
---|
| 214 | </varlistentry>
|
---|
| 215 |
|
---|
| 216 | <varlistentry id="ccache-swig">
|
---|
| 217 | <term><command>ccache-swig</command></term>
|
---|
| 218 | <listitem>
|
---|
| 219 | <para>
|
---|
| 220 | is a compiler cache, which speeds up re-compilation of
|
---|
[4c24eb0a] | 221 | C/C++/SWIG code
|
---|
[47c4c7d] | 222 | </para>
|
---|
| 223 | <indexterm zone="swig ccache-swig">
|
---|
| 224 | <primary sortas="b-ccache-swig">ccache-swig</primary>
|
---|
| 225 | </indexterm>
|
---|
| 226 | </listitem>
|
---|
| 227 | </varlistentry>
|
---|
| 228 |
|
---|
| 229 | </variablelist>
|
---|
| 230 | </sect2>
|
---|
[4c24eb0a] | 231 |
|
---|
[47c4c7d] | 232 | </sect1>
|
---|