Skip to content

Instantly share code, notes, and snippets.

Last active Nov 29, 2016
What would you like to do?
Setting up libRETS with SWIG

Setting up libRETS with SWIG


Goal: Get a working SWIG build of the latest libRETS.

This setup will use Ubuntu with vagrant, a tool for creating development environments with virtual machines on Mac, GNU/Linux, and Windows.

Initial setup:

# See included Vagrantfile.
vagrant up
vagrant ssh
sudo apt-get update && sudo apt-get dist-upgrade
vagrant halt
vagrant up
vagrant ssh
sudo apt-get install autoconf build-essential
sudo apt-get install git

Prepare build:

# vagrant ssh
sudo apt-get install libboost-all-dev libcurl4-openssl-dev openjdk-7-jdk
# Additional dependencies not caught by libRETS configure:
sudo apt-get install libdb-dev libbz2-dev
git clone

... and SWIG. First download SWIG 3.0.10 on the host machine (because sourceforge is easier to download in the web browser than curl, given its mirrors) into the same directory that has the Vagrantfile, then:

# vagrant ssh
cd /vagrant/
md5sum swig-3.0.10.tar.gz # bb4ab8047159469add7d00910e203124
tar -xf swig-3.0.10.tar.gz
cd swig-3.0.10
sudo apt-get build-dep swig
./configure --prefix=/usr --without-clisp --without-maximum-compile-warnings
sudo make install


# vagrant ssh
cd ~/libRETS/
git checkout 1.6.2
./configure --prefix=/usr # Reports language support, e.g.: With Python 3: yes
sudo make install

As a simple test, python3 -m librets will have empty output if it finds the librets import and will report an error if it cannot.

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = "ubuntu/trusty64" # Requires vagrant 1.5+ for vagrantcloud.
config.vm.define 'rets-box' do |machine|
machine.vm.hostname = 'rets-box'
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
config.ssh.forward_agent = true :forwarded_port, guest: 22, host: 2222, id: 'ssh', auto_correct: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment