1SWIG (Simplified Wrapper and Interface Generator) 2 3Version: 1.3.40 (18 August 2009) 4 5Tagline: SWIG is a compiler that integrates C and C++ with languages 6 including Perl, Python, Tcl, Ruby, PHP, Java, Ocaml, Lua, 7 Scheme (Guile, MzScheme, CHICKEN), Pike, C#, Modula-3, 8 Common Lisp (CLISP, Allegro CL, CFFI, UFFI), Octave and R. 9 10SWIG reads annotated C/C++ header files and creates wrapper code (glue 11code) in order to make the corresponding C/C++ libraries available to 12the listed languages, or to extend C/C++ programs with a scripting 13language. 14 15This distribution represents the latest development release of SWIG. 16The guilty parties working on this are: 17 18Active Developers: 19 William Fulton (wsf@fultondesigns.co.uk) (SWIG core, Java, C#, Windows, Cygwin) 20 Olly Betts (olly@survex.com) (PHP) 21 John Lenz (Guile, MzScheme updates, Chicken module, runtime system) 22 Mark Gossage (mark@gossage.cjb.net) (Lua) 23 Joseph Wang (joequant@gmail.com) (R) 24 Gonzalo Garramuno (ggarra@advancedsl.com.ar) (Ruby, Ruby's UTL) 25 Xavier Delacour (xavier.delacour@gmail.com) (Octave) 26 27Major contributors include: 28 Dave Beazley (dave-swig@dabeaz.com) (SWIG core, Python, Tcl, Perl) 29 Henning Thielemann (swig@henning-thielemann.de) (Modula3) 30 Matthias K�ppe (mkoeppe@mail.math.uni-magdeburg.de) (Guile, MzScheme) 31 Luigi Ballabio (luigi.ballabio@fastwebnet.it) (STL wrapping) 32 Mikel Bancroft (mikel@franz.com) (Allegro CL) 33 Surendra Singhi (efuzzyone@netscape.net) (CLISP, CFFI) 34 Marcelo Matus (mmatus@acms.arizona.edu) (SWIG core, Python, UTL[python,perl,tcl,ruby]) 35 Art Yerkes (ayerkes@speakeasy.net) (Ocaml) 36 Lyle Johnson (lyle@users.sourceforge.net) (Ruby) 37 Charlie Savage (cfis@interserv.com) (Ruby) 38 Thien-Thi Nguyen (ttn@glug.org) (build/test/misc) 39 Richard Palmer (richard@magicality.org) (PHP) 40 Sam Liddicott - Anonova Ltd (saml@liddicott.com) (PHP) 41 Tim Hockin - Sun Microsystems (thockin@sun.com) (PHP) 42 Kevin Ruland (PHP) 43 Shibukawa Yoshiki (Japanese Translation) 44 Jason Stewart (jason@openinformatics.com) (Perl5) 45 Loic Dachary (Perl5) 46 David Fletcher (Perl5) 47 Gary Holt (Perl5) 48 Masaki Fukushima (Ruby) 49 Scott Michel (scottm@cs.ucla.edu) (Java directors) 50 Tiger Feng (songyanf@cs.uchicago.edu) (SWIG core) 51 Mark Rose (mrose@stm.lbl.gov) (Directors) 52 Jonah Beckford (beckford@usermail.com) (CHICKEN) 53 Ahmon Dancy (dancy@franz.com) (Allegro CL) 54 Dirk Gerrits (Allegro CL) 55 Neil Cawse (C#) 56 Harco de Hilster (Java) 57 Alexey Dyachenko (dyachenko@fromru.com) (Tcl) 58 Bob Techentin (Tcl) 59 Martin Froehlich <MartinFroehlich@ACM.org> (Guile) 60 Marcio Luis Teixeira <marciot@holly.colostate.edu> (Guile) 61 Duncan Temple Lang (R) 62 Miklos Vajna <vmiklos@frugalware.org> (PHP directors) 63 64Past contributors include: 65 James Michael DuPont, Clark McGrew, Dustin Mitchell, Ian Cooke, Catalin Dumitrescu, Baran 66 Kovuk, Oleg Tolmatcev, Tal Shalif, Lluis Padro, Chris Seatory, Igor Bely, Robin Dunn 67 (See CHANGES for a more complete list). 68 69Portions also copyrighted by companies/corporations; 70 Network Applied Communication Laboratory, Inc 71 Information-technology Promotion Agency, Japan 72 73Up-to-date SWIG related information can be found at 74 75 http://www.swig.org 76 77A SWIG FAQ and other hints can be found on the SWIG Wiki: 78 79 http://www.dabeaz.com/cgi-bin/wiki.pl 80 81 82!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 83!!!!!!! IMPORTANT !!!!!!! 84!!!!!!! !!!!!!! 85!!!!!!! Previous SWIG-1.1 users should read the documentation !!!!!!! 86!!!!!!! file Doc/Manual/SWIG.html before trying to use SWIG-1.3!!!!!!! 87!!!!!!! on existing SWIG interfaces. This is the most current !!!!!!! 88!!!!!!! documentation that describes new 1.3 features and !!!!!!! 89!!!!!!! incompatibilities. !!!!!!! 90!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 91 92What's New? 93=========== 94 95SWIG-1.3.40 summary: 96- SWIG now supports directors for PHP. 97- PHP support improved in general. 98- Octave 3.2 support added. 99- Various bug fixes/enhancements for Allegrocl, C#, Java, Octave, Perl, 100 Python, Ruby and Tcl. 101- Other generic fixes and minor new features. 102 103SWIG-1.3.39 summary: 104- Some new small feature enhancements. 105- Improved C# std::vector wrappers. 106- Bug fixes: mainly Python, but also Perl, MzScheme, CFFI, Allegrocl 107 and Ruby 108 109SWIG-1.3.38 summary: 110- Output directory regression fix and other minor bug fixes 111 112SWIG-1.3.37 summary: 113- Python 3 support added 114- SWIG now ships with a version of ccache that can be used with SWIG. 115 This enables the files generated by SWIG to be cached so that repeated 116 use of SWIG on unchanged input files speeds up builds quite considerably. 117- PHP 4 support removed and PHP support improved in general 118- Improved C# array support 119- Numerous Allegro CL improvements 120- Bug fixes/enhancements for Python, PHP, Java, C#, Chicken, Allegro CL, 121 CFFI, Ruby, Tcl, Perl, R, Lua. 122- Other minor generic bug fixes and enhancements 123 124SWIG-1.3.36 summary: 125- Enhancement to directors to wrap all protected members 126- Optimisation feature for objects returned by value 127- A few bugs fixes in the PHP, Java, Ruby, R, C#, Python, Lua and 128 Perl modules 129- Other minor generic bug fixes 130 131SWIG-1.3.35 summary: 132- Octave language module added 133- Bug fixes in Python, Lua, Java, C#, Perl modules 134- A few other generic bugs and runtime assertions fixed 135 136SWIG-1.3.34 summary: 137- shared_ptr support for Python 138- Support for latest R - version 2.6 139- Various minor improvements/bug fixes for R, Lua, Python, Java, C# 140- A few other generic bug fixes, mainly for templates and using statements 141 142SWIG-1.3.33 summary: 143- Fix regression for Perl where C++ wrappers would not compile 144- Fix regression parsing macros 145 146SWIG-1.3.32 summary: 147- shared_ptr support for Java and C# 148- Enhanced STL support for Ruby 149- Windows support for R 150- Fixed long-standing memory leak in PHP Module 151- Numerous fixes and minor enhancements for Allegrocl, C#, cffi, Chicken, Guile, 152 Java, Lua, Ocaml, Perl, PHP, Python, Ruby, Tcl. 153- Improved warning support 154 155SWIG-1.3.31 summary: 156- Python modern classes regression fix 157 158SWIG-1.3.30 summary: 159- Python-2.5 support 160- New language module: R 161- Director support added for C# 162- Numerous director fixes and improvements 163- Improved mingw/msys support 164- Better constants support in Guile and chicken modules 165- Support for generating PHP5 class wrappers 166- Important Java premature garbage collection fix 167- Minor improvements/fixes in cffi, php, allegrocl, perl, chicken, lua, ruby, 168 ocaml, python, java, c# and guile language modules 169- Many many other bug fixes 170 171SWIG-1.3.29 summary: 172- Numerous important bug fixes 173- Few minor new features 174- Some performance improvements in generated code for Python 175 176SWIG-1.3.28 summary: 177- More powerful renaming (%rename) capability. 178- More user friendly warning handling. 179- Add finer control for default constructors and destructors. We discourage 180 the use of the 'nodefault' option, which disables both constructors and 181 destructors, leading to possible memory leaks. Use instead 'nodefaultctor' 182 and/or 'nodefaultdtor'. 183- Automatic copy constructor wrapper generation via the 'copyctor' option/feature. 184- Better handling of Windows extensions and types. 185- Better runtime error reporting. 186- Add the %catches directive to catch and dispatch exceptions. 187- Add the %naturalvar directive for more 'natural' variable wrapping. 188- Better default handling of std::string variables using the %naturalvar directive. 189- Add the %allowexcept and %exceptionvar directives to handle exceptions when 190 accessing a variable. 191- Add the %delobject directive to mark methods that act like destructors. 192- Add the -fastdispatch option to enable smaller and faster overload dispatch 193 mechanism. 194- Template support for %rename, %feature and %typemap improved. 195- Add/doc more debug options, such as -dump_module, -debug_typemaps, etc. 196- Unified typemap library (UTL) potentially providing core typemaps for all 197 scripting languages based on the recently evolving Python typemaps. 198- New language module: Common Lisp with CFFI. 199- Python, Ruby, Perl and Tcl use the new UTL, many old reported and hidden 200 errors with typemaps are now fixed. 201- Initial Java support for languages using the UTL via GCJ, you can now use 202 Java libraries in your favorite script language using gcj + swig. 203- Tcl support for std::wstring. 204- PHP4 module update, many error fixes and actively maintained again. 205- Allegrocl support for C++, also enhanced C support. 206- Ruby support for bang methods. 207- Ruby support for user classes as native exceptions. 208- Perl improved dispatching in overloaded functions via the new cast and rank 209 mechanism. 210- Perl improved backward compatibility, 5.004 and later tested and working. 211- Python improved backward compatibility, 1.5.2 and later tested and working. 212- Python can use the same cast/rank mechanism via the -castmode option. 213- Python implicit conversion mechanism similar to C++, via the %implicitconv 214 directive (replaces and improves the implicit.i library). 215- Python threading support added. 216- Python STL support improved, iterators are supported and STL containers can 217 use now the native PyObject type. 218- Python many performance options and improvements, try the -O option to test 219 all of them. Python runtime benchmarks show up to 20 times better performance 220 compared to 1.3.27 and older versions. 221- Python support for 'multi-inheritance' on the python side. 222- Python simplified proxy classes, now swig doesn't need to generate the 223 additional 'ClassPtr' classes. 224- Python extended support for smart pointers. 225- Python better support for static member variables. 226- Python backward compatibility improved, many projects that used to work 227 only with swig-1.3.21 to swig-1.3.24 are working again with swig-1.3.28 228- Python test-suite is now 'valgrinded' before release, and swig also 229 reports memory leaks due to missing destructors. 230- Minor bug fixes and improvements to the Lua, Ruby, Java, C#, Python, Guile, 231 Chicken, Tcl and Perl modules. 232 233SWIG-1.3.27 summary: 234- Fix bug in anonymous typedef structures which was leading to strange behaviour 235 236SWIG-1.3.26 summary: 237- New language modules: Lua, CLISP and Common Lisp with UFFI. 238- Big overhaul to the PHP module. 239- Change to the way 'extern' is handled. 240- Minor bug fixes specific to C#, Java, Modula3, Ocaml, Allegro CL, 241 XML, Lisp s-expressions, Tcl, Ruby and Python modules. 242- Other minor improvements and bug fixes. 243 244SWIG-1.3.25 summary: 245- Improved runtime type system. Speed of module loading improved in 246 modules with lots of types. SWIG_RUNTIME_VERSION has been increased 247 from 1 to 2, but the API is exactly the same; only internal changes 248 were made. 249- The languages that use the runtime type system now support external 250 access to the runtime type system. 251- Various improvements with typemaps and template handling. 252- Fewer warnings in generated code. 253- Improved colour documentation. 254- Many C# module improvements (exception handling, prevention of early 255 garbage collection, C# attributes support added, more flexible type 256 marshalling/asymmetric types.) 257- Minor improvements and bug fixes specific to the C#, Java, TCL, Guile, 258 Chicken, MzScheme, Perl, Php, Python, Ruby and Ocaml modules). 259- Various other bug fixes and memory leak fixes. 260 261SWIG-1.3.24 summary: 262- Improved enum handling 263- More runtime library options 264- More bugs fixes for templates and template default arguments, directors 265 and other areas. 266- Better smart pointer support, including data members, static members 267 and %extend. 268 269SWIG-1.3.23 summary: 270- Improved support for callbacks 271- Python docstring support and better error handling 272- C++ default argument support for Java and C# added. 273- Improved c++ default argument support for the scripting languages plus 274 option to use original (compact) default arguments. 275- %feature and %ignore/%rename bug fixes and mods - they might need default 276 arguments specified to maintain compatible behaviour when using the new 277 default arguments wrapping. 278- Runtime library changes: Runtime code can now exist in more than one module 279 and so need not be compiled into just one module 280- Further improved support for templates and namespaces 281- Overloaded templated function support added 282- More powerful default typemaps (mixed default typemaps) 283- Some important %extend and director code bug fixes 284- Guile now defaults to using SCM API. The old interface can be obtained by 285 the -gh option. 286- Various minor improvements and bug fixes for C#, Chicken, Guile, Java, 287 MzScheme, Perl, Python and Ruby 288- Improved dependencies generation for constructing Makefiles. 289 290SWIG-1.3.22 summary: 291- Improved exception handling and translation of C errors or C++ 292 exceptions into target language exceptions. 293- Improved enum support, mapping to built-in Java 1.5 enums and C# 294 enums or the typesafe enum pattern for these two languages. 295- Python - much better STL suppport and support for std::wstring, 296 wchar_t and FILE *. 297- Initial support for Modula3 and Allegro CL. 298- 64 bit TCL support. 299- Java and C#'s proxy classes are now nearly 100% generated from 300 typemaps and/or features for finer control on the generated code. 301- SWIG runtime library support deprecation. 302- Improved documentation. SWIG now additionally provides documentation 303 in the form of a single HTML page as well as a pdf document. 304- Enhanced C++ friend declaration support. 305- Better support for reference counted classes. 306- Various %fragment improvements. 307- RPM fixes. 308- Various minor improvements and bug fixes for C#, Chicken, Guile, Java, 309 MzScheme, Perl, Php, Python, Ruby and XML. 310 311 312The SWIG-1.3.x development releases offer a huge number of improvements 313over older SWIG-1.1 releases. These improvements include: 314 315 - Support for C++ overloaded functions and methods. 316 - Support for C++ smart pointers. 317 - Support for C++ namespaces 318 - Support for C++ overloaded operators. 319 - Support for C++ templates including member templates. 320 - Support for C++ template specialization and partial specialization. 321 - Support for C++ friend declarations. 322 - Parsing support for almost all C/C++ datatypes. 323 - Automatic translation of C++ exception specifiers. 324 - Contract support. 325 - A full C preprocessor with macro expansion. Includes C99 variadic macros. 326 - Java, Ruby, MzScheme, PHP4, OCAML, Pike, CHICKEN, XML and C# modules 327 added. Guile module improved. 328 - Director support - upcalls for C++ virtual functions into the target 329 language proxy class. 330 - Better code generation. SWIG is better able to make optimizations 331 in order to generate less code. 332 - Testing framework part of the distribution ("make -k check" support). 333 - A lot of minor bug fixes and cleanup. 334 - Better Windows support. 335 336If you used SWIG-1.1, a number of old features are missing from SWIG-1.3. 337 338 - The SWIG-1.1 documentation system is gone and hasn't been 339 replaced yet. This is on the long-term to-do list. 340 341 - The Tcl7.x and Perl4 modules are deprecated and no longer 342 included. 343 344 - A wide variety of old SWIG command-line options and 345 obscure features are gone. 346 347 - A lot of old %pragma directives and obscure undocumented 348 customization features have been eliminated. The same 349 functionality is now available through other means. 350 351 - Objective C support doesn't work right now. No ETA as to 352 when it will return. 353 354Although we are making some attempt to preserve backwards 355compatibility with interfaces written for SWIG-1.1, SWIG-1.3 356incorporates a number of very substantial modifications to type 357handling, typemaps, and wrapper code generation. Therefore, if you 358are making extensive use of advanced SWIG features, interfaces written 359for SWIG-1.1 may not work. We apologize for the inconvenience, but 360these changes are needed in order to fix a number of annoying 361"features" in SWIG-1.1. Hopefully the list of new features will 362provide enough incentive for you to upgrade (and that the 363modifications to your interfaces will only be minor). 364 365In addition, SWIG-1.3 makes no attempt to be compatible with SWIG-1.1 at 366the C++ API level so language modules written for SWIG-1.1 will most 367definitely not work with this release. 368 369See the documentation for details of the SWIG_VERSION preprocessor 370symbol if you have backward compatibility issues and need to use more 371than one version of SWIG. 372 373The files NEW and CHANGES describe in some detail all of the important 374changes that have been made to the system. Experienced users would be 375well advised to read this. 376 377Release Notes 378============= 379Please see the CHANGES files for a detailed list of bug fixes and 380new features. A summary of the changes is included in this README file. 381 382Windows Installation 383==================== 384Please see the Doc/Manual/Windows.html file for instructions on installing 385SWIG on Windows and running the examples. The Windows distribution is 386called swigwin and includes a prebuilt SWIG executable, swig.exe, included in 387the same directory as this README file. Otherwise it is exactly the same as 388the main SWIG distribution. There is no need to download anything else. 389 390Unix Installation 391================= 392You must use GNU `make' to build SWIG. 393 394http://www.gnu.org/software/make/ 395 396To build and install SWIG, simply type the following: 397 398 % ./configure 399 % make 400 % make install 401 402By default SWIG installs itself in /usr/local. If you need to install SWIG in 403a different location or in your home directory, use the --prefix option 404to ./configure. For example: 405 406 % ./configure --prefix=/home/yourname/projects 407 % make 408 % make install 409 410Note: the directory given to --prefix must be an absolute pathname. Do *NOT* use 411the ~ shell-escape to refer to your home directory. SWIG won't work properly 412if you do this. 413 414The file INSTALL details more about using configure. Also try 415 416 % ./configure --help. 417 418The configure script will attempt to locate various packages on your machine 419including Tcl, Perl5, Python and all the other target languages that SWIG 420uses. Don't panic if you get 'not found' messages--SWIG does not need these 421packages to compile or run. The configure script is actually looking for 422these packages so that you can try out the SWIG examples contained 423in the 'Examples' directory without having to hack Makefiles. 424 425Please see the Documentation section below on installing documentation as 426none is installed by default. 427 428SWIG used to include a set of runtime libraries for some languages for working 429with multiple modules. These are no longer built during the installation stage. 430However, users can build them just like any wrapper module as described in 431the documentation, Doc/Manual/Modules.html. The CHANGES file also lists some 432examples which build the runtime library. 433 434Notes: 435 436(1) If you checked the code out via SVN, you will have to run ./autogen.sh 437 before typing 'configure'. In addition, a full build of SWIG requires 438 the use of bison. 439 440Macintosh OS X Installation 441============================ 442SWIG is known to work on various flavors of OS X. Follow the Unix installation 443instructions above. However, as of this writing, there is still great deal of 444inconsistency with how shared libaries are handled by various scripting languages 445on OS X. We've tried to resolve these differences to the extent of our knowledge. 446This release was most recently checked with the Panther release of OS X on a 447Macintosh G5 system. Your mileage may vary. 448 449Users of OS X should be aware that Darwin handles shared libraries and linking in 450a radically different way than most Unix systems. In order to test SWIG and run 451the examples, SWIG configures itself to use flat namespaces and to allow undefined 452symbols (-flat_namespace -undefined suppress). This mostly closely follows the Unix 453model and makes it more likely that the SWIG examples will work with whatever 454installation of software you might have. However, this is generally not the recommended 455technique for building larger extension modules. Instead, you should utilize 456Darwin's two-level namespaces. Some details about this can be found here 457 458http://developer.apple.com/documentation/ReleaseNotes/DeveloperTools/TwoLevelNamespaces.html 459 460Needless to say, you might have to experiment a bit to get things working at first. 461 462Testing 463======= 464If you want to test SWIG before installation, type the following: 465 466 % make -k check 467 468'make -k check' requires at least one of the target languages to be 469installed. If it fails, it may mean that you have an uninstalled 470language module or that the file 'Examples/Makefile' has been 471incorrectly configured. It may also fail due to compiler issues such 472as broken C++ compiler. Even if 'make -k check' fails, there is a 473pretty good chance SWIG still works correctly---you will just have to 474mess around with one of the examples and some makefiles to get it to work. 475 476The testing suite executed by 'make -k check' is designed to stress-test 477many parts of the implementation including obscure corner cases. If some 478of these tests fail or generate warning messages, there is no reason for 479alarm---the test may be related to some new SWIG feature or a difficult bug 480that we're trying to resolve. Chances are that SWIG will work just fine 481for you. Note that if you have more than one CPU/core, then you can use 482parallel make can be used to speed up the check as it does take quite some 483time to run, for example: 484 485 % make -j2 -k check 486 487Also, SWIG's support for C++ is sufficiently advanced that certain 488tests may fail on older C++ compilers (for instance if your compiler 489does not support member templates). These errors are harmless if you 490don't intend to use these features in your own programs. 491 492Note: The test-suite currently contains around 250 tests. If you 493have many different target languages installed and a slow machine, it 494might take more than an hour to run the test-suite. 495 496Examples 497======== 498The Examples directory contains a variety of examples of using SWIG 499and it has some browsable documentation. Simply point your browser to 500the file "Example/index.html". 501 502The Examples directory also includes Visual C++ project (.dsp) files for 503building some of the examples on Windows. 504 505Known Issues 506============ 507There are minor known bugs, details of which are in the bug tracker, see 508http://www.swig.org/bugs.html. 509 510Troubleshooting 511=============== 512In order to operate correctly, SWIG relies upon a set of library 513files. If after building SWIG, you get error messages like this, 514 515 % swig foo.i 516 :1. Unable to find 'swig.swg' 517 :3. Unable to find 'tcl8.swg' 518 519it means that SWIG has either been incorrectly configured or 520installed. To fix this: 521 522 1. Make sure you remembered to do a 'make install' and that 523 the installation actually worked. Make sure you have 524 write permission on the install directory. 525 526 2. If that doesn't work, type 'swig -swiglib' to find out 527 where SWIG thinks its library is located. 528 529 3. If the location is not where you expect, perhaps 530 you supplied a bad option to configure. Use 531 ./configure --prefix=pathname to set the SWIG install 532 location. Also, make sure you don't include a shell 533 escape character such as ~ when you specify the path. 534 535 4. The SWIG library can be changed by setting the SWIG_LIB 536 environment variable. However, you really shouldn't 537 have to do this. 538 539If you are having other troubles, you might look at the SWIG Wiki at 540http://www.dabeaz.com/cgi-bin/wiki.pl. 541 542Documentation 543============= 544The Doc/Manual directory contains the most recent set of updated 545documentation for this release. The documentation is available in 546three different formats, each of which contains identical content. 547These format are, pdf (SWIGDocumentation.pdf), single 548page html (Doc/Manual/SWIGDocumentation.html) or multiple page html 549(other files in Doc/Manual). Please select your chosen format and 550copy/install to wherever takes your fancy. 551 552This is a development release and the documentation is largely, but 553not entirely up to date. We are working on it, but there 554was a lot of old documentation and it is taking some time to 555update and complete. Please be patient or volunteer to help. 556 557There is some technical developer documentation available in the 558Doc/Devel subdirectory. This is not necessarily up-to-date, but it 559has some information on SWIG internals. 560 561Participate! 562============ 563Please report any errors and submit patches (if possible)! We only 564have access to a limited variety of hardware (Linux, Solaris, OS-X, 565and Windows). All contributions help. 566 567If you would like to join the SWIG development team or contribute a 568language module to the distribution, please contact the swig-dev 569mailing list, details at http://www.swig.org/mail.html. 570 571 572 -- The SWIG Maintainers 573 574 575 576