HPMC User Guide v 1.00
© 2026 Bassem W. Jamaleddine


D

   Shared Libraries of an Offloaded Program



Use readelf to locate the shared libraries for a program. For example, the following command prints the shared libraries needed by the program trap_offload.

(uos/HPMC9) 03:22 root@mic0: ~ #  readelf -d trap_offload | grep NEEDED

(HPMC9) 03:22 root@mic0: ~ #  readelf -d trap_offload | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libmpifort.so.12]
 0x0000000000000001 (NEEDED)             Shared library: [libmpi.so.12]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libiomp5.so]
 0x0000000000000001 (NEEDED)             Shared library: [liboffload.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]


The following command prints the shared libraries needed by the shared library liboffload.so.5

(uos/HPMC9) 03:24 root@mic0: ~ #  readelf -d liboffload.so.5 | grep NEEDED

(HPMC9) 03:24 root@mic0: ~ #  readelf -d liboffload.so.5 | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libimf.so]
 0x0000000000000001 (NEEDED)             Shared library: [libsvml.so]
 0x0000000000000001 (NEEDED)             Shared library: [libirng.so]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libiomp5.so]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libintlc.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
Use readelf to locate the library runpath of a program. The following command prints the library runpath of the program trap_offload.

(uos/HPMC9) 03:23 root@mic0: ~ #  readelf -d trap_offload | grep RUNPATH

This section is not included in the SAMPLE PREVIEW.
Use objdump to locate the libraries needed by a program. The following command prints the libraries needed by the program trap_offload.

08:39 root@HPMC: /mm03fs/MPI #  objdump -p trap_offload
     grep NEEDED

08:39 root@HPMC: /mm03fs/MPI #  objdump -p trap_offload | grep NEEDED
  NEEDED               libmpifort.so.12
  NEEDED               libmpi.so.12
  NEEDED               libdl.so.2
  NEEDED               librt.so.1
  NEEDED               libpthread.so.0
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libiomp5.so
  NEEDED               liboffload.so.5
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6


To disassemble programs compiled for the MIC, use the command objdump-mic. For example, the following command disassembles the program mic-gigaflops and generates the output file mic-gigaflops_xphi_Gg.ASMi

#  objdump-mic mic-gigaflops

The command objdump-mic is the shell script shown below.

 -LIS- Listing. D.1   [Shell script to disassemble Xeon Phi Native code using objdump]
(raw text)
1.     #!/bin/ksh 
2.     
3.     PROG=$1
4.     PHIg=$1
5.     PHIg+="_xphi_Gg"
6.     ASMi=$PHIg
7.     ASMi+=".ASMi"
8.     echo $PROG
9.     echo $PHIg
10.    echo $ASMi
11.    
12.    scp $PHIg  mic0:/tmp
13.    
14.    ssh mic0 "objdump -M intel -d /tmp/$PHIg  > /tmp/$ASMi"
15.    
16.    scp mic0:/tmp/$ASMi  .
17.    

HPMC 2026
This section is not included in the SAMPLE PREVIEW.