cwindowscompilationintelxeon-phi

How to compile C code for Xeon Phi (Windows 10)


I'm starting to work with a Xeon Phi and I'm stuck trying to compile a simple C program to run it on the coprocessor. I've tried using icl and icc commands but I haven't got any luck.

1.- with icl

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\bin\intel64>icl test.c -o test.mic
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.2.185 Build 20180210
Copyright (C) 1985-2018 Intel Corporation.  All rights reserved.

test.c
Microsoft (R) Incremental Linker Version 14.15.26726.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:test.mic
test.obj

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\bin\intel64>

then I tried to run test.mic on the Xeon Phi

[xeon@mic0 ~]$ ./test.mic
-sh: ./test.mic: cannot execute binary file
[xeon@mic0 ~]$

2.- with icc

C:\Intel\cc_android_2018.2.185\bin\intel64>icc test.c -o test.mic

Error: A license for (Comp-CL) could not be found.
License file(s) used were (in this order):
    1.  C:\Program Files (x86)\Common Files\\Intel\Licenses\NCOM_W___XXXX-XXXXXXXX.lic
    2.  C:\Intel\cc_android_2018.2.185\bin\intel64\..\..\Licenses
    3.  C:\Program Files\Common Files\Intel\Licenses\NCOM_W___XXXX-XXXXXXXX.lic
    4.  C:\Intel\cc_android_2018.2.185\bin\intel64\NCOM_W___XXXX-XXXXXXXX.lic

Please refer https://software.intel.com/en-us/faq/licensing#invalid-license-error for more information..

icc: error #10052: could not checkout FLEXlm license

I'm not sure about this error because I have the license.


Solution

  • The problem was the Intel Parallel Studio version I was using (Intel Parallel Studio 2018) . I downloaded Intel Parallel Studio 2017 Update 7 and the compilation worked. The command I was using:

    icl /Qmic test.c -o test.out
    

    And I was getting this error:

    icl: command line remark #10148: option '/Qmic' not supported