[GIS] Problem installing gdal – works in build directory, not in /usr/bin

centoserrorgdalinstallationlinux

I've been trying to install gdal with the FileGDB driver. I installed it fine on a linux mint machine. I am having problems installing on a CentOS machine though.
It builds fine, I can run the apps in the build directory but when I run make install, it runs without error.
The machine did have gdal 1.9 installed. After we had tried several times installing I used rpm to uninstall the gdal packages shown as installed. Reran the make install, reran ldconfig just in case. No difference. For now I'm hard coding the path to the build directory, but obviously I'd rather have it run properly.

./configure LDFLAGS=-L/lib64 --with-fgdb=/data/HOMEDIRS/SAI/dev/src/FileGDB_API 
--without-python --with-perl --with-pg=/usr/bin/pg_config --prefix=/usr
/data/HOMEDIRS/SAI/dev/gdal-1.11.0/apps/ogrinfo --formats|grep File
 -> "MapInfo File" (read/write)
 -> "OpenFileGDB" (readonly)
 -> "FileGDB" (read/write)
/usr/bin/ogrinfo --formats|grep File
 -> "MapInfo File" (read/write)
 -> "OpenFileGDB" (readonly)

Interestingly, if I delete the file in /usr/bin then reinstall, the install does something to the binary (link in libraries?):

 ls -l /data/HOMEDIRS/SAI/dev/gdal-1.11.0/apps/ogrinfo /usr/bin/ogrinfo
 -rwxr-xr-x 1 nrgadmin root  7671 Sep  4 20:00 /data/HOMEDIRS/SAI/dev/gdal-1.11.0/apps/ogrinfo
 -rwxr-xr-x 1 root     root 78727 Sep  4 20:17 /usr/bin/ogrinfo

Best Answer

Bit of a cr@ppy answer - but it works. Unfortunately, it doesn't really solve the route cause.
I resolved my issue by changing the build to use static libraries instead.

./configure --with-fgdb=/data/HOMEDIRS/SAI/dev/src/FileGDB_API --with-pg=/usr/bin/pg_config --prefix=/usr --without-ld-shared --disable-shared --enable-static