1 SWIG (Simplified Wrapper and Interface Generator)
 
   2 Version 1.1 (Maintenance)
 
   4 Copyright (C) 1995-1999
 
   5 University of Utah and the Regents of the University of California
 
  11 SWIG is a compiler that attempts to make it easy to integrate C, C++,
 
  12 or Objective-C code with scripting languages including Perl, Tcl, and
 
  13 Python.  In a nutshell, you give it a bunch of ANSI C/C++ declarations
 
  14 and it generates an interface between C and your favorite scripting
 
  15 language.  However, this is only scratching the surface of what SWIG
 
  16 can do--some of its more advanced features include automatic
 
  17 documentation generation, module and library management, extensive
 
  18 customization options, and more.
 
  20 SWIG is entirely the product of users who have used the system and
 
  21 suggested new ideas.  There are far too many people to thank
 
  22 individually, but without this support, SWIG would be not be nearly as
 
  23 powerful or fun to use as it is now. Many thanks!
 
  25 2.   Currently Supported Languages
 
  26 ----------------------------------
 
  28 To use SWIG, you will need at least one of the following scripting
 
  31         Tcl7.3, Tk3.6  (and all newer versions)
 
  32         Tcl8.0, Tk8.0  (somewhat experimental)
 
  36         FSF Guile 1.0 (experimental)
 
  38 If you don't have any of these, SWIG will still compile, but it won't
 
  39 be particularly useful.  Note : it is not necessary to have *all* of
 
  40 these languages installed to use SWIG--only the scripting languages you
 
  43 3.   Installation (Unix)
 
  44 ------------------------
 
  46 To compile and use SWIG, you will need the following on your machine:
 
  48         A C++ compiler  (ie. g++)
 
  49         An ANSI C compiler (ie. gcc)
 
  50         yacc or bison (only needed if you are going to rebuild the SWIG parser)
 
  52 To compile and install SWIG, type the following :
 
  56         make runtime      (optional. see below)
 
  59 The configuration script will attempt to locate various packages on
 
  60 your machine, including Tcl, Perl5, and Python.   Don't panic if
 
  61 you get 'not found' messages--SWIG does not need these packages
 
  62 to compile or run.   The configure script is actually looking for 
 
  63 these packages so that you can try out the SWIG examples contained
 
  64 in the 'Examples' directory without having to hack Makefiles.
 
  65 See the Examples section below for more details. 
 
  67 The 'make runtime' option is an optional step that can be used to
 
  68 build the SWIG runtime libraries.  These libraries are only used with
 
  69 larger packages and are not necessary for learning SWIG or trying
 
  70 the examples (please refer to the "Advanced topics" section of the
 
  71 SWIG Users manual for more details about this).
 
  73 Typing 'make test' will run a rather extensive series of tests
 
  74 and can be run before running 'make install' (if you are paranoid).
 
  76 There are a number of configuration options that you can give to
 
  81           Set the installation prefix.  SWIG installs into
 
  82           /usr/local by default.
 
  84         --exec_prefix=/usr/local
 
  86           Set the prefix used to install platform specific
 
  87           files (binaries and libraries).  Use this if the
 
  88           location is different than that given with --prefix.
 
  90         --with-lang={TCL,TCL8,PYTHON,PERL5,PERL4,GUILE}
 
  92           This lets you choose the default SWIG target language.
 
  93           By default, SWIG chooses TCL, but you can select
 
  96                 ./configure --with-lang=PYTHON
 
  98         --with-doc={ASCII,LATEX,HTML,NODOC}
 
 100           This lets you choose the default SWIG documentation
 
 101           method.  By default, SWIG chooses ASCII.
 
 104 4.   Site specific installation
 
 105 -------------------------------
 
 107 While not required for compiling SWIG, the configuration script looks
 
 108 for various packages in order to create a makefile for compiling the
 
 109 examples.  This makefile is also installed with the SWIG package.
 
 110 The following configuration options can be used to set the location
 
 113 --with-tcl=pathname          - Set root directory of Tcl installation.
 
 114                                SWIG will use $pathname/include and
 
 117 --with-tclincl=pathname      - Set exact location of Tcl include files
 
 119 --with-tcllib=pathname       - Set exact location of Tcl library files
 
 121 --with-itcl=pathname         - Same as above but for [incr Tcl]
 
 123 --with-itclincl=pathname     - Location of [incr Tcl] include files
 
 125 --with-itcllib=pathname      - Location of [incr Tcl] libraries
 
 127 --with-py=pathname           - Set package location of Python. This is usually
 
 128                                something like /usr/local.  configure will attempt
 
 129                                to locate the appropriate include and library files.
 
 131 --with-pyincl=pathname       - Set location of Python include files 
 
 132                                (for example, /usr/local/include)
 
 134 --with-pylib=pathname        - Set location of Python library files
 
 135                                (for example, /usr/local/lib)
 
 137 --with-perl5=executable      - Specify your perl5 executable.  SWIG will figure
 
 138                                out where files are by running this version of 
 
 139                                Perl and grabbing its configuration data.
 
 144 --without-yacc               - Try to compile SWIG using a pregenerated YACC
 
 145                                file generated by Berkeley YACC (byacc). Only recommended
 
 146                                if you get compiler errors when trying to compile parser.y
 
 149 Changing the C++ compiler:
 
 151 By default, SWIG will look for g++.  You can change the C++ compile as follows :
 
 153         env CXX=CC configure --prefix=/usr/local ... etc...
 
 158         ./configure ... etc ...
 
 160 SWIG has been successfully compiled and tested under g++, the SGI C++
 
 161 compiler, and the SunPro C++ compiler.  
 
 165 The SWIG parser and language modules can be tested by typing 'make test'.
 
 166 Be forewarned, this runs a large collection of tests on all of SWIG's
 
 167 language modules and documentation methods.  The tests may take 5-10
 
 168 minutes to run, but a report of errors will be written to 'test.log'.
 
 169 If this exists, it will contain error messages for failed tests. If
 
 170 the file is missing, it means all tests were considered successful.
 
 172 The testing process requires approximately 30-40 Mbytes of disk space.
 
 173 After testing, you may wish to type 'make testclean' which will
 
 174 return the testing directory to its original state.
 
 176 Note : The testing procedure requires both 'sh' and 'perl'.  If you
 
 177 don't have these installed, some of the tests won't work.
 
 179 6. Installation for Windows 95 and NT
 
 180 -------------------------------------
 
 182 The Win directory contains makefiles for Microsoft Visual C++ 4.x/5.x and
 
 183 Borland C++.  See the README.txt file in the Win directory for specific
 
 184 build instructions.  Many thanks to Kevin Butler (butler@cs.byu.edu)
 
 185 and Pier Giorgio Esposito for supplying these Makefiles.
 
 187 7. Installation for Macintosh
 
 188 -----------------------------
 
 190 A Macintosh version of SWIG is available separately as a PowerPC
 
 191 executable.  A source version is also available, but is somewhat
 
 192 complicated to build due to dependencies on other packages 
 
 193 including Tcl 8.0.   Please refer to the SWIG homepage for more
 
 199 The 'Examples' directory contains examples for all of the supported
 
 200 scripting languages. All of the examples rely on the file
 
 201 'Makefile.template' located in the top-level directory.  This makefile
 
 202 is created by 'configure', but the configuration process is not
 
 203 foolproof.  To check this Makefile type
 
 207 This will attempt to build various kinds of extensions and report its
 
 208 success or failure.  If this fails, you may need to edit the file
 
 209 'Makefile.template' by hand.  This usually isn't difficult--just
 
 210 follow the instructions contained within the file.  Once the 'make
 
 211 testbuild' works for the language you are interested in using, you
 
 212 should be able to build the examples.
 
 214 The examples will not compile properly if you have not installed SWIG.
 
 215 If you would like to try the examples before installation, set the
 
 216 SWIG_LIB environment variable as follows :
 
 218       setenv SWIG_LIB ${pathname}/SWIG1.1/swig_lib
 
 220 Where ${pathname} the location of the SWIG source.
 
 222 *** NOTE *** If you are replacing an older version of SWIG with a new
 
 223 one, the examples may not compile correctly unless you set the
 
 224 above environment variable or do a 'make install' first.
 
 229 Up-to-date SWIG related information can be found at
 
 233 SWIG source code and software updates are also available via anonymous
 
 239 You can join the SWIG mailing list by going to the following location:
 
 241         http://www.cs.uchicago.edu/mailman/listinfo/swig 
 
 243 The SWIG mailing list is a forum for discussing various applications
 
 244 of SWIG, installation problems, ideas for system improvements and
 
 247 *** NEWSFLASH ***  SWIG development has moved to the Univerity of
 
 248 Chicago.  Developer information can be found at 
 
 250         http://swig.cs.uchicago.edu
 
 252 10.  Installation Problems
 
 253 -------------------------
 
 255 As far as I know the installation works on the following platforms :
 
 271 SWIG development takes place primarily on Linux and Solaris 2.6.  I've
 
 272 tested most of the examples on these platforms.  I have also tested
 
 273 SWIG under Win95 and MacOS, but that is still somewhat experimental.
 
 275 If you've tried everything and can't get SWIG to compile, please send
 
 276 me e-mail at beazley@cs.uchicago.edu, and we'll try to figure it out.
 
 277 I try to answer all e-mail that I receive.  However, occasionally I
 
 278 receive messages with bad return addresses and can't respond.  If you
 
 279 don't hear back within a few days, try sending a message to
 
 280 'swig@cs.uchicago.edu'.
 
 285 Over 300 pages of documentation describing almost every aspect of SWIG
 
 286 is available in the Doc directory.  Don't let the amount of
 
 287 documentation scare you--SWIG is easy enough to use that you can
 
 288 probably start using it by only looking at a few simple examples.
 
 289 However, at some point you will probably want to know more so I hope
 
 290 that the manual will come in useful.  Besides, I hate black boxes...
 
 292 The documentation is distributed in Adobe PDF format and can be viewed
 
 293 using the Adobe Acrobat Reader.  Acrobat is available for virtually
 
 294 all machines and can be freely obtained from Adobe at www.adobe.com.
 
 295 Postscript and HTML versions of the manual are also available from the
 
 298 12.  Incompatibilities
 
 299 ---------------------
 
 301 This release should be mostly compatible with SWIG 1.0
 
 302 (Final). However, the SWIG documentation system has been completely
 
 303 rewritten and the C API has been changed greatly.  It is unlikely that
 
 304 any custom SWIG language modules written in C++ for 1.0 will work with
 
 305 1.1.  While porting to 1.1 is not that difficult, there are a number
 
 306 of important changes.  See the file 'Doc/Porting' for a list of
 
 307 changes to the C++ API and how to convert an older SWIG module to work
 
 313 Bug reports should be submitted to the online bug-tracking system
 
 314 which is available at :
 
 316    http://swig.cs.uchicago.edu/cgi-bin/swig
 
 318 Before submitting a bug, please check this site to see if it has
 
 319 already been reported.  If not, provide as much information as
 
 320 possible including the SWIG version number, operating system, and
 
 321 compiler being used.  Note : I tend to fix bugs in batches and may
 
 322 only respond to a bug report when it has actually been fixed---posting
 
 323 to the mailing list is often a better way to get an immediate response
 
 328 SWIG is completely free and non-proprietary.  You can do whatever you
 
 329 want with it (including distribution), provided that you follow these
 
 330 rules, 1) Keep all of the copyright notices intact, 2) don't claim
 
 331 that you wrote it, and 3) Don't sue anyone if it breaks.  Otherwise,
 
 337 While I believe that SWIG is reasonably stable, I'm always tinkering
 
 338 with it and trying to make it better.  There may be a few bugs hiding
 
 339 around so if you experience any problems let me know.  If you think
 
 340 that SWIG is missing some capability that would be useful to have
 
 341 have, post a message on the SWIG mailing list.  Most of the previous
 
 342 suggestions have already been incorporated into this release.
 
 345 ---------------------
 
 347 SWIG would not be possible without the contributions of people who
 
 348 tried out the beta versions and offered feedback and bug reports.
 
 349 While there are far too many people to list at point, I'd like to
 
 350 especially acknowledge the following individuals and organizations
 
 351 for supporting SWIG and making major contributions :
 
 353 David Ascher, Erik Bierwagen, Kurtis Bleeker, John Buckman, Kevin
 
 354 Butler, Pier Giorgio Esposito, David Fletcher, Mark Hammond, Mark
 
 355 Harrison, Brad Holian, Gary Holt, Chris Johnson, Peter Lomdahl, Mark
 
 356 Lutz, Chris Myers, Paul Saxe, John Schmidt, Tom Schwaller, Peter-Pike
 
 357 Sloan, Patrick Tullmann, Larry Virden, Tser-Yuan Yang, Shujia Zhou.
 
 361 Los Alamos National Laboratory
 
 362 Lawrence Livermore National Laboratory
 
 363 Cornell Theory Center
 
 365 The Scientific Computing and Imaging Group (University of Utah)
 
 367 (My apologies to anyone I missed...)
 
 369 If you find SWIG to be useful, I'd like to know about it.
 
 374 Department of Computer Science
 
 375 University of Chicago
 
 377 beazley@cs.uchicago.edu