This article describes how to build modules with the Intel C++ Compiler for Android* (ICC) and integrate them into an Android Open Source Project (AOSP) build. A module is typically a shared library or application that will be part of the Android image on the device. Examples are audio/video codecs and multimedia applications.
Building an Android module with the Intel® C++ Compiler for Android* is similar to building it with the GCC toolchain. Please follow the Getting Started guide to compile the module using the NDK build system or a standalone toolchain.
Once the module is compiled and linked it can be integrated into the AOSP build process as prebuild library.It will be included into the Android system image.
Create an Android.mk file below the root of the AOSP tree with the following content:
LOCAL_MODULE := <library_name>
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_SRC_FILES := <library_file_name>
The two placeholders <library_name> and <library_file_name> must be filled with the library file name on the host and on the target. Usually they are the same.
Intel provided versions of the AOSP source tree should be already prepared to use ICC as part of the build process. You can determine if you have an ICC enabled source tree by checking if the file <AOSP_ROOT>build/core/icc_config.mk exists.
Before using the compiler you need to setup the path to the compiler in the file <AOSP_ROOT>build/core/icc_config.mk. Specify the path to ICC by changing the variable TARGET_ICC_TOOLS_PREFIX. For example:
TARGET_ICC_TOOLS_PREFIX := /opt/intel/cc_android_14.0.1.017/bin/
There are a couple of configuration variables that are useful. All of the mentioned variables can be also specified directly on command line as well.
If the module which should be compiled with ICC is already configured in the ICC_MODULES variable there is nothing special to do. Just invoke the compilation as usual using:
source build/envsetup.sh lunch make flashfiles
It's also possible to specify the module which should be compiled with ICC directly on the command line:
source build/envsetup.sh lunch make ICC_MODULES=libskia ICC_STATIC_MODULES=libskia ICC_IPO_MODULES=libskia flashfiles
For compilation of modules which are part of AOSP there might be additional patches required. Please contact your Intel representative if you meet any issues.
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.
Notice revision #20110804