-
Notifications
You must be signed in to change notification settings - Fork 59
Building on Gentoo Linux
Enabling the Gentoo portage install of antlr for libRETS Set the global "java" use flag in /etc/make.conf Set dev-java/antlr "script" use flag in /etc/portage/package.use
With the java and script use flags set as indicated above, portage installs antlr with the executable: /usr/bin/antlr. Then libRETS ./configure finds antlr and compiles without a problem.
Building librets on Gentoo Linux (64 bit) Some prerequisites may need to be installed. Check the system in question for dev-libs/expat, dev-libs/boost, dev-libs/boost-build, dev-lang/swig, and net-misc/curl.
Download the source archive (from http://www.crt.realtors.org/projects/rets/librets/downloads/ ) and unpack it into an install directory.
Once inside the install directory:
sudo ./autogen.sh sudo ./configure --enable-shared_dependencies --enable-depends --disable-java --disable-ruby --disable-python The most important options for Gentoo are --enable-shared_dependencies --enable-depends. Without these, the fPIC flag isn't set correctly and the boost libraries aren't found.
SWIG bindings can be enabled or disabled by using the --disable- flags. Some languages' development libraries may also need to be installed.
The Options Summary displayed after this step completes should look something like:
Option summary: Use ccache .................: no Use dependency checking ....: yes Use -fPIC...................: yes Use shared dependencies.....: yes Compile type................: Normal Compile examples............: no Compile SQL compiler........: yes Compile SWIG bindings.......: yes With CSharp...............: no With Java.................: no With PERL.................: yes With PHP..................: no With Python...............: no With Ruby.................: no Enable Maintainer Docs......: no (Check the summary for the desired languages and alter the --enable-* flags as needed.)
If the options summary is correct, make and sudo make install can be run. Upon completion, the system will have the perl bindings for libRETS.
Installation on other Linux distros require the --enable-fPIC flag. On 64 bit Gentoo systems, using the --enable-PIC flag unsets the needed option. If the --enable-PIC flag is used, the Options summary will read:
Option summary: Use ccache .................: no Use dependency checking ....: yes Use -fPIC...................: Use shared dependencies.....: yes Compile type................: Normal Compile examples............: no Compile SQL compiler........: yes Compile SWIG bindings.......: yes With CSharp...............: no With Java.................: no With PERL.................: yes With PHP..................: no With Python...............: no With Ruby.................: no Enable Maintainer Docs......: no Note the value of Use -fPIC is empty and not explicitly set. Removal of the --enable-PIC flag will fix the problem.
Trying to explicitly set the boost prefix will generate a correct options summary but make will fail.
sudo ./configure --with-boost-prefix=/usr/local --disable-java --disable-ruby --disable-python The generated options summary reads:
Option summary: Use ccache .................: no Use dependency checking ....: no Use -fPIC...................: yes Use shared dependencies.....: no Compile type................: Normal Compile examples............: no Compile SQL compiler........: yes Compile SWIG bindings.......: yes With CSharp...............: no With Java.................: no With PERL.................: yes With PHP..................: no With Python...............: no With Ruby.................: no Enable Maintainer Docs......: no But the error message reads:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/local/lib/libboost_system-gcc41-mt-1_37.a(error_code.o): relocation R_X86_64_32 against a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libboost_system-gcc41-mt-1_37.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [blib/arch/auto/librets/librets.so] Error 1 make[2]: Leaving directory
/home/brianc/libs/RETS/librets-1.3.3/build/swig/perl'
make[1]: *** [build/swig/perl/blib/arch/auto/librets/librets.so] Error 2
make[1]: Leaving directory `/home/brianc/libs/RETS/librets-1.3.3'
make: *** [all] Error 2
The error message can be a bit misleading. -fPIC is enabled according to the options summary. As previously noted, the correct configure flags are --enable-shared_dependencies --enable-depends.