Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Hua_Z_
Beginner
141 Views

Can I use icl as cross compiler on windows for linux compiling?

And can Intel C++ Compiler Linux Eclipse integration be used on Windows eclipse?

0 Kudos
9 Replies
141 Views

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.

Thanks,

Shenghong

Hua_Z_
Beginner
141 Views

Thank you.

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?

141 Views

Hi Hua,

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:

https://software.intel.com/en-us/articles/using-intel-compiler-in-eclipse-for-embedded-development

(The usage applies to both Windows and Linux host machine).

Thanks,

Shenghong

Hua_Z_
Beginner
141 Views

QQ截图20150226112544.png

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?

141 Views

Hi Hua,

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.

Thanks,

Shenghong

Hua_Z_
Beginner
141 Views

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:QQ截图20150226165550.png

141 Views

“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.

https://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-584320...

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:

https://software.intel.com/sites/default/files/managed/70/1f/Build%20and%20Debug%20Applications%20fo...

In section "2.2", it talks about how to set PATH in eclipse, which will also work.

Thanks,

Shenghong

141 Views

The setting in Eclipse is:

C/C++ Build -> Environment -> Add "PATH"

Thanks,

Shenghong

Hua_Z_
Beginner
141 Views

Okay, I am clear now. I will use enviroment variable in eclipse. Thank you!