本帖最后由 山大克鲁士 于 2014-6-30 15:13 编辑  
 
问题描述:在调用MKL的时候,直接拉dll、lib和h,但在实际调用的时候发现,h中声明的函数和dll出口的子程序名字完全对不上。 
相关资料:mkl_blas.h、mkl_intel_c_dll.lib、mkl_core.dll 
In mkl_blas.h:[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode void DGEMM(const char *transa, const char *transb, const MKL_INT *m, const MKL_INT *n, const MKL_INT *k,
           const double *alpha, const double *a, const MKL_INT *lda, const double *b, const MKL_INT *ldb,
           const double *beta, double *c, const MKL_INT *ldc); 
 
Dumpbin /exports from mkl_core.dll:[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode ordinal   hint   RVA        name
383       17E    0085F1E0   mkl_blas_dgemm  
 
Dumpbin /all from mkl_intel_c_dll.lib:[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode Archive member name at D5992: _dgemm.obj/     
5256C8FB time/date Thu Oct 10 23:34:19 2013
         uid
         gid
  100666 mode
     312 size
correct header end
FILE HEADER VALUES
             14C machine (i386)
               2 number of sections
        5256C8FB time date stamp Thu Oct 10 23:34:19 2013
             1E2 file pointer to symbol table
               C number of symbols
               0 size of optional header
               0 characteristics
SECTION HEADER #1
.drectve name
       0 physical address
       0 virtual address
      2E size of raw data
      64 file pointer to raw data
       0 file pointer to relocation table
       0 file pointer to line numbers
       0 number of relocations
       0 number of line numbers
  100A00 flags
         Info
         Remove
         1 byte align
RAW DATA #1
  00000000: 2D 64 65 66 61 75 6C 74 6C 69 62 3A 22 75 75 69  -defaultlib:"uui
  00000010: 64 2E 6C 69 62 22 20 2D 64 65 66 61 75 6C 74 6C  d.lib" -defaultl
  00000020: 69 62 3A 22 75 75 69 64 2E 6C 69 62 22 20        ib:"uuid.lib" 
   Linker Directives
   -----------------
   -defaultlib:"uuid.lib"
   -defaultlib:"uuid.lib"
SECTION HEADER #2
   .text name
       0 physical address
       0 virtual address
     114 size of raw data
      92 file pointer to raw data
     1A6 file pointer to relocation table
       0 file pointer to line numbers
       6 number of relocations
       0 number of line numbers
60300020 flags
         Code
         4 byte align
         Execute Read
RAW DATA #2
  00000000: 55 8B EC 83 EC 08 C7 04 24 00 00 00 00 E8 00 00  U.......$.......
  00000010: 00 00 83 C4 04 83 C4 C4 8B 45 08 89 04 24 8B 45  .........E...$.E
  00000020: 0C 89 44 24 04 8B 45 10 89 44 24 08 8B 45 14 89  ..D$..E..D$..E..
  00000030: 44 24 0C 8B 45 18 89 44 24 10 8B 45 1C 89 44 24  D$..E..D$..E..D$
  00000040: 14 8B 45 20 89 44 24 18 8B 45 24 89 44 24 1C 8B  ..E .D$..E$.D$..
  00000050: 45 28 89 44 24 20 8B 45 2C 89 44 24 24 8B 45 30  E(.D$ .E,.D$$.E0
  00000060: 89 44 24 28 8B 45 34 89 44 24 2C 8B 45 38 89 44  .D$(.E4.D$,.E8.D
  00000070: 24 30 8B 45 3C 89 44 24 34 8B 45 40 89 44 24 38  $0.E<.D$4.E@.D$8
  00000080: E8 00 00 00 00 89 45 FC 83 C4 3C 8B 45 FC 85 C0  ......E...<.E...
  00000090: 75 73 83 C4 C4 8B 45 08 89 04 24 8B 45 0C 89 44  us....E...$.E..D
  000000A0: 24 04 8B 45 10 89 44 24 08 8B 45 14 89 44 24 0C  $..E..D$..E..D$.
  000000B0: 8B 45 18 89 44 24 10 8B 45 1C 89 44 24 14 8B 45  .E..D$..E..D$..E
  000000C0: 20 89 44 24 18 8B 45 24 89 44 24 1C 8B 45 28 89   .D$..E$.D$..E(.
  000000D0: 44 24 20 8B 45 2C 89 44 24 24 8B 45 30 89 44 24  D$ .E,.D$$.E0.D$
  000000E0: 28 8B 45 34 89 44 24 2C 8B 45 38 89 44 24 30 8B  (.E4.D$,.E8.D$0.
  000000F0: 45 3C 89 44 24 34 8B 45 40 89 44 24 38 E8 00 00  E<.D$4.E@.D$8...
  00000100: 00 00 83 C4 3C C9 C3 90 E9 00 00 00 00 90 E9 00  ....<...........
  00000110: 00 00 00 90                                      ....
RELOCATIONS #2
                                                Symbol    Symbol
 Offset    Type              Applied To         Index     Name
 --------  ----------------  -----------------  --------  ------
 00000009  DIR32                      00000000         8  _cdecl_xerbla
 0000000E  REL32                      00000000         9  _mkl_serv_set_xerbla_interface
 00000081  REL32                      00000000         A  _mkl_blas_errchk_dgemm
 000000FE  REL32                      00000000         B  _mkl_blas_dgemm
 00000109  REL32                      00000000         3  .text
 0000010F  REL32                      00000000         3  .text
COFF SYMBOL TABLE
000 00000001 ABS    notype       Static       | @feat.00
001 00000000 SECT1  notype       Static       | .drectve
    Section length   2E, #relocs    0, #linenums    0, checksum        0
003 00000000 SECT2  notype       Static       | .text
    Section length  114, #relocs    6, #linenums    0, checksum        0
005 00000000 SECT2  notype ()    External     | _dgemm
006 00000108 SECT2  notype ()    External     | _dgemm_
007 0000010E SECT2  notype ()    External     | _DGEMM
008 00000000 UNDEF  notype ()    External     | _cdecl_xerbla
009 00000000 UNDEF  notype ()    External     | _mkl_serv_set_xerbla_interface
00A 00000000 UNDEF  notype ()    External     | _mkl_blas_errchk_dgemm
00B 00000000 UNDEF  notype ()    External     | _mkl_blas_dgemm
String Table Size = 0x58 bytes 
 
分析讨论:动态库的出口子程序mkl_blas_dgemm,和头文件中声明的函数DGEMM是怎么个对应上的? 
 |