Hi Hua Z,
What kind of cross-compiling (what is your target Linux?) you want to use ICL? ICL itself cannot be used for cross-compile, but we have another product for embedded (Intel System Studio), which has the cross compiler provided for Android, WinRiver Linux, Yocto etc. We have official support for Android and WinRiver Linux because both them has windows toolchains/SDK. For other Linux (example, Yocto), if you have the toolchain for your target Linux, technically, you can also use the ICC (not ICL) in Intel System Studio on windows.
Note: "toolchain/sdk"? As Intel compiler will depends on some other GNU tools (example: gcc, g++, ld, ar) for compiling, if you have a already working environment with GNU toolchains on windows, you may switch to Intel compiler (from Intel system studio). Or, it is difficult. Also, the "toolchain"/"sdk", will usually provide the headers and libraries for your target Linux, which is required for compiling.
Intel System Studio: http://software.intel.com/en-us/intel-system-studio
Let me know if you have any concerns. Regarding Eclipse integration, yes it works on windows too.
I just wanna compile code for x86_64 centos linux on windows machine. I have GNU toolchains on Windows Eclipse enviroment and it works well.
So, where to find Eclipse integration package? system studio linux version?
You should use Intel System Studio for Linux Target, the windows host package. The Eclipse integration is provided during the installation, you may also manually run the integration after ISS installed.
You may refer to this article for more details about Eclipse integration:
(The usage applies to both Windows and Linux host machine).
11:17:36 **** Incremental Build of configuration Debug for project NodeNet ****
Info: Internal Builder is used for build
icpc -g -O0 "--sysroot=D:\\Program Files\\Sourcery_CodeBench_Lite_for_IA32_GNU_Linux" -gnu-prefix=i686-pc-linux-gnu- -c -o "cpp\\cpp.o" "..\\cpp\\cpp.cpp"
icpc: error #10001: could not find directory in which i686-pc-linux-gnu-g++.exe resides
error #10001 encountered. why cross compiler i686-pc-linux-gnu-g++.exe cannot be found?
You need to make sure your GNU toolchain is set up PATH environment variable for your windows (http://www.computerhope.com/issues/ch000549.htm).
You may also set PATH environment variable for your project only, in Eclipse. Setting is in windows OS environment variable may be simple. Let me know if it works or not.
Thank you. Making i686-pc-linux-gnu-g++.exe to be in PATH should work, I guess. So what the parameter "Sysroot" in the picture above is used for? I don't want g++ in PATH because I use multiple gcc versions simutaneously. I hope Sysroot works like this:
“sysroot" is used to point to the "root" of your target system (example: your Linux), in "sysroot", it will have folders like "usr/include", "lib", which contains the headers and libraries for the target system, while compiling, compiler will search for headers and libraries in these folders.
In a Linux (not cross compile), compiler (gcc or icc) will search system headers in "/usr/include".
In a cross compile environment, compiler will search system headers in "<sysroot>/usr/include".
Hope it is clear now. Note again, the "sysroot" concept applies for GCC too, for a GCC cross-compiler, sysroot is also needed, but when you build your GCC, you may specific --sysroot as built-in option. Whatever, there are lots of possible solutions to set sysroot for GCC, but the concept of sysroot is same for ICC.
If you do not want g++ in PATH globally, you can set it for your project only (as I mentioned in my last reply), Eclipse itself provides such features already. You may refer to below link:
In section "2.2", it talks about how to set PATH in eclipse, which will also work.