Couldn't load library libftd2xx.dylib on OSX

1,124 views
Skip to first unread message

Matthew Perry

unread,
Oct 8, 2010, 12:49:01 PM10/8/10
to golden-cheetah-users
I'm finally getting around to installing the FDTI drivers for PT
dowload on my Mac (running OSX 10.6.4). I've got driver version 1.6
(from the GC site), installed according to the instructions, and
still:

Couldn't load library libftd2xx.dylib.

The libs seem to be installed correctly

~$ ls -l /usr/local/lib/libftd2xx.*
-rwxr-xr-x@ 1 root wheel 212748 Oct 8 09:43
/usr/local/lib/libftd2xx.0.1.6.dylib
lrwxr-xr-x 1 root wheel 36 Oct 8 09:43
/usr/local/lib/libftd2xx.dylib -> /usr/local/lib/libftd2xx.0.1.6.dylib

And I've got ftd2xx.h and WinTypes.h in the /usr/local/include/ dir
and compiled a recent git version with "D2XX_INCLUDE =
/usr/local/include" in my gcconfig.pri

Any ideas? .. hopefully just a stupid oversight on my part?

--
·´¯`·.¸. , . .·´¯`·.. ><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>
"The best way to predict the future is to invent it."  -- Alan Kay
Matthew T. Perry
http://www.perrygeo.net
http://viedevelo.wordpress.com

Justin Knotzke

unread,
Oct 8, 2010, 1:32:19 PM10/8/10
to Matthew Perry, golden-cheetah-users

   If you run a build from off GC's website, does it work ?
   
   J




--
_______________________________________________
Golden-Cheetah-Users mailing list
golden-che...@googlegroups.com
http://groups.google.com/group/golden-cheetah-users?hl=en

Matthew Perry

unread,
Oct 8, 2010, 1:59:19 PM10/8/10
to Justin Knotzke, golden-cheetah-users
On Fri, Oct 8, 2010 at 11:32 AM, Justin Knotzke <jkno...@shampoo.ca> wrote:
>    If you run a build from off GC's website, does it work ?

Thanks for the suggestion.

Well I just downloaded and ran 1.3 and it seems to find the driver
alright (no error at least). However it does not find any devices
(port list is empty).

On the latest dev build, GoldenCheetah_0d6949, I get a warning:
No serial devices found.

On my git build, I get a warning:


Couldn't load library libftd2xx.dylib.

No serial devices found.

I'm using a PT Comp wired LYC and the USB download cradle if that matters.

Justin Knotzke

unread,
Oct 8, 2010, 2:29:51 PM10/8/10
to Matthew Perry, golden-cheetah-users

   The drivers are loaded via the OS. We can't actually specify a specific driver. Thus, if your OS X happens to have another ftdi driver somewhere, it might get loaded first instead of the one you want. In Linux you can do a ldconfig -v which gives you a list of all the loaded dynamic libs. I don't know if that exists in OS X.

   But my first attempt would be to go fishing through your system looking to see if there is anything else that is using ftdi and if loads..

   I have never tried this but you could maybe try and change line 71 of D2XX.cpp to:

const char *libname = "/usr/local/lib/libftd2xx.dylib";

And see if that fixes it. If it does, then that was your problem.

  J

Matthew Perry

unread,
Oct 8, 2010, 3:20:33 PM10/8/10
to Justin Knotzke, golden-cheetah-users
On Fri, Oct 8, 2010 at 12:29 PM, Justin Knotzke <jkno...@shampoo.ca> wrote:
>
>    The drivers are loaded via the OS. We can't actually specify a specific
> driver. Thus, if your OS X happens to have another ftdi driver somewhere, it
> might get loaded first instead of the one you want. In Linux you can do a
> ldconfig -v which gives you a list of all the loaded dynamic libs. I don't
> know if that exists in OS X.

It does not but I found otool which seems to do the same thing

~/src/GoldenCheetah/src$ otool -L
GoldenCheetah.app/Contents/MacOS/GoldenCheetah

