Tuesday, March 19, 2013

Nerd Food: Installing Latest Stable ODB

Nerd Food: Installing Latest Stable ODB

We recently started to add ODB support to Dogen in anger, so time came to update our build farm with the latest ODB. Previously we had hit a minor snag with C++ 11 but its all good with latest stable so that's what we're going with. In Debian, since we already had GCC 4.7, all we had to do was to su to root and install the plugin support:

apt-get install gcc-4.7-plugin-dev

Then it was as easy as the three magic steps (PFH is our local chroot):

mkdir build
cd build

wget http://www.codesynthesis.com/download/libcutl/1.7/libcutl-1.7.0.tar.gz
tar xaf libcutl-1.7.0.tar.gz
cd libcutl-1.7.0
./configure --prefix=/usr/local/pfh
make -j4
make install
cd ..

wget http://www.codesynthesis.com/download/odb/2.2/odb-2.2.1.tar.gz
tar xaf odb-2.2.1.tar.gz
cd odb-2.2.1
./configure --prefix=/usr/local/pfh
make -j4
make install
cd ..

Wit this you now have the ODB compiler ready to rock and roll. However, in order to be able to use it you need the supporting libraries. We only care about postgres and boost, so that's all we installed:

wget http://www.codesynthesis.com/download/odb/2.2/libodb-2.2.2.tar.gz
tar xaf libodb-2.2.2.tar.gz
cd libodb-2.2.2
./configure --prefix=/usr/local/pfh
make -j4
make install
cd ..

wget http://www.codesynthesis.com/download/odb/2.2/libodb-pgsql-2.2.0.tar.gz
tar xaf libodb-pgsql-2.2.0.tar.gz
cd libodb-pgsql-2.2.0
./configure --prefix=/usr/local/pfh
make -j4
make install
cd ..

wget http://www.codesynthesis.com/download/odb/2.2/libodb-boost-2.2.0.tar.gz
tar xaf libodb-boost-2.2.0.tar.gz
cd libodb-boost-2.2.0
./configure --prefix=/usr/local/pfh
make -j4
make install
cd ..

Things were not so easy for platforms other than Linux - as it always tends to be the case! This is because we built GCC previously without --enable-plugin so to be able to use the ODB compiler one would have to rebuild GCC. Luckily we don't really need to use the ODB compiler on all platforms - we just need to be able to build the code on all platforms - so we coped out and build only the supporting libraries on both OSX and Windows.

The tests pass just fine across the board, so basic ODB support is now in Dogen. This is of course the initial implementation so its still rather hacky, but at least it proves the concept. Next to clean up the tests and to generate the makefiles directly from Dogen.

Date: 2013-03-19 22:23:59 GMT

Org version 7.8.02 with Emacs version 23

Validate XHTML 1.0

No comments: