|
From: | George Bosilca |
Subject: | MAC OS X, static compilation and libtool |
Date: | Mon, 17 Mar 2008 22:35:35 -0400 |
The problem is when I compile an application with a libtool enabled library (Open MPI for the sake of completeness). This only happen when the library is compiled with the "--enable-static --disable-shared", all other cases seems to perform as expected. By default libtool propose some linking flags that seems sufficient on most Unix environments, except on MAC OS X. For some obscure reasons, MAC OS X always try to link with shared libraries based on the default path (and Open MPI is shipped by Apple with Leopard), instead of following the -L path as specified by the user on the link command.
After digging into the gcc man pages, I found that in order to have the expected behavior (or at least what I think is expected: look into the user provided lib path for all libraries independing if they are static or dynamic) one has to add the -Wl,-search_paths_first flags to the link command. From the gcc documentation, it seems that this is not necessarily MAC OS X specific (but I didn't test it elsewhere).
I was pondering if I should add a special check in our configure for detecting this case or there is a nicer libtool based way of handling this.
Thanks, george.
smime.p7s
Description: S/MIME cryptographic signature
[Prev in Thread] | Current Thread | [Next in Thread] |