Compiling Openocd on x86_64 using binary libftd2xx.so

I am at my wits end trying to get this binary driver libftd2xx.so.0.4.13 to work on my platform. I have tried to compile openocd two different ways, both with different results.

Method one: Follow all instructions on ftdi’s website and openocd:

unzip tarball
cp libftd2xx.so.0.4.13 /usr/local/lib/libftd2xx.so.0.4.13
make symbolic links in all locations specified in README etc.
compile openocd with:
./configure --enable-ft2232_ftd2xx --with-ftd2xx=/home/brianp/tmp/new/
make 
..................
mv -f .deps/openocd-openocd.Tpo .deps/openocd-openocd.Po
gcc  -g -O2    -o openocd openocd-openocd.o .._/src/xsvf/libxsvf.a .._/src/target/libtarget.a .._/src/jtag/libjtag.a .._/src/helper/libhelper.a .._/src/server/libserver.a .._/src/helper/libhelper.a .._/src/flash/libflash.a .._/src/target/libtarget.a .._/src/pld/libpld.a  -lftd2xx    
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.1.3/.._/.._/.._/.._/lib/libftd2xx.so when searching for -lftd2xx
/usr/bin/ld: skipping incompatible /usr/lib/.._/lib/libftd2xx.so when searching for -lftd2xx
/usr/bin/ld: skipping incompatible /usr/bin/.._/lib/libftd2xx.so when searching for -lftd2xx
/usr/bin/ld: skipping incompatible /usr/lib64/libftd2xx.so when searching for -lftd2xx
/usr/bin/ld: skipping incompatible /usr/local/lib/libftd2xx.so when searching for -lftd2xx
/usr/bin/ld: skipping incompatible /usr/lib/libftd2xx.so when searching for -lftd2xx
/usr/bin/ld: cannot find -lftd2xx
collect2: ld returned 1 exit status
make[3]: *** [openocd] Error 1
make[3]: Leaving directory `/home/brphelps/tmp/new/trunk/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/brphelps/tmp/new/trunk/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/brphelps/tmp/new/trunk'
make: *** [all] Error 2

Method 2: chroot jail in 32 bit debian, follow all instructions as before, we’re just in chroot jail this time.

Result: Everything works!

… until I exit the chroot jail:

root@thepackage:~/ext_usbdrive_bak/tmp/trunk# src/openocd 
src/openocd: error while loading shared libraries: libftd2xx.so.0: cannot open shared object file: No such file or directory

yes this file is present, I have put this link everywhere also like /usr/lib/ and /usr/local/lib/, yes the link is valid and yes the file is executable by all. Obviously this is not an error with libftd2xx.so.0, but probably with a 32 bit shared library, not being loaded and triggering this error incorrectly.

I have no idea what to do next. I am out of ideas.

Also notice that the _ in the …_/ should not be there, sparkfun does not like this string so I put the _ there.

Hi,

I remember that problem. Unfortunately I compiled it last time about a year ago so I can not give you precise advice.

In my case the problem was another libraries. I think you should see some more “skipping this and that incompatible lib” messages. After installing 32 bit versions of these skipped libraries everything was ok.

Madis

Have you tried doing a static build (in your jail) for this app?

I dislike Eclipse, and also want to build all the arm7 tools for integration in Emacs.

Thanks guys for your help. Static compiling caused errors that I could not solve. I can not post the errors because it screws up sparkfun several different ways (doh!).

I did resolve this problem by altering the LD_LIBRARY_PATH variable. My post never got submitted because of this issue:

viewtopic.php?t=9625

And a bogus “forbidden word” problem. Between these two issues I have spent hours just trying to debug how I am goofing up the sparkfun.com forum, which is not something I am interested in doing because the moderator Frencil is MIA.

When this is resolved I will post a solution. I guess they’re going through some type of transitional period here and we must be patient.

PM me for a solution if you’re interested.