Difference between revisions of "Swig"

From PLplotWiki
Jump to: navigation, search
(fix case)
(Instructions for Mac OS X)
 
(4 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
== Instructions for Mac OS X ==
 
== Instructions for Mac OS X ==
  
N/A
+
* The SWIG executable which is provided by Apple (''/usr/bin/swig'', version 1.3.31) is too old, at least for the [[lua|Lua]] bindings. For Python and Java there is maybe no need to install a new version of SWIG.
 +
* Download [http://sourceforge.net/projects/swig/files/swig/swig-1.3.40/swig-1.3.40.tar.gz/download SWIG 1.3.40 tar file]
 +
* Untar ''swig-1.3.40.tar.gz'' into a folder of your choice
 +
* Cd into the folder and create a build folder
 +
mkdir build
 +
cd build
 +
* Configure, build and install SWIG. Omit the ''--prefix'' flag if you intend to install swig in the standard path (''/usr/local'')
 +
./configure --prefix=$HOME/local/swig-1.3.40
 +
make && make install
 +
* If you installed SWIG to a nonstandard location add the bin directory to the path by editing your ''.profile'' file in your home directory. Add the following lines
 +
# add swig to PATH
 +
export PATH=$HOME/local/swig-1.3.40/bin:$PATH
  
 
== Instructions for Linux ==
 
== Instructions for Linux ==

Latest revision as of 01:39, 19 August 2009

Description

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of languages including common scripting languages such as Perl, PHP, Python, Tcl and Ruby.

Instructions for Mac OS X

  • The SWIG executable which is provided by Apple (/usr/bin/swig, version 1.3.31) is too old, at least for the Lua bindings. For Python and Java there is maybe no need to install a new version of SWIG.
  • Download SWIG 1.3.40 tar file
  • Untar swig-1.3.40.tar.gz into a folder of your choice
  • Cd into the folder and create a build folder
mkdir build
cd build
  • Configure, build and install SWIG. Omit the --prefix flag if you intend to install swig in the standard path (/usr/local)
./configure --prefix=$HOME/local/swig-1.3.40
make && make install
  • If you installed SWIG to a nonstandard location add the bin directory to the path by editing your .profile file in your home directory. Add the following lines
# add swig to PATH
export PATH=$HOME/local/swig-1.3.40/bin:$PATH

Instructions for Linux

N/A

Instructions for Windows

  • Download SWIG zip
  • Unzip swigwin-1.3.36.zip into a folder of your choice

Set CMake paths

  • set environment variables (for MinGW and Visual C++) and add SWIG directory to PATH
set SWIGDIR=C:\tools\swigwin-1.3.36
set PATH=%SWIGDIR%;%PATH%
set CMAKE_INCLUDE_PATH=%SWIGDIR%\lib;%CMAKE_INCLUDE_PATH%

CMake is now able to find SWIG.