Software Archive
Read-only legacy content
17061 Discussions

MIC linking issues

PRASHANTH_T_
Beginner
464 Views

I am getting the incompatibility error while linking a library using -mmic flag. I dont know how to make the piece of code compatible with native mic compilation.

x86_64-k1om-linux-ld: i386:x86-64 architecture of input file `libMisc.a(clock_time.o)' is incompatible with k1om output

//clock_time.c code

#include <time.h>

double MPI_Wtime(void);

double clock_time_()
{
  return MPI_Wtime();
}

 

0 Kudos
1 Solution
Kevin_D_Intel
Employee
464 Views

There may be more to resolving this since it appears you are using MPI, maybe in native mode, so I may not have all the answers here.
The error you received indicates libMisc.a was not compiled with -mmic but rather it was compiled for the host (x86-64). For the snippet of code you showed, if that is the extent of the libMisc.a, then you could build it for native as follows:

$ icc -V
Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.2.144 Build 20140120
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

$ icc -c -mmic clock_time.c
$ /usr/linux-k1om-4.7/bin/x86_64-k1om-linux-ar crv libMisc.a clock_time.o
a - clock_time.o

If your interest in using MPI on Xeon Phi™, then you might refer How to run Intel MPI on Xeon Phi. There is a specific the section on Running natively on the Xeon Phi coprocessor that may be of interest.

 

View solution in original post

0 Kudos
3 Replies
Kevin_D_Intel
Employee
465 Views

There may be more to resolving this since it appears you are using MPI, maybe in native mode, so I may not have all the answers here.
The error you received indicates libMisc.a was not compiled with -mmic but rather it was compiled for the host (x86-64). For the snippet of code you showed, if that is the extent of the libMisc.a, then you could build it for native as follows:

$ icc -V
Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.2.144 Build 20140120
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

$ icc -c -mmic clock_time.c
$ /usr/linux-k1om-4.7/bin/x86_64-k1om-linux-ar crv libMisc.a clock_time.o
a - clock_time.o

If your interest in using MPI on Xeon Phi™, then you might refer How to run Intel MPI on Xeon Phi. There is a specific the section on Running natively on the Xeon Phi coprocessor that may be of interest.

 

0 Kudos
PRASHANTH_T_
Beginner
464 Views

Thank you sir. That was very helpful. I am able to run my application natively on MIC.

I am always amazed about the fact on how fast Intel experts replies to forum queries. Kudos to your whole team of experts !

0 Kudos
Kevin_D_Intel
Employee
464 Views

I am glad to hear that helped.
Thank you for those kind words. We appreciate hearing that!
 

0 Kudos
Reply