Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
58 Views

Build for Atom requires AVX function?

I'm attempting to build a dynamic library as part of an application that runs on an Atom E3845 under a custom OpenEmbedded-based Linux. It's failing to load because a symbol is missing:

"Failed to load library 'xyz.so': /var/volatile/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64_lin/libirng.so: undefined symbol: __intel_avx_rep_memcpy"

The library uses IPP and possibly TBB (it's not my code), and it's being linked against a set of Intel libraries. This is the final link command, with various proprietary terms removed:

icpc -gnu-prefix=x86_64-angstrom-linux- -std=c++11 -D_DEFAULT_SOURCE  -m64 -mtune=atom -xATOM_SSE4.2 --sysroot=/home/usr/local/angstrom-toolchain/REL_30938_1_0/angstrom-x86_64/x86_64-angstrom-linux    -shared xyz.o -Wl,--no-undefined -Wl,--no-allow-shlib-undefined -llib1 -llib2 -llib3 <many more libs> -lz -lm -lcse -ldl -ltcl8.5 -ltiff -lexpat -lgmp -lboost_filesystem -lboost_system -lboost_date_time -lboost_iostreams -lboost_regex -ljpeg -lippcv -lippi -lipps -lippcore -ltbb -lippcc -lippi90lgc -lippcv90lgc -lirc -L/<some dir>/build/lib -L/<some dir>/intel/ipp_legacy/ipp90legacy_lin/linux/lib/intel64 -o xyz.so

In order to try to make sure I understand all of the dependencies, I've included '-Wl,--no-undefined' and '-Wl,--no-allow-shlib-undefined'. I'm building on a separate Linux machine, but the link succeeds and I get xyz.so.

When the application attempts to load it, I get the error shown above.

I believe the Atom doesn't have AVX instructions, and I don't know whether the error is because I haven't got the options correct for the Atom target (-mtune=atom -xATOM_SSE4.2), or whether it's just that I'm missing a library.

Is anyone able to shed any light on this?

Thanks.

0 Kudos
3 Replies
Highlighted
58 Views

Hi Mark,

              Can you try to link the libirng.so as well and check once? Because i see the error coming from that library. You can link using "-lirng" and please do let me know the results.

Regards,
Sukruth H V

0 Kudos
Highlighted
Beginner
58 Views

Hi Sukruth, I had tried adding -lirng before and forgot to mention it. It didn't make any difference, sadly.

0 Kudos
Highlighted
Beginner
58 Views

I found that the symbol __intel_avx_rep_memcpy is provided by two Intel libraries: libmpx.so and libirc.so. I added -lirc to the link list and tried to run the application as before, but got the same "undefined symbol: __intel_avx_rep_memcpy". libirc.so is present on the target, and in the same directory as other libraries that are found.

So I tried adding -lmpx to the link list instead. It has dependencies on libchkp.so, so I had to add that as well. The link fails:

<path>/libmpx.so: undefined reference to `__cpuid_count'
<path>/libmpx.so: undefined reference to `__get_cpuid_max'

__cpuid_count appears to be a macro usually defined in GCC's cpuid.h, so I don't understand why this appears as an undefined reference at the link stage. I presume it must exist as a function somewhere, too - I just can't find where.

I'd appreciate an comments on whether my processor-related options are correct, and/or how I might resolve the undefined references.

Thanks.

0 Kudos