SWIG-1.3 Documentation SWIG-1.3 Documentation Table of Contents SWIG-1.3 Development Documentation

Total Page:16

File Type:pdf, Size:1020Kb

SWIG-1.3 Documentation SWIG-1.3 Documentation Table of Contents SWIG-1.3 Development Documentation SWIG-1.3 Documentation SWIG-1.3 Documentation Table of Contents SWIG-1.3 Development Documentation...........................................................................................................................................1 Sections...................................................................................................................................................................................1 SWIG Core Documentation............................................................................................................................................1 Language Module Documentation..................................................................................................................................1 Developer Documentation...............................................................................................................................................1 Documentation that has not yet been updated.................................................................................................................2 1 Preface...............................................................................................................................................................................................3 1.1 Introduction.......................................................................................................................................................................3 1.2 Special Introduction for Version 1.3................................................................................................................................3 1.3 SWIG Versions.................................................................................................................................................................3 1.4 SWIG resources................................................................................................................................................................3 1.5 Prerequisites......................................................................................................................................................................4 1.6 Organization of this manual..............................................................................................................................................4 1.7 How to avoid reading the manual.....................................................................................................................................4 1.8 Backwards Compatibility.................................................................................................................................................4 1.9 Credits...............................................................................................................................................................................5 1.10 Bug reports......................................................................................................................................................................5 2 Introduction......................................................................................................................................................................................6 2.1 What is SWIG?.................................................................................................................................................................6 2.2 Why use SWIG?...............................................................................................................................................................6 2.3 A SWIG example..............................................................................................................................................................7 2.3.1 SWIG interface file.................................................................................................................................................7 2.3.2 The swig command.................................................................................................................................................8 2.3.3 Building a Perl5 module.........................................................................................................................................8 2.3.4 Building a Python module......................................................................................................................................8 2.3.5 Shortcuts.................................................................................................................................................................9 2.4 Supported C/C++ language features.................................................................................................................................9 2.5 Non-intrusive interface building.....................................................................................................................................10 2.6 Incorporating SWIG into a build system........................................................................................................................10 2.7 Hands off code generation..............................................................................................................................................10 2.8 SWIG and freedom.........................................................................................................................................................11 3 Getting started on Windows..........................................................................................................................................................12 3.1 Installation on Windows.................................................................................................................................................12 3.1.1 Windows Executable............................................................................................................................................12 3.2 SWIG Windows Examples.............................................................................................................................................12 3.2.1 Instructions for using the Examples with Visual Studio......................................................................................12 3.2.1.1 C#...............................................................................................................................................................13 3.2.1.2 Java.............................................................................................................................................................13 3.2.1.3 Perl.............................................................................................................................................................13 3.2.1.4 Python.........................................................................................................................................................13 3.2.1.5 TCL............................................................................................................................................................13 3.2.1.6 R.................................................................................................................................................................13 3.2.1.7 Ruby...........................................................................................................................................................14 3.2.2 Instructions for using the Examples with other compilers...................................................................................14 3.3 SWIG on Cygwin and MinGW......................................................................................................................................14 3.3.1 Building swig.exe on Windows............................................................................................................................14 3.3.1.1 Building swig.exe using MinGW and MSYS............................................................................................14 3.3.1.2 Building swig.exe using Cygwin...............................................................................................................15 3.3.1.3 Building swig.exe alternatives...................................................................................................................15 3.3.2 Running the examples on Windows using Cygwin..............................................................................................15 3.4 Microsoft extensions and other Windows quirks...........................................................................................................15 i SWIG-1.3 Documentation Table of Contents 4 Scripting Languages......................................................................................................................................................................16 4.1 The two language view of the world..............................................................................................................................16 4.2 How does a scripting language talk to C?......................................................................................................................16 4.2.1 Wrapper functions................................................................................................................................................17 4.2.2 Variable linking....................................................................................................................................................17
Recommended publications
  • Gpsbabel Documentation Gpsbabel Documentation Table of Contents
    GPSBabel Documentation GPSBabel Documentation Table of Contents Introduction to GPSBabel ................................................................................................... xx The Problem: Too many incompatible GPS file formats ................................................... xx The Solution ............................................................................................................ xx 1. Getting or Building GPSBabel .......................................................................................... 1 Downloading - the easy way. ....................................................................................... 1 Building from source. .................................................................................................. 1 2. Usage ........................................................................................................................... 3 Invocation ................................................................................................................. 3 Suboptions ................................................................................................................ 4 Advanced Usage ........................................................................................................ 4 Route and Track Modes .............................................................................................. 5 Working with predefined options .................................................................................. 6 Realtime tracking ......................................................................................................
    [Show full text]
  • The Shogun Machine Learning Toolbox
    The Shogun Machine Learning Toolbox Heiko Strathmann, Gatsby Unit, UCL London Open Machine Learning Workshop, MSR, NY August 22, 2014 A bit about Shogun I Open-Source tools for ML problems I Started 1999 by SÖren Sonnenburg & GUNnar Rätsch, made public in 2004 I Currently 8 core-developers + 20 regular contributors I Purely open-source community driven I In Google Summer of Code since 2010 (29 projects!) Ohloh - Summary Ohloh - Code Supervised Learning Given: x y n , want: y ∗ x ∗ I f( i ; i )gi=1 j I Classication: y discrete I Support Vector Machine I Gaussian Processes I Logistic Regression I Decision Trees I Nearest Neighbours I Naive Bayes I Regression: y continuous I Gaussian Processes I Support Vector Regression I (Kernel) Ridge Regression I (Group) LASSO Unsupervised Learning Given: x n , want notion of p x I f i gi=1 ( ) I Clustering: I K-Means I (Gaussian) Mixture Models I Hierarchical clustering I Latent Models I (K) PCA I Latent Discriminant Analysis I Independent Component Analysis I Dimension reduction I (K) Locally Linear Embeddings I Many more... And many more I Multiple Kernel Learning I Structured Output I Metric Learning I Variational Inference I Kernel hypothesis testing I Deep Learning (whooo!) I ... I Bindings to: LibLinear, VowpalWabbit, etc.. http://www.shogun-toolbox.org/page/documentation/ notebook Some Large-Scale Applications I Splice Site prediction: 50m examples of 200m dimensions I Face recognition: 20k examples of 750k dimensions ML in Practice I Modular data represetation I Dense, Sparse, Strings, Streams, ... I Multiple types: 8-128 bit word size I Preprocessing tools I Evaluation I Cross-Validation I Accuracy, ROC, MSE, ..
    [Show full text]
  • The Machine That Builds Itself: How the Strengths of Lisp Family
    Khomtchouk et al. OPINION NOTE The Machine that Builds Itself: How the Strengths of Lisp Family Languages Facilitate Building Complex and Flexible Bioinformatic Models Bohdan B. Khomtchouk1*, Edmund Weitz2 and Claes Wahlestedt1 *Correspondence: [email protected] Abstract 1Center for Therapeutic Innovation and Department of We address the need for expanding the presence of the Lisp family of Psychiatry and Behavioral programming languages in bioinformatics and computational biology research. Sciences, University of Miami Languages of this family, like Common Lisp, Scheme, or Clojure, facilitate the Miller School of Medicine, 1120 NW 14th ST, Miami, FL, USA creation of powerful and flexible software models that are required for complex 33136 and rapidly evolving domains like biology. We will point out several important key Full list of author information is features that distinguish languages of the Lisp family from other programming available at the end of the article languages and we will explain how these features can aid researchers in becoming more productive and creating better code. We will also show how these features make these languages ideal tools for artificial intelligence and machine learning applications. We will specifically stress the advantages of domain-specific languages (DSL): languages which are specialized to a particular area and thus not only facilitate easier research problem formulation, but also aid in the establishment of standards and best programming practices as applied to the specific research field at hand. DSLs are particularly easy to build in Common Lisp, the most comprehensive Lisp dialect, which is commonly referred to as the “programmable programming language.” We are convinced that Lisp grants programmers unprecedented power to build increasingly sophisticated artificial intelligence systems that may ultimately transform machine learning and AI research in bioinformatics and computational biology.
    [Show full text]
  • Omnipresent and Low-Overhead Application Debugging
    Omnipresent and low-overhead application debugging Robert Strandh [email protected] LaBRI, University of Bordeaux Talence, France ABSTRACT application programmers as opposed to system programmers. The state of the art in application debugging in free Common The difference, in the context of this paper, is that the tech- Lisp implementations leaves much to be desired. In many niques that we suggest are not adapted to debugging the cases, only a backtrace inspector is provided, allowing the system itself, such as the compiler. Instead, throughout this application programmer to examine the control stack when paper, we assume that, as far as the application programmer an unhandled error is signaled. Most such implementations do is concerned, the semantics of the code generated by the not allow the programmer to set breakpoints (unconditional compiler corresponds to that of the source code. or conditional), nor to step the program after it has stopped. In this paper, we are mainly concerned with Common Furthermore, even debugging tools such as tracing or man- Lisp [1] implementations distributed as so-called FLOSS, i.e., ually calling break are typically very limited in that they do \Free, Libre, and Open Source Software". While some such not allow the programmer to trace or break in important sys- implementations are excellent in terms of the quality of the tem functions such as make-instance or shared-initialize, code that the compiler generates, most leave much to be simply because these tools impact all callers, including those desired when it comes to debugging tools available to the of the system itself, such as the compiler.
    [Show full text]
  • What Is an Operating System III 2.1 Compnents II an Operating System
    Page 1 of 6 What is an Operating System III 2.1 Compnents II An operating system (OS) is software that manages computer hardware and software resources and provides common services for computer programs. The operating system is an essential component of the system software in a computer system. Application programs usually require an operating system to function. Memory management Among other things, a multiprogramming operating system kernel must be responsible for managing all system memory which is currently in use by programs. This ensures that a program does not interfere with memory already in use by another program. Since programs time share, each program must have independent access to memory. Cooperative memory management, used by many early operating systems, assumes that all programs make voluntary use of the kernel's memory manager, and do not exceed their allocated memory. This system of memory management is almost never seen any more, since programs often contain bugs which can cause them to exceed their allocated memory. If a program fails, it may cause memory used by one or more other programs to be affected or overwritten. Malicious programs or viruses may purposefully alter another program's memory, or may affect the operation of the operating system itself. With cooperative memory management, it takes only one misbehaved program to crash the system. Memory protection enables the kernel to limit a process' access to the computer's memory. Various methods of memory protection exist, including memory segmentation and paging. All methods require some level of hardware support (such as the 80286 MMU), which doesn't exist in all computers.
    [Show full text]
  • The Glib/GTK+ Development Platform
    The GLib/GTK+ Development Platform A Getting Started Guide Version 0.8 Sébastien Wilmet March 29, 2019 Contents 1 Introduction 3 1.1 License . 3 1.2 Financial Support . 3 1.3 Todo List for this Book and a Quick 2019 Update . 4 1.4 What is GLib and GTK+? . 4 1.5 The GNOME Desktop . 5 1.6 Prerequisites . 6 1.7 Why and When Using the C Language? . 7 1.7.1 Separate the Backend from the Frontend . 7 1.7.2 Other Aspects to Keep in Mind . 8 1.8 Learning Path . 9 1.9 The Development Environment . 10 1.10 Acknowledgments . 10 I GLib, the Core Library 11 2 GLib, the Core Library 12 2.1 Basics . 13 2.1.1 Type Definitions . 13 2.1.2 Frequently Used Macros . 13 2.1.3 Debugging Macros . 14 2.1.4 Memory . 16 2.1.5 String Handling . 18 2.2 Data Structures . 20 2.2.1 Lists . 20 2.2.2 Trees . 24 2.2.3 Hash Tables . 29 2.3 The Main Event Loop . 31 2.4 Other Features . 33 II Object-Oriented Programming in C 35 3 Semi-Object-Oriented Programming in C 37 3.1 Header Example . 37 3.1.1 Project Namespace . 37 3.1.2 Class Namespace . 39 3.1.3 Lowercase, Uppercase or CamelCase? . 39 3.1.4 Include Guard . 39 3.1.5 C++ Support . 39 1 3.1.6 #include . 39 3.1.7 Type Definition . 40 3.1.8 Object Constructor . 40 3.1.9 Object Destructor .
    [Show full text]
  • Irmx® 286/Irmx® II Troubleshooting Guide
    iRMX® 286/iRMX® II Troubleshooting Guide Q1/1990 Order Number: 273472-001 inter iRMX® 286/iRMX® II Troubleshooting Guide Q1/1990 Order Number: 273472-001 Intel Corporation 2402 W. Beardsley Road Phoenix, Arizona Mailstop DV2-42 Intel Corporation (UK) Ltd. Pipers Way Swindon, Wiltshire SN3 1 RJ United Kingdom Intel Japan KK 5-6 Tokodai, Toyosato-machi Tsukuba-gun Ibaragi-Pref. 300-26 An Intel Technical Report from Technical Support Operations Copyright ©1990, Intel Corporation Copyright ©1990, Intel Corporation The information in this document is subject to change without notice. Intel Corporation makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Intel Corporation assumes no responsibility for any errors that ~ay :!ppe3r in this d~ur:::ent. Intel Corpomtion make:; nc ccmmitmcut tv update nor to keep C"l..iiTeilt thc information contained in this document. Intel Corporation assUmes no responsibility for the use of any circuitry other than circuitry embodied in an Intel product. No other circuit patent licenses are implied. Intel software products are copyrighted by and shall remain the property of Intel Corporation. Use, duplication or disclosure is subject to restrictions stated in Intel's software license, or as defined in FAR 52.227-7013. No part of this document may be copied or reproduced in any form or by any means without the prior written consent of Intel Corporation. The following are trademarks of Intel Corporation
    [Show full text]
  • CONNX Installation Guide Version 11.5
    CONNX Installation Guide Version 11.5 Table Of Contents Preface .......................................................................................................................................................... 1 About the Installation Guide .......................................................................................................................... 1 Database Terminology .................................................................................................................................. 2 Installation Overview ..................................................................................................................................... 3 CONNX Installation Checklist ....................................................................................................................... 4 Upgrade Installation Checklist ...................................................................................................................... 5 Displaying Your CONNX Version .................................................................................................................. 6 To display the CONNX version and build numbers ............................................................................... 6 How CONNX Works ...................................................................................................................................... 7 Related Topics ......................................................................................................................................
    [Show full text]
  • Allegro CL User Guide
    Allegro CL User Guide Volume 1 (of 2) version 4.3 March, 1996 Copyright and other notices: This is revision 6 of this manual. This manual has Franz Inc. document number D-U-00-000-01-60320-1-6. Copyright 1985-1996 by Franz Inc. All rights reserved. No part of this pub- lication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means electronic, mechanical, by photocopying or recording, or otherwise, without the prior and explicit written permission of Franz incorpo- rated. Restricted rights legend: Use, duplication, and disclosure by the United States Government are subject to Restricted Rights for Commercial Software devel- oped at private expense as specified in DOD FAR 52.227-7013 (c) (1) (ii). Allegro CL and Allegro Composer are registered trademarks of Franz Inc. Allegro Common Windows, Allegro Presto, Allegro Runtime, and Allegro Matrix are trademarks of Franz inc. Unix is a trademark of AT&T. The Allegro CL software as provided may contain material copyright Xerox Corp. and the Open Systems Foundation. All such material is used and distrib- uted with permission. Other, uncopyrighted material originally developed at MIT and at CMU is also included. Appendix B is a reproduction of chapters 5 and 6 of The Art of the Metaobject Protocol by G. Kiczales, J. des Rivieres, and D. Bobrow. All this material is used with permission and we thank the authors and their publishers for letting us reproduce their material. Contents Volume 1 Preface 1 Introduction 1.1 The language 1-1 1.2 History 1-1 1.3 Format
    [Show full text]
  • SWIG and Ruby
    SWIG and Ruby David Grayson Las Vegas Ruby Meetup 2014-09-10 SWIG ● SWIG stands for: Simplified Wrapper and Interface Generator ● SWIG helps you access C or C++ code from 22 different languages, including Ruby SWIG inputs and outputs Ruby C extension SWIG interface file (.i) source (.c or .cxx) Simple C++ example libdavid.h: libdavid.i #include <stdio.h> %module "david" class David %{ { #include <libdavid.h> public: %} David(int x) { class David this->x = x; { } public: David(int x); void announce() void announce(); { int x; }; printf("David %d\n", x); } int x; }; Compiling Simple C++ example extconf.rb require 'mkmf' system('swig -c++ -ruby libdavid.i') or abort create_makefile('david') Commands to run: $ ruby extconf.rb # create libdavid_wrap.cxx and Makefile $ make # compile david.so $ irb -r./david # try it out irb(main):001:0> d = David::David.new(4) => #<David::David:0x007f40090a5280 @__swigtype__="_p_David"> irb(main):002:0> d.announce David 4 => nil (This example worked for me with SWIG 3.0.2 and Ruby 2.1.2.) That example was pretty simple ● All code was in a .h file ● No external libraries ● Simple data types ● No consideration of deployment ...but SWIG has tons of features C: C++: ● All ISO C datatypes ● All C++ datatypes ● Global functions ● References ● Global variables, constants ● Pointers to members ● Structures and unions ● Classes ● Pointers ● (Multiple) inheritance ● (Multidimensional) arrays ● Overloaded functions ● Pointers to functions ● Overloaded methods ● Variable length arguments ● Overloaded operators ● Typedefs ● Static members ● Enums ● Namespaces ● Templates ● Nested classes ... SWIG Typemaps ● Define custom ways to map between scripting- language types and C++ types. ● Can be used to add and remove parameters from of exposed functions.
    [Show full text]
  • CS 151: Introduction to Computers
    Information Technology: Introduction to Computers Handout One Computer Hardware 1. Components a. System board, Main board, Motherboard b. Central Processing Unit (CPU) c. RAM (Random Access Memory) SDRAM. DDR-RAM, RAMBUS d. Expansion cards i. ISA - Industry Standard Architecture ii. PCI - Peripheral Component Interconnect iii. PCMCIA - Personal Computer Memory Card International Association iv. AGP – Accelerated Graphics Port e. Sound f. Network Interface Card (NIC) g. Modem h. Graphics Card (AGP – accelerated graphics port) i. Disk drives (A:\ floppy diskette; B:\ obsolete 5.25” floppy diskette; C:\Internal Hard Disk; D:\CD-ROM, CD-R/RW, DVD-ROM/R/RW (Compact Disk-Read Only Memory) 2. Peripherals a. Monitor b. Printer c. Keyboard d. Mouse e. Joystick f. Scanner g. Web cam Operating system – a collection of files and small programs that enables input and output. The operating system transforms the computer into a productive entity for human use. BIOS (Basic Input Output System) date, time, language, DOS – Disk Operating System Windows (Dual, parallel development for home and industry) Windows 3.1 Windows 3.11 (Windows for Workgroups) Windows 95 Windows N. T. (Network Technology) Windows 98 Windows N. T. 4.0 Windows Me Windows 2000 Windows XP Home Windows XP Professional The Evolution of Windows Early 80's IBM introduced the Personal PC using the Intel 8088 processor and Microsoft's Disk Operating System (DOS). This was a scaled down computer aimed at business which allowed a single user to execute a single program. Many changes have been introduced over the last 20 years to bring us to where we are now.
    [Show full text]
  • PHP Beyond the Web Shell Scripts, Desktop Software, System Daemons and More
    PHP Beyond the web Shell scripts, desktop software, system daemons and more Rob Aley This book is for sale at http://leanpub.com/php This version was published on 2013-11-25 This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do. ©2012 - 2013 Rob Aley Tweet This Book! Please help Rob Aley by spreading the word about this book on Twitter! The suggested hashtag for this book is #phpbeyondtheweb. Find out what other people are saying about the book by clicking on this link to search for this hashtag on Twitter: https://twitter.com/search?q=#phpbeyondtheweb Contents Welcome ............................................ i About the author ...................................... i Acknowledgements ..................................... ii 1 Introduction ........................................ 1 1.1 “Use PHP? We’re not building a website, you know!”. ............... 1 1.2 Are you new to PHP? ................................. 2 1.3 Reader prerequisites. Or, what this book isn’t .................... 3 1.4 An important note for Windows and Mac users ................... 3 1.5 About the sample code ................................ 4 1.6 External resources ................................... 4 1.7 Book formats/versions available, and access to updates ............... 5 1.8 English. The Real English. .............................. 5 2 Getting away from the Web - the basics ......................... 6 2.1 PHP without a web server .............................. 6 2.2 PHP versions - what’s yours? ............................. 7 2.3 A few good reasons NOT to do it in PHP ...................... 8 2.4 Thinking about security ...............................
    [Show full text]