[CMake] Cmake MacOSX Question

Hans Johnson hans-johnson at uiowa.edu
Mon Jun 26 10:57:40 EDT 2006


Bill,

I'm always leery about changing the default behavior for things like this.
This change did fix my problem, which admittedly is a due to retrofitting
the build system deal with my strange requirements, but it seems like many
other people are not being affected.

I think that it would be better to provide documentation on the WIKI page
about this, and in an appendix for the next Cmake book.

Thanks for all your help and support on this.

Hans



On 6/26/06 9:45 AM, "William A. Hoffman" <billlist at nycap.rr.com> wrote:

> This sounds very familiar.  I think we figured it out once before, and talked
> about making this flag the default on OSX.  Does that sound like a good idea?
> 
> 
> -Bill
> 
> At 11:09 PM 6/24/2006, Hans Johnson wrote:
>> Brad,
>> 
>> Thanks for all your suggestions. They put me onto the correct path to
>> figuring out what was going on.  Close inspection of the man page for ld on
>> MacOSX indicates why the strange behavior was occuring.
>> 
>> 
>> 
>> -search_paths_first
>>         By  default  when  the  -dynamic  flag is in effect, the -lx and
>>        -weak-lx  options  first  search  for  a  file   of   the   form
>>        `libx.dylib'  in each directory in the library search path, then
>>        a file of the form `libx.a'  is  searched  for  in  the  library
>>        search  paths.   This  option  changes  it  so that in each path
>>        `libx.dylib' is searched for then `libx.a' before the next  path
>>        in the library search path is searched.
>> 
>> 
>> Thanks,
>> Hans
>> 
>> 
>> 
>> 
>> On 6/23/06 12:49 PM, "Brad King" <brad.king at kitware.com> wrote:
>> 
>>> Hans J. Johnson wrote:
>>>> Here is the output.  I am still perplexed as to why the tcl and tk
>>>> libraries
>>>> from the framework (or /usr/lib) are being included.
>>> [snip]
>>>>  /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/collect2 -dynamic -arch ppc
>>>> -bind_at_load -headerpad_max_install_names -macosx_version_min 10.3
>>>> -multiply_defined suppress -weak_reference_mismatches non-weak -o
>>>> ../bin/brains2 -lcrt1.o /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/crt2.o
>>>> /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/crt3.o
>>>> -L/scratch/hjohnson/src/brains2/MacOSX/FAST/src/lib/InsightToolkit
>>>> -L.
>>>> -L/scratch/hjohnson/src/brains2/MacOSX/FAST/src/lib
>>>> -L/usr/X11R6/lib
>>>> -L/sw/lib
>>>> -L/usr/lib/gcc/powerpc-apple-darwin8/4.0.1
>>>> -L/usr/lib/gcc/powerpc-apple-darwin8/4.0.1
>>>> -L/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../..
>>> [snip]
>>>> -ltcl8.4 -ltk8.4
>>> 
>>> The libtcl8.4.so in /usr/lib is probably a symlink to the framework one.
>>>   I wonder if the current working directory of the collect2 process as
>>> started by gcc is /usr/lib, so that the -L. is picking up the files from
>>> there.  Try taking off the -L. from the command line of /usr/bin/c++.
>>> 
>>> Also note that the path
>>> -L/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../.. is actually
>>> /usr/lib.  Perhaps the linker is searching backwards somehow?
>>> 
>>> Alternatively the linker could be searching the entire path for a shared
>>> library and then searching the entire path for a static library.  Since
>>> it finds libtcl8.4.so in /usr/lib it doesn't ever look for libtcl8.4.a.
>>>   Try changing TCL_LIBRARY to "-Wl,-Bstatic -ltcl8.4 -Wl,-Bdynamic".
>>> 
>>> -Brad
>> 
>> _______________________________________________
>> CMake mailing list
>> CMake at cmake.org
>> http://www.cmake.org/mailman/listinfo/cmake
> 



More information about the CMake mailing list