Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Bob Tanner <tanner-nLfnTIhOdZRl57MIdRCFDg <at> public.gmane.org>
Subject: osx-10.5 ranlib vs ranlib -c vs libtool
Newsgroups: gmane.comp.programming.tools.cmake.user
Date: Friday 5th June 2009 22:37:11 UTC (over 8 years ago)
Ran into another issue with my netrek-server move to cmake.

Attempting to link with an internal library gives me a whole bunch of 
"non_lazy_ptr" linking errors:

Linking C executable trimscores
Undefined symbols:
  "_Cambot_out", referenced from:
      _Cambot_out$non_lazy_ptr in libnetrek.a(getpath.o)
  "_NoCount_File", referenced from:
      _NoCount_File$non_lazy_ptr in libnetrek.a(getpath.o)
  "_Global", referenced from:
      _Global$non_lazy_ptr in libnetrek.a(getpath.o)

Spent alot of time poking around google until I found this url:

http://software.intel.com/en-us/articles/intelr-fortran-compiler-for-mac-os-non_lazy_ptr-unresolved-references-from-linking/

Summary 

of the above url says that when you "ranlib" you really should "ranlib 
-c" and makes reference to the libtool manpage (more on this later).

If I 'ranlib -c ntserv/libnetrek.a' and make

$ make

Linking C executable trimscores
[ 98%] Built target trimscores

Things work.

First question, how to I add "-c" to ranlib evocation?

I build libnetrek via the ADD_LIBRARY as noted below:

ADD_LIBRARY (netrek STATIC
	advertise.c
	alarm.c
	
	warning.c
)

Which generates this command line:

/usr/bin/ar cr libnetrek.a  CMakeFiles/netrek.dir/advertise.o 
CMakeFiles/netrek.
dir/alarm.o   CMakeFiles/netrek.dir/warning.o
/usr/bin/ranlib libnetrek.a

My gut tells me to change CMAKE_RANLIB but maybe a change the ADD_LIBRARY?



My research on ranlib lead me to libtool and the libtool manpage. On 
osx-10.5.7 (all I have access to) the libtool manpage states:

" Libtool with -static is intended to  replace  ar(5)  and  ranlib.   
For backward compatibility, ranlib is still available, and it supports 
universal files. "

To ultimately, the ADD_LIBRARY should be changed to libtool. Just 
passing that information along.

Thanks.


-- 
Bob Tanner                 
 | Phone : (952 943-8700
http://www.real-time.com, Linux, OSX,
VMware | Fax   : (952)943-8500
Key fingerprint = F785 DDFC CF94 7CE8 AA87 3A9D 3895 26F1 0DDB E378


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
 
CD: 3ms