Android NDK standalone toolchain and x86-icc

Android NDK standalone toolchain and x86-icc

Hi,

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/make-standalone-toolchain.sh  --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 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
Alexander Weggerle (Intel)的头像

Hi Wolfgang,

Using ICC for Android in a standalone environment is pretty simple: Just source the compilervars.sh in the {installdir}/bin directory. There is no need to use the make-standalone-toolchain.sh script. This is also documented in the Getting Started Guide: https://software.intel.com/sites/products/documentation/doclib/stdxe/201...
I guess this could be stated more clear. What do you think?

Hope this helps you!
Thanks,
Alex

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. make-standalone-toolchain.sh  --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/compilervars.sh
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

e.g.
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?

Thanks,

Wolfgang

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

Setting:

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 make-standalone-toolchain.sh isn't necessary as long as you source the compilervars.sh would have helped me to better understand the differences between gcc x86 and icc.

Alexander Weggerle (Intel)的头像

Hi Wolfang,

I'm glad that you solved it.

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

Alex

登陆并发表评论。