Software Archive
Read-only legacy content
17061 Discussions

Error while compiling with -tcollect : ITAC

Ambuj_P_
Beginner
650 Views

I'm facing the following errors while trying to build my application for MIC with -tcollect flag:

x86_64-k1om-linux-ld: skipping incompatible /opt/intel//itac/8.1.4.045/intel64/itac/lib_impi4/libVT.a when searching for -lVT
x86_64-k1om-linux-ld: cannot find -lVT
x86_64-k1om-linux-ld: skipping incompatible /opt/intel//itac/8.1.4.045/intel64/itac/lib_impi4/libdwarf.a when searching for -ldwarf
x86_64-k1om-linux-ld: cannot find -ldwarf
x86_64-k1om-linux-ld: skipping incompatible /opt/intel//itac/8.1.4.045/intel64/itac/lib_impi4/libelf.a when searching for -lelf
x86_64-k1om-linux-ld: cannot find -lelf
x86_64-k1om-linux-ld: skipping incompatible /opt/intel//itac/8.1.4.045/intel64/itac/lib_impi4/libvtunwind.a when searching for -lvtunwind
x86_64-k1om-linux-ld: cannot find -lvtunwind

I'm compiling with icpc and supporting flags. I had sourced itacvars.sh of host. What am i missing here?

0 Kudos
7 Replies
Kevin_D_Intel
Employee
650 Views

I reproduced the error when compiling using the compiler driver (icc/ifort) with -mmic and -tcollect so this may be what you experienced; however, that does not appear to be the proper method for using this feature for Xeon Phi™.

See the related post here with information that may be helpful.

I also requested help from someone more knowledgeable with this feature so please stay tuned for their reply.

 

0 Kudos
Kevin_D_Intel
Employee
650 Views

Some guidance received suggested this may be a defect with the compiler driver linking the "intel64" libraries where it should have linked the "mic" version based on the -mmic.

On your compilation line, can you try adding: -L/opt/intel//itac/8.1.4.045/mic/lib

0 Kudos
Ambuj_P_
Beginner
650 Views

Hi Kevin,
Adding -L/opt/intel//itac/8.1.4.045/mic/lib didn't solve the problem. I'm getting new errors:

ld: skipping incompatible /opt/intel/itac/latest/mic/lib/libVT.a when searching for -lVT
ld: skipping incompatible /opt/intel/itac/latest/mic/lib/libdwarf.a when searching for -ldwarf
ld: skipping incompatible /opt/intel/itac/latest/mic/lib/libelf.a when searching for -lelf
ld: skipping incompatible /opt/intel/itac/latest/mic/lib/libvtunwind.a when searching for -lvtunwind
/opt/intel/itac/8.1.2.033/intel64/itac/lib_impi4/libVT.a(VT_timer.o): In function `VT_TimerClockMPI':
/nfs/inn/disks/nn-ssg_tcar_mpi_2Tb_unix/scratch1/ITAC/weeklytesting/ITAC_P_8_1_2_RC2/tracing/vampirtrace/src/generic/VT_timer.c:(.text+0x25): undefined reference to `PMPI_Wtime'
/opt/intel/itac/8.1.2.033/intel64/itac/lib_impi4/libVT.a(VT_timer.o): In function `VT_TimerScopeMPI':
/nfs/inn/disks/nn-ssg_tcar_mpi_2Tb_unix/scratch1/ITAC/weeklytesting/ITAC_P_8_1_2_RC2/tracing/vampirtrace/src/generic/VT_timer.c:(.text+0x5b): undefined reference to `PMPI_Attr_get'

and so on...

x86_64-k1om-linux-ld: /opt/intel/itac/latest/mic/lib/libVT.a(VT_core.o): relocation R_X86_64_32 against `.rodata.str1.4' can not be used when making a shared object; recompile with -fPIC
/opt/intel/itac/latest/mic/lib/libVT.a: could not read symbols: Bad value

PS: fPIC flag is already present in my arguments.

0 Kudos
Kevin_D_Intel
Employee
650 Views

Ok, can you please share with me the complete compilation line you are using?

0 Kudos
Ambuj_P_
Beginner
650 Views

Hi Kevin,

I've sent you the compilation line.

0 Kudos
Kevin_D_Intel
Employee
650 Views

In last collection of link failures you posted, most came from "ld" which is the host (CPU)-side linker and it’s complaining about not understanding libraries built for the Xeon Phi™ which is not surprising. Only the last message in that last collection came from the x86_64-k1om-linux-ld which is the expected linker that is used with -mmic. The initial link errors you posted also came from the x86_64-k1om-linux-ld.

So, I’m confused how your build produced a mix of linker errors when using -mmic. From your last collection of linker errors it appears the attempt to add the path to the “mic” libraries went badly. Maybe the -mmic option was left out and so it did not use the correct ld, or maybe the build process includes multiple link steps to build both host and MIC executable separately and the path to the MIC libraries was accidentally included in the host link, maybe you can tell?

When I’m using only the icc driver and compiling with -tcollect -mmic I can produce the first set of x86_64-k1om-linux-ld errors you posted. When only the “mic” library path is added as I suggested the link suffers a number of undefined references to MPI routines like:

/opt/intel/itac/8.1.4.045/mic/lib/libVT.a(VT_timer.o): In function `VT_TimerClockMPI':
/nfs/inn/disks/nn-ssg_tcar_mpi_2Tb_unix/scratch1/ITAC/weeklytesting/ITAC_P_8_1_4_RC2/tracing/vampirtrace/src/generic/VT_timer.c:(.text+0x15): undefined reference to `PMPI_Wtime'

When adding a path/reference to the MPI library, I can successfully link. In other words, this command-line succeeds:

icc  -tcollect -mmic test.c -L/opt/intel/itac/8.1.4.045/mic/lib -L/opt/intel/impi/4.1.3.049/mic/lib -lmpi

When I compile using the mpi compiler wrapper (i.e. mpiicc -tcollect -mmic test.c) the compile/link also completes successfully.

The need to add the path to the “mic” itac libraries is a compiler driver defect that I will submit to our developers.

Let me check again with someone more knowledgeable about these tools to see whether it is expected to be able to only use the compiler driver (icc) with -tcollect and the path to the MPI libraries as I showed. In the mean-time, you might try adding the path/reference to the MPI libraries also after sorting out why your build produced a mix of errors from both host/MIC linkers.

0 Kudos
Kevin_D_Intel
Employee
650 Views

The guidance from others is to use the MPI compiler wrappers, mpiicc/mpiicpc for now until the icc driver is fixed. So for the example I showed earlier, something like:

For the Xeon (host) build: mpiicc -tcollect test.c
For the Xeon Phi (coprocessor) native build: mpiicc -tcollect -mmic test.c

0 Kudos
Reply