No libftd2xx listed anywhere .. should it be? The other builds I've
downloaded don't have it either.

I've made sure there are no libftd2xx.dylib files anywhere else on the
machine. Not sure where to go from here...

Justin Knotzke

unread,
Oct 8, 2010, 3:31:21 PM10/8/10
to Matthew Perry, golden-cheetah-users

   I don't think otool is the same as ldconfig. ldconfig tells you of all the shared libs installed on your system. otool appears to display parts of a given library..

   Did you try changing the line of code I suggested ?

   J

Matthew Perry

unread,
Oct 8, 2010, 3:44:06 PM10/8/10
to Justin Knotzke, golden-cheetah-users
On Fri, Oct 8, 2010 at 1:31 PM, Justin Knotzke <jkno...@shampoo.ca> wrote:
>
>    I don't think otool is the same as ldconfig. ldconfig tells you of all
> the shared libs installed on your system. otool appears to display parts of
> a given library..

You're right .. i was thinking of the linux 'ld' perhaps?

>    Did you try changing the line of code I suggested ?

>>    I have never tried this but you could maybe try and change line 71 of
>> D2XX.cpp to:
>>
>> const char *libname = "/usr/local/lib/libftd2xx.dylib";

Yeah same result unfortunately .. Could not load /usr/local/lib/libftd2xx.dylib

Justin Knotzke

unread,
Oct 8, 2010, 4:00:57 PM10/8/10
to Matthew Perry, golden-cheetah-users
On Fri, Oct 8, 2010 at 15:44, Matthew Perry <perr...@gmail.com> wrote:

Yeah same result unfortunately .. Could not load /usr/local/lib/libftd2xx.dylib


  What version of OS X are you on ?

  J 

Justin Knotzke

unread,
Oct 8, 2010, 4:18:28 PM10/8/10
to Matthew Perry, golden-cheetah-users
On Fri, Oct 8, 2010 at 16:00, Justin Knotzke <jkno...@shampoo.ca> wrote:

  What version of OS X are you on ?


  Hang on it's in your original email.
  
  Try this driver instead:


  Make sure to switch your symlinks.

   J 

Jamie Kimberley

unread,
Oct 8, 2010, 4:21:38 PM10/8/10
to Justin Knotzke, Matthew Perry, golden-cheetah-users
Look closely at the output of ls -l.

you'll see there is a @ at the end of the file mode indicating that
there are extended attributes associated with the file.

if you do ls -l@ i'm willing to bet you get:
com.apple.quarantine
in the output.

this is what normally prompts the user to allow an application that
has come from the Internet to be run.

I'm not sure but this might be causing problems.

you can try to remove the quarantine

by running:

sudo xattr -d com.apple.quarantine /usr/local/lib/libftd2xx.0.1.7.dylib

Shot in the dark, but you never know.

Jamie

> --
> _______________________________________________
> Golden-Cheetah-Users mailing list
> golden-che...@googlegroups.com
> http://groups.google.com/group/golden-cheetah-users?hl=en

"You don't use science to show that you're right, you use science to
become right."--xkcd
__________________
Jamie Kimberley
Postdoctoral Fellow
Department of Mechanical Engineering
The Johns Hopkins University
Office: 410.516.5162
Mobile: 217.621.8272
Fax: 410.516.4316
E-Mail:jamie.k...@jhu.edu

Matthew Perry

unread,
Oct 8, 2010, 4:32:12 PM10/8/10
to Jamie Kimberley, Justin Knotzke, golden-cheetah-users
Justin - thanks .. so D2XX 1.7 is considered stable now I take it? In
any case, it seemed that upgrading the driver makes the "Couldn't load
library" warning go away but I still can not get it to recognize my
device.

Jamie - that is a good idea, never knew about that trick! In this case
the quarantine didnt seem to be the issue.

So I'm still stuck but the good news is that its probably *not* a GC
issue .. I just installed PowerAgent and it cant read the device
either. Grrr. Please dont make me go back to Win/WKO+!!

