-
Notifications
You must be signed in to change notification settings - Fork 59
Building on Centos Linux
Update 2015-02-09
Building on CentOS 7.0:
This is built using a Vagrant box that can be found at:
You can use Yum to install all of the dependencies. Download the libRETS tarball, extract it, and cd into it. Then invoke the following script:
#! /bin/sh
sudo yum install --assumeyes antlr-tool autoconf boost-devel expat-devel libcurl-devel gcc-c++ swig python-devel
./autogen.sh
CPPFLAGS="-L/usr/local/lib -I/usr/local/include"
./configure --enable-examples
--enable-debug
--enable-depends
--enable-maintainer-documentation
--enable-shared-dependencies
Building on CentOS 6.5:
Recent versions of CentOS don't appear to have the proper versions of the dependencies installed. And, if you need to use one of the libRETS bindings that requires a shared library (librets.so), then you need to manually build some of the dependencies. You can install antlr from yum, but you'd be better served to download and install each of the dependencies yourself. Note that I typically use swig-2.0.12 instead of what is installed by yum.
The hard dependency to get right is boost. More on that in a moment. For the other dependencies, it is best to configure them with something like the following:
CFLAGS="-L/usr/local/lib -I/usr/local/include -fPIC" \
CPPFLAGS="-L/usr/local/lib -I/usr/local/include -fPIC" \
./configure
Build and install things in the following order:
openssl
curl
expat
boost
swig
If you use shared libraries, you need to ensure that the .so can be found by the Linux loader. I have noticed on some machines that I must create /etc/ld.so.conf.d/usr.local.lib-x86_64.conf containing:
/usr/local/lib As for building boost, download it and untar it. Bootstrap it and then issue the following:
./bootstrap.sh
./bjam "toolset=gcc" --v2 cxxflags=-fPIC --build-type=complete --layout=versioned --with-filesystem --with-program_options
sudo ./bjam "toolset=gcc" --v2 cxxflags=-fPIC --build-type=complete --layout=versioned --with-filesystem --with-program_options install
When building librets (fix your java path accordingly if you are using java and make sure the jdk/devel version is installed as well as the jre):
CPPFLAGS="-L/usr/local/lib -I/usr/local/include" \
./configure --enable-examples \
--enable-depends \
--enable-maintainer-documentation \
--enable-shared_dependencies \
--with-expat-prefix=/usr/local \
--with-boost-prefix=/usr/local \
--with-java-prefix=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/include/ \
--prefix=/usr/local
Earlier CentOS Versions:
From Dan Woolley:
The following are the steps I took to compile and install libRETS 1.3.2 on Centos 5.2. It was more involved than other Linux installations because Centos didn't have recent versions of required libraries in it's repositories.
This compiles for Ruby support only. Additional packages may be required to support Java, Perl, etc. Also, you'll need to remove the --disable-* switches when you ./configure if you want that support.
-
Install requirements from Centos RPM repositories using yum: sudo yum install antlr.i386 sudo yum install boost-devel.i386 sudo yum install expat-devel.i386 sudo yum install curl-devel.i386 sudo yum install swig.i386
-
Install librets from source (http://www.crt.realtors.org/projects/rets/librets/) cd /tmp wget http://www.crt.realtors.org/projects/rets/librets/files/librets-1.3.2.tar.gz tar --gzip -xf librets-1.3.2.tar.gz cd librets-1.3.2 ./autogen.sh ./configure --disable-java --disable-perl --disable-dotnet --disable-php --disable-python
-
Got errors indicating old verion of curl - need 7.18.2 or greater.
No newer rpm packages existed (at the time) for Centos, so must compile curl from source. Same with Swig - librets required 1.3.33 or greater, but no rpm packages that new existed for Centos. -
Install epkg from source (http://www.encap.org/epkg/). This was suggested to 'wrap' the curl and swig installs for later ease of updating or removal using epkg. cd /tmp wget ftp://ftp.encap.org/pub/encap/epkg/epkg-2.3.9.tar.gz tar --gzip -xf epkg-2.3.9.tar.gz cd epkg-2.3.9 ./configure make sudo make install
-
Install curl from source (http://curl.haxx.se/download.html) cd /tmp wget http://curl.haxx.se/download/curl-7.19.5.tar.gz tar --gzip -xf curl-7.19.5.tar.gz cd curl-7.19.5 ./configure --prefix=/usr/local/encap/curl-7.19.5 make sudo make install sudo epkg curl
-
Install swig from source (http://www.swig.org/download.html) cd /tmp wget http://www.sfr-fresh.com/unix/privat/swig-1.3.39.tar.gz tar --gzip -xf swig-1.3.39.tar.gz cd swig-1.3.39 ./configure --prefix=/usr/local/encap/swig-1.3.39 make sudo make install sudo epkg swig
-
Try compiling librets now ./configure --disable-java --disable-perl --disable-dotnet --disable-php --disable-python make sudo make install
-
On 64-bit Centos, add a flag --enable-shared_dependencies so it'll use the .so versions of the libs instead of the .a, because the .a are not compiled with -fPIC and otherwise you'll get an error because it won't find the .a files in /usr/lib64 ./configure --disable-java --disable-perl --disable-dotnet --disable-php --disable-python --enable-shared_dependencies make sudo make install
-
Test librets cd project/swig/ruby ruby login.rb