[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[47c4c7d] | 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 " ">
|
---|
[1c70c69a] | 9 | <!ENTITY swig-md5sum "6a0555a2063c78447c5912136f013c43">
|
---|
| 10 | <!ENTITY swig-size "8.2 MB">
|
---|
| 11 | <!ENTITY swig-buildsize "90 MB (2.2 GB with tests)">
|
---|
| 12 | <!ENTITY swig-time "0.1 SBU (add 8.4 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>,
|
---|
[31f55626] | 38 | <application>JavaScript</application>,
|
---|
[8558044] | 39 | <application>C#</application>,
|
---|
[191b5a5] | 40 | <application>D</application>,
|
---|
[8558044] | 41 | <application>Go</application>,
|
---|
[191b5a5] | 42 | <application>Lua</application>,
|
---|
[8558044] | 43 | <application>Octave</application>,
|
---|
[191b5a5] | 44 | <application>R</application>,
|
---|
[31f55626] | 45 | <application>Racket</application>,
|
---|
| 46 | <application>Scilab</application>,
|
---|
[191b5a5] | 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 |
|
---|
[57791dd] | 62 | &lfs122_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 | </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>
|
---|
[1c70c69a] | 127 | To test the results, issue: <command>make TCL_INCLUDE= -k check</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
|
---|
[44b3f440] | 133 | magnitude. According to
|
---|
[a0e6e8dd] | 134 | <application>SWIG</application>'s documentation, the failure of some
|
---|
[5eb179fa] | 135 | tests should not be considered harmful. The go tests are buggy and may
|
---|
| 136 | generate a lot of meaningless output.
|
---|
[47c4c7d] | 137 | </para>
|
---|
| 138 |
|
---|
| 139 | <para>
|
---|
| 140 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 141 | </para>
|
---|
| 142 |
|
---|
| 143 | <screen role="root"><userinput>make install &&
|
---|
[0d961439] | 144 | cp -v -R Doc -T /usr/share/doc/swig-&swig-version;</userinput></screen>
|
---|
[47c4c7d] | 145 | </sect2>
|
---|
| 146 |
|
---|
| 147 | <sect2 role="commands">
|
---|
| 148 | <title>Command Explanations</title>
|
---|
| 149 |
|
---|
[477418d2] | 150 | <para>
|
---|
| 151 | <parameter>--without-maximum-compile-warnings</parameter>: disables
|
---|
| 152 | compiler ansi conformance enforcement, which triggers errors in
|
---|
| 153 | the <application>Lua</application> headers (starting with Lua 5.3).
|
---|
| 154 | </para>
|
---|
| 155 |
|
---|
[47c4c7d] | 156 | <para>
|
---|
| 157 | <option>--without-<language></option>: allows disabling the
|
---|
| 158 | building of tests and examples for <language>, but all the
|
---|
| 159 | languages capabilities of <application>SWIG</application> are always
|
---|
[31f55626] | 160 | built. This switch is used for <application>JavaScript</application>
|
---|
| 161 | because the SWIG implementation is incomplete and a lot of tests fail
|
---|
| 162 | due to API changes in Node-20.
|
---|
[47c4c7d] | 163 | </para>
|
---|
[5101276] | 164 |
|
---|
[47c4c7d] | 165 | </sect2>
|
---|
| 166 |
|
---|
| 167 | <sect2 role="content">
|
---|
| 168 | <title>Contents</title>
|
---|
| 169 |
|
---|
| 170 | <segmentedlist>
|
---|
| 171 | <segtitle>Installed Programs</segtitle>
|
---|
| 172 | <segtitle>Installed Library</segtitle>
|
---|
| 173 | <segtitle>Installed Directories</segtitle>
|
---|
| 174 |
|
---|
| 175 | <seglistitem>
|
---|
| 176 | <seg>
|
---|
| 177 | swig and ccache-swig
|
---|
| 178 | </seg>
|
---|
| 179 | <seg>
|
---|
| 180 | None
|
---|
| 181 | </seg>
|
---|
[4e207bb] | 182 | <seg>
|
---|
[10f9bb45] | 183 | /usr/share/doc/swig-&swig-version; and
|
---|
[5101276] | 184 | /usr/share/swig
|
---|
[47c4c7d] | 185 | </seg>
|
---|
| 186 | </seglistitem>
|
---|
| 187 | </segmentedlist>
|
---|
| 188 |
|
---|
| 189 | <variablelist>
|
---|
| 190 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 191 | <?dbfo list-presentation="list"?>
|
---|
| 192 | <?dbhtml list-presentation="table"?>
|
---|
| 193 |
|
---|
| 194 | <varlistentry id="swig-prog">
|
---|
| 195 | <term><command>swig</command></term>
|
---|
| 196 | <listitem>
|
---|
| 197 | <para>
|
---|
| 198 | takes an interface file containing C/C++ declarations and
|
---|
| 199 | SWIG special instructions, and generates the corresponding
|
---|
[4c24eb0a] | 200 | wrapper code needed to build extension modules
|
---|
[47c4c7d] | 201 | </para>
|
---|
| 202 | <indexterm zone="swig swig-prog">
|
---|
| 203 | <primary sortas="b-swig">swig</primary>
|
---|
| 204 | </indexterm>
|
---|
| 205 | </listitem>
|
---|
| 206 | </varlistentry>
|
---|
| 207 |
|
---|
| 208 | <varlistentry id="ccache-swig">
|
---|
| 209 | <term><command>ccache-swig</command></term>
|
---|
| 210 | <listitem>
|
---|
| 211 | <para>
|
---|
| 212 | is a compiler cache, which speeds up re-compilation of
|
---|
[4c24eb0a] | 213 | C/C++/SWIG code
|
---|
[47c4c7d] | 214 | </para>
|
---|
| 215 | <indexterm zone="swig ccache-swig">
|
---|
| 216 | <primary sortas="b-ccache-swig">ccache-swig</primary>
|
---|
| 217 | </indexterm>
|
---|
| 218 | </listitem>
|
---|
| 219 | </varlistentry>
|
---|
| 220 |
|
---|
| 221 | </variablelist>
|
---|
| 222 | </sect2>
|
---|
[4c24eb0a] | 223 |
|
---|
[47c4c7d] | 224 | </sect1>
|
---|