- matt

--

Justin Knotzke

unread,
Oct 8, 2010, 4:37:56 PM10/8/10
to Matthew Perry, Jamie Kimberley, golden-cheetah-users

   1.7 was never stable for us and still isn't. 
 
   I had you download the 1.7 x_64 version to see if you had built your GC as x_64.

   The reason why the 1.6 version we are using didn't work for you is because you most likely built your GC as x_64 and that driver we have is for PPC and i386.

   Thus, I suggest you rebuild your GC as i386 32bit and not 64 bit.

   This will get you past your not being able to load the drivers from the current git version.

   As you said, this isn't a GC issue..

   Good Luck !

   J

Jamie Kimberley

unread,
Oct 8, 2010, 4:58:04 PM10/8/10
to Matthew Perry, Justin Knotzke, golden-cheetah-users
Two things.

1. Make sure the LYC is FULLY in the cradle.

2. if you are using the 0.1.7 drivers and you get things to connect
you'll probably get random crashes when downloading.

It is reported that you can add a config file to /usr/local/lib to
alleviate this problem.

from our tracker:
However, there is a better way to solve this. It's actually
explained
in the ReadMe file for the driver. The problem occurs in
multithreaded
applications only. You need to create an ftd2xx.cfg file in /usr/
lib/, /usr/local/lib/, or in your current working directory. The
file
should look like this:

[Globals]
ConfigFlags=0x40000000

I'll try this when I get home. I have my PT ther eand can try a few
other things.

Jamie

