Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
55 Views

Static Linking to libippcp.a on MAC 10.10.5

Hello,

IPP v9.0 on Mac 10.10.5

I am running into an issue when trying to static link with libippcp.a on Mac. The error that is generated is ...

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: src/.libs/libA.a(libippcp.a) fat file for cputype (7) cpusubtype (3) is not an object file (bad magic number)

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar: internal ranlib command failed

make[1]: *** [src/libA.la] Error 1


When I run /usr/bin/ranlib on libippcp.a it throws a bunch of no symbols -- don't know if that is relavent or not to the issue of linking.

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: IPP/lib/libippcp.a(precomp_k0.o) has no symbols

Using the same setup I'm trying on Mac but switching to a Linux machine and using the linux version of libippcp.a is able to work. It also appears to be able to link with libippcore.a on the Mac just not libippcp.a. I was curious if this was a known issue and if there was something that could be done.

Regards,
Jacob

 

0 Kudos
8 Replies
Highlighted
Employee
55 Views

Hello Jacob,

thank you for the information, I will investigate it and answer several days later.

Pavel

0 Kudos
Highlighted
Employee
55 Views

Hi Jacob,

Could you please provide more details what are you trying to do? As I understand you try to build your own static lib libA.a with linked in libippcp.a - is it correct? What is XCode versions do you use? For which architecture you try to build your project?

In general: we are unable to reproduce this linker problem... it will be great if you will create and send to us some reproducer.

- Vasily

0 Kudos
Highlighted
New Contributor I
55 Views

Hi Vasily,

Right using autoconf building libA.a with libippcp.a and libippcore.a. XCode version Version 6.4 (6E35b)

We decided to go with Linux for now so is no longer a pressing issue on this side. But in the future will see if I can get back to send some example code.

Regards,
Jaco 

0 Kudos
Highlighted
Employee
55 Views

Hi Jicob,

do you mean that you simply include IPP libraries into your static library as well as object files? If yes - it is the reason of the problem, one static library can be included into another only by special command, not as object file.

Pavel

0 Kudos
Highlighted
New Contributor I
55 Views

Hi Pavel,

Oh, no. Not like object .o files. Its with using libtool in the autotools.

$ libtool -V

Apple Inc. version cctools-870

  5 lib_LTLIBRARIES+= src/libA.la

  6 src_libA_la_SOURCES =

  7 src_libA_la_LDFLAGS = ${AM_LDFLAGS} -no-undefined

  8 src_libA_la_LIBADD = $(LIBM) $(LIB_ADD) $(LIB_STATIC_ADD)

  9 src_libA_la_CFLAGS = $(AM_CFLAGS)

 10 src_libA_la_CPPFLAGS = $(AM_CPPFLAGS)

Where the variable LIB_STATIC_ADD contains the absolute path to the static libraries libippcp.a and libippcore.a. I'll try and reinstall Xcode along with the involved parties...... Have tested out creating a thin library (just a test) with the archiver using $ ar -rcT combined.a statictest.a statictest2.a and am getting some weird results so it could be something happening on my computer. Will see if I can get a co worker with a Mac to run the same code.

Regards,
Jacob


 

0 Kudos
Highlighted
Employee
55 Views

Hi Jacob,

Could you please confirm what you use libtool which is provided by Apple(Apple Inc. version cctools-870)? Not a GNU libtool(from Mac ports, brew or any other source).

-Vasily

0 Kudos
Highlighted
Employee
55 Views

Hi Ahmed,

We are able to reproduce this problem using GNU libtool. The root cause of it is what we provide static libraries on OS X only in fat(Universal binary) format and GNU libtool does not know anything about it. Our recommendation here is to use libtool which is provided by Apple in XCode.

-Vasily

0 Kudos
Highlighted
New Contributor I
55 Views

Hello Vasily,

Thanks for tracking it down. Sorry I didn't get to spend as much time working on helping the hunt as I would have liked. After we decided to go towards the Linux versions this became more of a side project. Typing libtool -V gave the apple version but I'm not sure if this is the same as what autoconf is using? I'm certain that at one point before even beginning to work with the IPP libraries I installed the GNU version of libtool and it may be trying to use that. In the future will be sure that it is forced to use the libtool in Apple XCode. 

Regards,
Jacob

0 Kudos