Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Problem compiling LEO_Tutorial

w_hinsleyimperial_ac
1,646 Views

Hi,

I'm running Microsoft Visual Studio 2013 (u4), with Intel Parallel Studio 2016 C++. I'm trying to compile the LEO_Tutorial project that comes with Parallel Studio in the mic_samples.zip, and having some problems. According to the tutorial, I should load the solution, set it to use Intel C++, and it should just build out of the box.

The error I get in the Build Output is:-

1>  tbo_sort.c
1>  k1om-mpss-linux-ld.exe: cannot find -lifcoremt
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\x64\PlatformToolsets\Intel C++ Compiler 16.0\Toolset.targets(1084,5): error MSB6006: "xilink.exe" exited with code 1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

And I also have about 30 bits of code underlined in red, starting with lines 49,50 (target is underlined in red)

__declspec (target(mic)) int *O_vals;
__declspec (target(mic)) int MAXSZ = 26;

then lines 66,67, where the final part is underlined in red. (ie, it thinks _Cilk_shared is the variable name).

int * _Cilk_shared all_Vals_shrd;
int * _Cilk_shared P_vals;

There are many others, but it looks like a basic problem that none of the extended syntax is being recognised, and I can't see how you turn it on or change anything.

Could anyone help me get started with this?
Many thanks,
Wes

0 Kudos
12 Replies
Kevin_D_Intel
Employee
1,646 Views

Thank you for notifying us about this. Interesting it is looking for the Fortran RTL (libifcoremt). I have a hunch about that and will look into this and try to offer a work around.

Just a quick question/confirmation, I note you wrote "with Parallel Studio 2016 C++" so I'm guessing you only installed the Intel C++ compiler and not both the Intel C++ and Fortran, is that correct?

0 Kudos
w_hinsleyimperial_ac
1,646 Views

Yes, that's right - it's actually an academic installation which only comes with C++. Intel Parallel Studio XE 2016 (Pro). I forgot to mention too, as in otheer material I've read, I'm trying to build in Release x64 mode - and in fact I've only installed the 64-bit Intel compiler. I also had MPSS installed earlier, which Parallel Studio spotted during installation and offered to restart MPSS with Amplifier. I don't know if I need to tell the compiler where that is in any other special way.

Thanks again,

0 Kudos
Kevin_D_Intel
Employee
1,646 Views

I believe your installation/setup is just fine and I don't suspect anything with that. I can see where this library appears in the link but I not sure how to work around this at the moment.  Stay tuned....

 

0 Kudos
Kevin_D_Intel
Employee
1,646 Views

I uncovered the root cause. Under the VS IDE, the underlying link to create the offload image incorrectly includes the Fortran RTL, libifcoremt, leading to the link failure when the Intel Fortran compiler is not present.  Unfortunately I have not been able to find a work around. It only happens when building C/C++ offload programs under the VS IDE. You can build and run offload programs via the command-line.

For the offload samples/tutorial included in the PSXE 2016 product, you can if you want, build and run those via the command-prompt using the build.bat script that is present with these samples/tutorial. Depending on your OS, the Intel compiler command-prompt shortcuts are available via the Start Menu and under Intel Parallel Studio XE 2016 > Compiler and Performance Libraries > Command Prompt with Intel Compiler 16.0, or Apps > Intel Parallel Studio XE 2016.

We apologize for the inconvenience. I will keep you updated about a resolution.

(Internal tracking id: DPD200376506)

0 Kudos
w_hinsleyimperial_ac
1,646 Views

Thanks for exploring this - I'll look forward to a resolution in due course.

In the meantime - could I ask a couple of things:-

1. Do you have any thoughts about all the syntax underlining that Visual Studio is doing in the code - it seems very confused with the extended syntax in the LEO Tutorial, even before it gets to trying to compile it. I guess that might be VS's problem. By the bottom of tbo_sort.c, it's not even recognising printf - it says int printf(<error-type>) Error: excepted a declaration.

2. Is it worth trying the integratation of C++ 2016 into Eclipse on Windows, to compile some Phi code?

Thanks,
Wes
 

0 Kudos
Kevin_D_Intel
Employee
1,646 Views

I found a work around that enables building under the VS IDE. Under the project's property settings, please add -no-fortlib under the property setting Linker > General [Intel C++] > Additional Options for MIC Offload Linker

0 Kudos
w_hinsleyimperial_ac
1,646 Views

Great - that's got a successful build of the exe! I'll at least be able to test the Phi hardware we have.

I wonder whether VS will be very practical to code with though, with all the errors it thinks are there, but don't affect compilation.

Thanks again,

Wes

0 Kudos
w_hinsleyimperial_ac
1,646 Views

More challenges: when I run the EXE on a Phi machine, I get:-

T:\Wes\Phi>LEO_tutorial.exe

  C/C++ Tutorial: Offload Demonstration

  Checking for Intel(R) Xeon Phi(TM) (Target CPU) devices...

    Number of Target devices installed: 1

The remote process indicated that the following libraries could not be loaded:
liboffload.so.5 libiomp5.so libcilkrts.so.5
offload error: cannot start process on the device 0 (error code 19).

The Phi card appears online - I can ping it in 192.168.1.100. Everything passes when I run miccheck.exe, and status is OK. MicInfo also returns a full set of information, starting with

Device No: 0, Device Name: mic0

        Version
                Flash Version            : 2.1.02.0391
                SMC Firmware Version     : 1.17.6900
                SMC Boot Loader Version  : 1.8.4326
                uOS Version              : 2.6.38.8+mpss3.5.2
                Device Serial Number     : ADKC50500746

0 Kudos
Kevin_D_Intel
Employee
1,646 Views

It looks like you are running under a command-prompt window. Make sure to use the Intel compiler pre-initialized command-prompt which offers the best convenience.

The error you experienced can occur when the MIC_LD_LIBRARY_PATH environment variable is not set. In that same command-prompt window you used, issue the set command below and try running again.

set MIC_LD_LIBRARY_PATH=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\intel64_win_mic

0 Kudos
w_hinsleyimperial_ac
1,646 Views

Ah, I see. The variable was set, but the machine with the Phi is a cluster node which doesn't have Parallel Studio on it, so I needed to copy the folder of .so files to a cluster-visible place and set the library path to point to that.

Great, that's the first test compiled and running. Thanks again,

 

0 Kudos
Kevin_D_Intel
Employee
1,646 Views

Good to hear.

Going back to the underlining of some items in the source that you noted earlier. Those should not affect building or running under the IDE. They are not errors, it is just Visual Studio IntelliSense feature flagging them. Unknown keywords for the offload extensions are flagged and that seems to lead to other variable uses getting flagged. I don't think this is unexpected but I'll inquire about them.

0 Kudos
Kevin_D_Intel
Employee
1,646 Views

Going back to your inquiry on Eclipse, we only support integration with Eclipse under Linux. I'm not familiar with Eclipse on Windows but I do not believe it is worth your time to try. In at least this older thread, https://software.intel.com/en-us/forums/intel-c-compiler/topic/308337, some tried (not related to using offload extensions) and experienced some problems. The offload extensions add a new layer of complexity to the compilation/linking and I don't know whether that would lead to additional problems. Sorry I don't have been news on that.

0 Kudos
Reply