> ???`?.?. , . .???`?.. ><((((?>`?.??.???`?.?.???`?...?><((((?>


> "The best way to predict the future is to invent it." -- Alan Kay
> Matthew T. Perry
> http://www.perrygeo.net
> http://viedevelo.wordpress.com
>

Matthew Perry

unread,
Oct 8, 2010, 5:20:16 PM10/8/10
to Jamie Kimberley, Justin Knotzke, golden-cheetah-users
On Fri, Oct 8, 2010 at 2:37 PM, Justin Knotzke <jkno...@shampoo.ca> wrote:
>    I had you download the 1.7 x_64 version to see if you had built your GC
> as x_64.
>    The reason why the 1.6 version we are using didn't work for you is
> because you most likely built your GC as x_64 and that driver we have is for
> PPC and i386.
>    Thus, I suggest you rebuild your GC as i386 32bit and not 64 bit.
>    This will get you past your not being able to load the drivers from the
> current git version.

GC is definitely being built at 64 bit which would explain it. I'm
building now with CONFIG += i386 .... is this the right way to
accomplish a 32-bit build? And is a 32-bit build the prefered way to
get powertap support on OSX?

On Fri, Oct 8, 2010 at 2:58 PM, Jamie Kimberley <jamie.k...@jhu.edu> wrote:
> Two things.
>
> 1. Make sure the LYC is FULLY in the cradle.

Yup... HOST mode is on and its locked in. Works on my windows box too.

> 2. if you are using the 0.1.7 drivers and you get things to connect you'll
> probably get random crashes when downloading.
>
> It is reported that you can add a config file to /usr/local/lib to alleviate
> this problem.
>
> from our tracker:
> However, there is a better way to solve this. It's actually explained
> in the ReadMe file for the driver. The problem occurs in multithreaded
> applications only. You need to create an ftd2xx.cfg file in /usr/
> lib/, /usr/local/lib/, or in your current working directory. The file
> should look like this:
>
> [Globals]
> ConfigFlags=0x40000000
>

Good to know. The 1.7 64-bit driver (with or without the cfg trick)
seems to be recognized/loaded but still no device found.

--
·´¯`·.¸. , . .·´¯`·.. ><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>

Aeneas

unread,
Oct 9, 2010, 6:01:06 PM10/9/10
to golden-cheetah-users
I had this problem and went around in circles until I just installed
the CycleOps drivers that came with my powertap in addition to the ftd
drivers. Works like a charm. I suggest you try this.

Matthew Perry

unread,
Oct 10, 2010, 3:03:31 PM10/10/10
to Aeneas, golden-cheetah-users

Thanks! I installed the latest version of PowerAgent (comes with
drivers) and it works beautifully .. in Power Agent but still not in
GC.

Using the 64-bit ftd 1.7 drivers, GC now sees the unit but errors out

Using the 32-bit ftd 1.6 drivers, GC cant find the drivers at all
(actually this may not be precise .. the error handler in D2XX.cpp
line 75 doesnt really distinguish between errors - it just says that
dlopen didnt work for some reason. perhaps we could output some
debugging info here??)

I suspect this is due to building GC as a 64-bit only? Can someone
confirm this? Is there a way to build GC as 32-bit even though all the
dependencies are likely 64-bit as well? I'm a bit over my head at this
point and I'm really just shooting in the dark. I'd appreciate some
advice from the programming gurus on how to proceed ... I can't
imagine I'm the only one on 64-bit Mac who wants to compile GC from
source and access their PT data.

Justin Knotzke

unread,
Oct 10, 2010, 3:14:39 PM10/10/10
to Matthew Perry, golden-cheetah-users
On Sun, Oct 10, 2010 at 15:03, Matthew Perry <perr...@gmail.com> wrote:
 
I suspect this is due to building GC as a 64-bit only? 

  Yes. This is precisely what I said in an earlier email.

  Why don't you just grab the latest build here: http://goldencheetah.stand2surf.net/ and use the 1.6 32bit drivers and see what that does for you.

   J 

Matthew Perry

unread,
Oct 10, 2010, 3:34:35 PM10/10/10
to Justin Knotzke, golden-cheetah-users
On Sun, Oct 10, 2010 at 1:14 PM, Justin Knotzke <jkno...@shampoo.ca> wrote:
> On Sun, Oct 10, 2010 at 15:03, Matthew Perry <perr...@gmail.com> wrote:
>
>>
>> I suspect this is due to building GC as a 64-bit only?
>

My question though is how do I build it as a 32 bit?

>   Yes. This is precisely what I said in an earlier email.
>   Why don't you just grab the latest build here:
> http://goldencheetah.stand2surf.net/ and use the 1.6 32bit drivers and see
> what that does for you.

I have several patches that I maintain related to the performance
manager and metrics which basically allow me to track training stress
on other bikes without power meters. Until those features make it into
the core GC (see my email to the group entitled "Proposal for managing
non-power based training stress metrics") I'll have to stay with my
patched version.

Justin Knotzke

unread,
Oct 10, 2010, 3:44:07 PM10/10/10
to Matthew Perry, golden-cheetah-users
On Sun, Oct 10, 2010 at 15:34, Matthew Perry <perr...@gmail.com> wrote:

My question though is how do I build it as a 32 bit?

 
   Ah, I thought it was how to get your PT working on GC.

   My thinking is that if you can't get your PT to download using Jamie's build with the 1.6 drivers, then your build issues are a little moot. No ?



I have several patches that I maintain related to the performance
manager and metrics which basically allow me to track training stress
on other bikes without power meters. Until those features make it into
the core GC (see my email to the group entitled "Proposal for managing
non-power based training stress metrics") I'll have to stay with my
patched version.


   You need to take a look at a few things. The first is which version of Qt you installed and how it was built or installed. The other is the settings in gcconfig.pri which indicate if your build is x86_64 or 32bit. Remember there are many components that get built with many different config files. 

  I am going to assume that since you built your own GC that you should be able to figure these out...

   J 

Jamie Kimberley

unread,
Oct 10, 2010, 3:48:50 PM10/10/10
to Matthew Perry, Justin Knotzke, golden-cheetah-users
To build as 32 bit add i386 to the gcconfig.pri.

Also when gc errors out with the 0.1.7 drivers is it crashing or just stating that there was an error downloading? If it is crashing try adding the ftd2xx.cfg file like I suggested eArlier.

Reply all
Reply to author
Forward
0 new messages