You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README 9.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. -------------------------------------------------------------------------------
  2. C Interface to LAPACK
  3. README
  4. -------------------------------------------------------------------------------
  5. Introduction
  6. -------------------------------------------------------------------------------
  7. This library is a part of reference implementation for the C interface to
  8. LAPACK project according to the specifications described at the forum for
  9. the Intel(R) Math Kernel Library (Intel(R) MKL):
  10. http://software.intel.com/en-us/forums/showthread.php?t=61234
  11. This implementation provides a native C interface to LAPACK routines available
  12. at www.netlib.org/lapack to facilitate usage of LAPACK functionality
  13. for C programmers.
  14. This implementation introduces:
  15. - row-major and column-major matrix layout controlled by the first function
  16. parameter;
  17. - an implementation with working arrays (middle-level interface) as well as
  18. without working arrays (high-level interface);
  19. - input scalars passed by value;
  20. - error code as a return value instead of the INFO parameter.
  21. This implementation supports both the ILP64 and LP64 programming models,
  22. and different complex type styles: structure, C99.
  23. This implementation includes interfaces for the LAPACK-3.2.1 Driver and
  24. Computational routines only.
  25. -------------------------------------------------------------------------------
  26. Product Directories
  27. -------------------------------------------------------------------------------
  28. The installation directory of this package has the following structure:
  29. src - C interface source files
  30. utils - C interface auxiliary files
  31. include - header files for C interface
  32. -------------------------------------------------------------------------------
  33. Installation
  34. -------------------------------------------------------------------------------
  35. The reference code for the C interface to LAPACK is built similarly to the
  36. Basic Linear Algebra Subprograms (BLAS) and LAPACK. The build system produces
  37. a static binary lapacke.a.
  38. You need to provide a make.inc file in the top directory that defines the
  39. compiler, compiler flags, names for binaries to be created/linked to. You may
  40. choose the appropriate LP64/ILP64 model, convenient complex type style,
  41. LAPACKE name pattern, and/or redefine system malloc/free in make.inc. Several
  42. examples of make.inc are provided.
  43. After setting up the make.inc, you can build C interface to LAPACK by typing
  44. make lapacke
  45. -------------------------------------------------------------------------------
  46. Handling Complex Types
  47. -------------------------------------------------------------------------------
  48. The interface uses complex types lapack_complex_float/lapack_complex_double.
  49. You have several options to define them:
  50. 1) C99 complex types (default):
  51. #define lapack_complex_float float _Complex
  52. #define lapack_complex_double double _Complex
  53. 2) C structure option (set by enabling in the configuration file):
  54. -DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_STRUCTURE
  55. typedef struct { float real, imag; } _lapack_complex_float;
  56. typedef struct { double real, imag; } _lapack_complex_double;
  57. #define lapack_complex_float _lapack_complex_float
  58. #define lapack_complex_double _lapack_complex_double
  59. 3) C++ complex types (set by enabling in the configuration file):
  60. -DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_CPP
  61. #define lapack_complex_float std::complex<float>
  62. #define lapack_complex_double std::complex<double>
  63. You have to compile the interface with C++ compiler with C++ types.
  64. 4) Custom complex types:
  65. -DLAPACK_COMPLEX_CUSTOM
  66. To use custom complex types, you need to:
  67. - Define lapack_complex_float/lapack_complex_double types on your own.
  68. - Optionally define lapack_make_complex_float/lapack_make_complex_double_real
  69. functions if you want to build the testing suite supplied. Use these
  70. functions for the testing system. Their purpose is to make a complex value of
  71. a real part re, imaginary part im. The prototypes are as follows:
  72. lapack_complex_float lapack_make_complex_float( float re, float im );
  73. lapack_complex_double lapack_make_complex_double( double re, double im );
  74. -------------------------------------------------------------------------------
  75. Choosing ILP64 Data Model
  76. -------------------------------------------------------------------------------
  77. To choose ILP64 data model (set by enabling in the configuration file), use the
  78. following options:
  79. -DHAVE_LAPACK_CONFIG_H -DLAPACK_ILP64
  80. -------------------------------------------------------------------------------
  81. Using Predicate Functions
  82. -------------------------------------------------------------------------------
  83. The functions
  84. lapacke_?gees/lapacke_?gees_work
  85. lapacke_?geesx/lapacke_?geesx_work
  86. lapacke_?geev/lapacke_?geev_work
  87. lapacke_?geevx/lapacke_?geevx_work
  88. require the pointer to a predicate function as an argument of a predefined type
  89. such as:
  90. typedef lapack_logical (*LAPACK_S_SELECT2) ( const float*, const float* );
  91. The purpose and format of these predicate functions are described in the LAPACK
  92. documentation. This interface passes the pointer to the corresponding LAPACK
  93. routine as it is.
  94. Be cautious with return values of the logical type if you link against LAPACK
  95. compiled with Fortran compiler. Whereas all non-zero values are treated as TRUE
  96. generally, some Fortran compilers may rely on a certain TRUE value, so you will
  97. have to use the same TRUE value in the predicate function to be consistent with
  98. LAPACK implementation.
  99. -------------------------------------------------------------------------------
  100. Implementation Details
  101. -------------------------------------------------------------------------------
  102. The current C interface implementation consists of wrappers to LAPACK routines.
  103. The row-major matrices are transposed on entry to and on exit from the LAPACK
  104. routine, if needed. Top-level interfaces additionally allocate/deallocate
  105. working space on entry to and on exit from the LAPACK routine.
  106. Because of possible additional transpositions, a routine called with
  107. this interface may require more memory space and run slower than the
  108. corresponding LAPACK routine.
  109. -------------------------------------------------------------------------------
  110. Disclaimer and Legal Information
  111. -------------------------------------------------------------------------------
  112. INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL(R)
  113. PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO
  114. ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT
  115. AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS,
  116. INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS
  117. OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS
  118. INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR
  119. PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR
  120. OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS OTHERWISE AGREED IN WRITING
  121. BY INTEL, THE INTEL PRODUCTS ARE NOT DESIGNED NOR INTENDED FOR ANY
  122. APPLICATION IN WHICH THE FAILURE OF THE INTEL PRODUCT COULD CREATE A
  123. SITUATION WHERE PERSONAL INJURY OR DEATH MAY OCCUR.
  124. Intel may make changes to specifications and product descriptions at
  125. any time, without notice. Designers must not rely on the absence or
  126. characteristics of any features or instructions marked "reserved" or
  127. "undefined." Intel reserves these for future definition and shall have
  128. no responsibility whatsoever for conflicts or incompatibilities
  129. arising from future changes to them. The information here is subject
  130. to change without notice. Do not finalize a design with this
  131. information.
  132. The products described in this document may contain design defects or
  133. errors known as errata which may cause the product to deviate from
  134. published specifications. Current characterized errata are available
  135. on request.
  136. Contact your local Intel sales office or your distributor to obtain
  137. the latest specifications and before placing your product order.
  138. Copies of documents which have an order number and are referenced in
  139. this document, or other Intel literature, may be obtained by calling
  140. 1-800-548-4725, or go to http://www.intel.com/design/literature.htm
  141. Intel processor numbers are not a measure of performance. Processor
  142. numbers differentiate features within each processor family, not
  143. across different processor families. See
  144. http://www.intel.com/products/processor_number for details.
  145. This document contains information on products in the design phase of
  146. development.
  147. BunnyPeople, Celeron, Celeron Inside, Centrino, Centrino Atom,
  148. Centrino Atom Inside, Centrino Inside, Centrino logo, Core Inside,
  149. FlashFile, i960, InstantIP, Intel, Intel logo, Intel386, Intel486,
  150. IntelDX2, IntelDX4, IntelSX2, Intel Atom, Intel Atom Inside, Intel
  151. Core, Intel Inside, Intel Inside logo, Intel. Leap ahead., Intel. Leap
  152. ahead. logo, Intel NetBurst, Intel NetMerge, Intel NetStructure,
  153. Intel SingleDriver, Intel SpeedStep, Intel StrataFlash, Intel Viiv,
  154. Intel vPro, XScale, IPLink, Itanium, Itanium Inside, MCS, MMX, Oplus,
  155. OverDrive, Intel PDCharm, Pentium, Pentium Inside, skoool, Sound Mark,
  156. The Journey Inside, VTune, Xeon, and Xeon Inside are trademarks of
  157. Intel Corporation in the U.S. and other countries.
  158. * Other names and brands may be claimed as the property of others.
  159. Copyright (C) 2011, Intel Corporation. All rights reserved.