Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Tomas_T_
Beginner
165 Views

Linker issues migrating from v6 to v8

I'm currently trying to test Ipp 8.0 on a Linux platform (Ubuntu 12.04) where I've been using version 6.0.1

I'm trying to link statically but I always get: 'unresolvable R_386_GOTOFF relocation against symbol `ippJumpIndexForMergedLibs' which prompted me to try the nonpic libraries. 

This worked well enough for one simple application but another, more complex ones fails linking with a host of errors similar to this (full list attached):

/opt/intel/composer_xe_2013_sp1.0.061/ipp/lib/ia32/nonpic/libippi.a(piresset_p8---ownResize16plLz3.o): In function `p8_ownResize16plLz3':
piresset_p8---ownResize16plLz3.i:(.text+0xd1): undefined reference to `p8_ippsCopy_32f'
piresset_p8---ownResize16plLz3.i:(.text+0xdf): undefined reference to `p8_ippsCopy_32f'
piresset_p8---ownResize16plLz3.i:(.text+0x17b): undefined reference to `p8_ippsCopy_32f'
piresset_p8---ownResize16plLz3.i:(.text+0x25b): undefined reference to `p8_ippsCopy_32f'
piresset_p8---ownResize16plLz3.i:(.text+0x266): undefined reference to `p8_ippsCopy_32f'
/opt/intel/composer_xe_2013_sp1.0.061/ipp/lib/ia32/nonpic/libippi.a(piresset_p8---ownResize16plLz3.o):piresset_p8---ownResize16plLz3.i:(.text+0x2c4): more undefined references to `p8_ippsCopy_32f' follow

Help on identifying the issues would be much appreciated 

linker command g++ -o build-host-debug/bin/xrp -L/opt/intel/composer_xe_2013_sp1.0.061/ipp/lib/ia32/nonpic -Xlinker --copy-dt-needed-entries -L./build-host-debug/lib -Wl,-rpath  .... long list of .o files and libs

 

0 Kudos
29 Replies
Sergey_K_Intel
Employee
124 Views

Hi Tomas,

You probably don't need to link with non-pic libraries, unless you build a kernel-mode application like a driver. Regarding unresolved references, please check the order of IPP libs in linker command line: -lippi -lipps -lippvm -lippcore. The other ordering may lead to unresolved symbols.

Regards,
Sergey

Tomas_T_
Beginner
124 Views

Thank you Sergey - that did the trick

I'm still unable to use anything other than nonpic due to 'unresolvable R_386_GOTOFF relocation against symbol `ippJumpIndexForMergedLibs'

Is there a downside to using the nonpic libs?

Sergey_K_Intel
Employee
124 Views

Could you provide the full R_386 diagnostics message? What object file or library module produces that relocation reference?

That's unpleasant diagnostics, because the relocation looks like compiler-generated.

Regards,
Sergey

Tomas_T_
Beginner
124 Views

/usr/bin/ld: /opt/intel/composer_xe_2013_sp1.0.061/ipp/lib/ia32//libippi.a(jmp_ippiAndC_8u_C1IR_as.o)(.text+0x10): unresolvable R_386_GOTOFF relocation against symbol `ippJumpIndexForMergedLibs'

 

Tomas_T_
Beginner
124 Views

I'm still a bit curious as to what the downside to nonpic libraries is. Although I'm not building drivers there are some real-time deterministic demands on my system.

Sergey_K_Intel
Employee
124 Views

Tomas T. wrote:

/usr/bin/ld: /opt/intel/composer_xe_2013_sp1.0.061/ipp/lib/ia32//libippi.a(jmp_ippiAndC_8u_C1IR_as.o)(.text+0x10): unresolvable R_386_GOTOFF relocation against symbol `ippJumpIndexForMergedLibs'

I have asked our QAs regarding this topic. They are trying to reproduce and answer.

As for pic/non-pic libraries, you can use them both - they are tested equally during package preparation. But major area of non-pic libraries usage is kernel-mode execution. Though, I don't know much here.

Regards,
Sergey

 

Pavel_B_Intel1
Employee
124 Views

Hi Tomas,

I try to reproduce your example:

Distributor ID: Ubuntu
Description:    Ubuntu 12.04 LTS
Release:        12.04
Codename:       precise
#36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux

g++ --version
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 

cat ipptwo.cpp
#include <stdio.h>
#include "ipp.h"
 
