I am attempting to build octave 3.8.2 on a 64-bit CentOS 5.6 machine and have run into problems during lnking of liboctave. I am compiling using a recently built gcc 4.9.2 installation. The issue seems to be that libtool is attempting to link with the 32bit versions of libgfortran.so, libquadmath.os, and libg++.so from <prefix>/lib instead of the 64 bit verions from <prefix>/lib64. The specific error is as follow:
libtool: link: g++ -FPIC .... <many many lines of paths and libraries>
</prefix>/lib/../lib/libgfortran.so: error adding symbols: File in the wrong format
I thought this might be a problem with the old libtool, so I installed the latest version, but got the same error. I edited the liboctave/Makefile to explicitly include /cfd/Test/lib64/libgfortran.so, and the error shifted to libquadmath. Editing the makefile again, the error shifted to libg++.
Looking at the link command line, libtool appears to be picking the correct versions in some cases (e.g. <prefix>/lib/../lib64/crti.o), but not in others. both <prefix>/lib and <prefix>/lib64 are included in the link path multiple times, and they need to be, since some libraries (fftw, blas, lapack) were installed in <prefix>/lib when I built them.
Any help in getting past this problem is greatly appreciated.