Skip to content

Instantly share code, notes, and snippets.

@dmpeters
Created July 15, 2014 21:56
Show Gist options
  • Save dmpeters/2e5a968ce78953fc66c2 to your computer and use it in GitHub Desktop.
Save dmpeters/2e5a968ce78953fc66c2 to your computer and use it in GitHub Desktop.
librets installations with python bindings only
# Debian 7 x64, Ubuntu 14.04 x64, Ubuntu 12.04.4 x64
*NOTE (tested on Digital Ocean VM's w/ > 512MB of RAM - gcc runs out of memory on VM's <= 512 MB)
apt-get update
aptitude safe-upgrade
apt-get install build-essential libboost-all-dev libcurl4-gnutls-dev autoconf antlr swig python-dev
*NOTE (for python 3 support add 'python3-dev' to the end of line 5)
cd /tmp
wget https://github.com/NationalAssociationOfRealtors/libRETS/archive/1.6.1.tar.gz
tar xzf 1.6.1.tar.gz
cd libRETS-1.6.1
./autogen.sh
./configure --disable-perl --disable-ruby --disable-java --disable-dotnet --disable-php --enable-shared_dependencies
make
make install
# To Test
python
import librets
dir(librets)
librets.RETS_1_7_2
librets.RETS_1_8
librets.RETS_1_8_0
@mikesparr
Copy link

Great for ubuntu. Will create issue on main repo for Homebrew formula issue, but suggestions appreciated:

All current formulae in boneyard and I updated one local and fails (others all reference dead crt.realtors.org address btw):

require 'formula'

class Librets < Formula
  homepage 'http://code.crt.realtors.org/projects/librets'
  url 'https://github.com/NationalAssociationOfRealtors/libRETS/archive/1.6.1.tar.gz'
  sha1 '0078524e12ced0ac98c472c8a9e69c8d12d24546'

  depends_on 'swig'
  depends_on 'boost'

  def install
    system "./configure", "--disable-debug",
                          "--enable-shared_dependencies",
                          "--prefix=#{prefix}",
                          "--disable-dotnet",
                          "--disable-perl",
                          "--disable-php",
                          "--disable-ruby"
    system "make"
    system "make install"
  end
end

This fails and unsure why. Boost installs (not the 1.49 like 1.5.3 dependencies, but 1.56.0 installs).

@mikesparr
Copy link

Homebrew formula working after missing autoconf dependency, running xcode-select --install, adding autoconf.sh. Make issue remains but closer: https://gist.github.com/mikesparr/5609e549cf30726facc3

UPDATE: now working and permissions issue copying to site-packages/ directory owned by root:wheel. Install doesn't seem to work without higher-level permissions so I had to change owner for the folder to get install to work (without moving brew to root and using sudo).

@SpencerCooley
Copy link

gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-4.8/README.Bugs for instructions.
error: command 'gcc' failed with exit status 4
make[1]: *** [build/swig/python/_librets.so] Error 1
make[1]: Leaving directory `/tmp/libRETS-1.6.1'
make: *** [all] Error 2

I get this error when I run 'make'

any idea of why this might be happening?

-------update-------
my bad, not enough memory on my machine. If you get this error just boost your memory.

Thanks a lot for posting there instructions!

@daveroma
Copy link

daveroma commented Jul 9, 2016

I followed your instructions in librets_install.txt and am getting an import error when trying to import librets...any ideas?
I'm on Ubuntu 14.04.4 x64

Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import librets
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named librets
>>> 

@corvuscrypto
Copy link

To help others here that have had issues, if you use a different environment for your python libs (e.g. a virtualenv), after you do sudo make install enter the environment you wish the library to be available in and cd to build/swig/python. Once there, run python setup.py install

Kind of annoying to deal with I know, but it works.

@Valachio
Copy link

Valachio commented Oct 27, 2018

@corvuscrypto Thank you so much for that comment. I spent hours trying to figure out why librets wouldn't import in virtualenv. Then I read your comment and made it work.

For anyone else coming across this. This is what I did:

  1. Enter virtualenv
  2. I'm on Ubuntu 16.04, and I had to go to the folder at /tmp/libRETS-1.6.1/build/swig/python3
  3. Run python setup.py install

@luiscastillocr
Copy link

I can confirm this still works for Python 3.6.9

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment