Install Swig for Mac OS X

Swig is converter from C, C++ codes to several platforms(for example Java …)

In this term

  • Mac OS X(10.7)
  • Swig 2.0.11
  • PCRE 8.33

Linux Mint15 is also same steps(works fine) and need to add library path

Steps

  • Install pcre
  • Install swig

Install pcre

pcre is required to install Swig.
Please download and save anywhere
The way of installing is very straight forward

./configure
make 
sudo make install

To check it, please type following command

pcre-config --version

Install PCRE under /usr/local/lib

Install swig

Please download swig from web site
Swig is also easy to install

./configure
make 
sudo make install

Swig was installed under /usr/local/share/swig

Add Library Path of /usr/local/lib for PCRE(Linux)

Create ~/.bashrc and add LD_LIBRARY_PATH

LD_LIBRARY_PATH=/usr/local/lib:/usr/lib
export LD_LIBRARY_PATH