Packaging GCC with Rocks

Our cluster is still working off of CentOS 5.4, so GCC is a bit out of date for some scientific simulation programs out there, so begins the task of building GCC, but that is not the point of this posting. Rocks has the nifty command, rocks create package, to create an rpm package out of a given directory. This works without any issues until I tried it when I was working on rebuilding our our software stack to be based off of the latest GCC.

I had no issues with gcc or with making the package, it was later when building openmpi I discovered what was the issue. When openmpi had to link against a GCC library, it was asking the binary where it was, which in turn was using a hard coded location that no longer existed as this was not the orginal build machine. The fix is the use of DESTDIR. In this case I wanted gcc to be in /opt/gcc-4.7.1, so during the configure step, I set the prefix as such, yet I used the following during the install step: make DESTDIR=/tmp/gcc install, which will install gcc in $DESTDIR/$prefix. Now GCC knows to find its items in /opt/gcc-4.7.1 and not where it was previously on the build server.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s