Android NDK standalone toolchain and x86-icc

Android NDK standalone toolchain and x86-icc


I'm trying to build libpng with x86-icc. I already built it using the x86 standard toolchain from the ndk, but want to use the intel compiler now.

Therefore I try to make a new standalone toolchain with the following command:

$ANDROID_NDK_ROOT/build/tools/  --platform=android-9 --install-dir=$PLATFORM_PREFIX --toolchain=x86-icc --verbose

Wich fails with the following output:

Auto-config: --arch=x86
Targetting CPU: x86
Using GCC version:
Toolchain /<path to my android ndk>/android-ndk-r9d/toolchains/x86-icc/prebuilt/darwin-x86_64/bin/i686-linux-android-gcc is missing!

I've checked and there is no prebuilt directory in .../x86-icc. How do I get a standalone build chain for android ndk that uses he intel compiler? Any help is greatly appreciated!

I'm running this on macos x with android ndk-r9d

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Wolfgang,

Using ICC for Android in a standalone environment is pretty simple: Just source the in the {installdir}/bin directory. There is no need to use the script. This is also documented in the Getting Started Guide:
I guess this could be stated more clear. What do you think?

Hope this helps you!

That sounds good, however I'm still not sure how to configure the cross compilation build correctly.

The library in question is libpng and currently for android x86 builds I'm doing the following to build libpng.a

1.  --platform=android-9 --install-dir=$PLATFORM_PREFIX --toolchain=x86-4.6
2. ./configure --host=i686-linux-android --prefix=$PLATFORM_PREFIX
3. make
4. make install

I've changed this now for the ICC to:

1. source /opt/intel/cc_android_14.0.2.024/bin/
2. ./configure --host=i686-linux-android --prefix=/opt/intel/cc_android_14.0.2.024/toolchains/r9/x86-icc
3. make

--> from the output I can see it is still using gcc

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DPNG_CONFIGURE_LIBPNG -g -O2 -MT libpng14_la-pngwutil.lo -MD -MP -MF .deps/libpng14_la-pngwutil.Tpo -c pngwutil.c -o libpng14_la-pngwutil.o

Am I missing a step?



Got it, I was missing the CC, CCX, LD and AR environment variables before running configure.


export CC="icc -m32 -march=ia32"
export CXX="icpc -m32   -march=ia32"
export LD="xild"
export AR="xiar"

and running:

./configure --host=i686-linux-android --prefix=`pwd`/android-x86-icc

now works.

Thanks for the assistance.

As you asked for feedback on the documentation. I think a note stating that running isn't necessary as long as you source the would have helped me to better understand the differences between gcc x86 and icc.

Hi Wolfang,

I'm glad that you solved it.

Thanks for your feedback. I will try to get it in the next release. 


Leave a Comment

Please sign in to add a comment. Not a member? Join today