int main( void )
{
    ippInit();
 
    const IppLibraryVersion* libver;       /* library info structure ptr */
 
    /* first print the version of the libraries */
    libver = ippsGetLibVersion();
    printf( " %s %s \n", libver->Name, libver->Version );
    libver = ippiGetLibVersion();
    printf( " %s %s \n\n", libver->Name, libver->Version );
 
    return 0;
}
 

g++ -o ipptwo ipptwo.cpp -I $IPPROOT/include $IPPROOT/lib/ia32/libippi.a $IPPROOT/lib/ia32/libipps.a $IPPROOT/lib/ia32/libippcore.a                                                              
 

 

./ipptwo
 ippSP SSE4.1/4.2 (p8) 8.0.0 (r40040)
 ippIP SSE4.1/4.2 (p8) 8.0.0 (r40040)
 

 

As you can see it works. So let investigate why you can't link IPP libraries. Please start to build this simple example.

 

Pavel

Pavel_B_Intel1
Employee
124 Views

Sorry I didn't point that I used IPP PIC libraries which are placed in $IPPROOT/lib/ia32 folder.

Pavel

Sergey_K_Intel
Employee
124 Views

Let's show more relevant example with Tomas' function:

[cpp]
#include <stdio.h>
#include <ippi.h>
int main()
{
    IppiSize roi = {0, 0};
    ippiAndC_8u_C1IR(0, NULL, 0, roi);
    printf("Test passed\n");
}
[/cpp]

The command line for compiler/linker is:

gcc -O0 -w -I$IPPROOT/include test.cpp $IPPROOT/lib/ia32/libippi.a $IPPROOT/lib/ia32/libippcore.a -Xlinker -Map=output.map

The output.map shows that ippiAndC is really included from various IPP libs (px, w7, etc.). O0 used just to deny compiler optimizations.

./a.out gives "Test passed". AndC function doesn't work, because address is NULL.

Tomas, please do the same.

Regards,
Sergey

 

Tomas_T_
Beginner
124 Views

First thing first

./ipptwo 
 ippSP AVX (g9) 8.0.0 (r40040) 
 ippIP AVX (g9) 8.0.0 (r40040) 

 

Tomas_T_
Beginner
124 Views

a.out gives test passed

Sergey_K_Intel
Employee
124 Views

Encouraging results, the libraries are ok. What about your case?

Regards,
Sergey

Tomas_T_
Beginner
124 Views

Are the scripts referred to in getting started crucial? 

They all return with errrors

 

Tomas_T_
Beginner
124 Views

There were supposed to be attchments ....

Pavel_B_Intel1
Employee
124 Views

Sorry Tomas, I don't understand what did you do?  Which script did you use? Could you explain your steps?

Tomas_T_
Beginner
124 Views

The 'getting started' guide instructs to run appropriate scripts found under /opt/intel/compser.../bin

 

 

After installing Intel IPP, set the environment variables by running the script appropriate to your target platform architecture. The scripts are available in <install_dir>/ipp/bin.

<install_dir> is the installation directory, by default, it is:

    For super-users:      /opt/intel/composer_xe_2013_sp1

 

-rwxr-xr-x 1 root  root   1102 Feb  6 16:10 compilervars.csh*
-rwxr-xr-x 1 root  root   1035 Feb  6 16:10 compilervars.sh*
-rwxr-xr-x 1 pluto pluto 31578 Feb  6 16:09 link_install.sh*

 

The output of those is in the textfiles 

Pavel_B_Intel1
Employee
124 Views

Ok, I understand.

In the IPP User Guide you see: "After installing Intel IPP, set the environment variables by running the script appropriate to your target platform architecture. The scripts are available in <install_dir>/ipp/bin."

So you should go to /opt/intel/composer/ipp/bin and run ippenv.sh script to set IPP environment

Pavel

Tomas_T_
Beginner
124 Views

OK - there was a missing /ipp in my folder path - sorry

Still get an error though

pluto@supertriton:/opt/intel/composer_xe_2013_sp1/ipp/bin$ sudo ./ippvars.sh
[sudo] password for pluto:
./ippvars.sh: 39: ./ippvars.sh: [[: not found

 

Pavel_B_Intel1
Employee
124 Views

You should run:

. ippvars.sh ia32
. ippvars.sh intel64
or
. ippvars.sh ia32_intel64

in depends which architecture you use

Pavel

Tomas_T_
Beginner
43 Views

This is what I did (using the ia32 argument), and got the above error

Reply