C interface user’s guide (for XLPack 5.2)
What is “C interface”
With the C interface software you will be able to do the followings:
- You can use the numerical calculation function module of XLPack (or XLPack Lite) from your C/C++ program.
- The program developed by using the C interface library can run on the personal computer in which XLPack (or XLPack Lite) is installed.
- Standard C interface LAPACKE/CBLAS is supported for LAPACK/BLAS routines.
C interface library software can be downloaded from download page.
Please follow the following conditions when using.
- All the rights to this product are the sole property of K Technologies.
- This software provides the internal interface in as-is condition. It has not been thoroughly tested under all conditions. Therefore, the function, performance, or reliability of this software are not guaranteed.
- This software must be used under the responsibility of the user. There is no warranty as to any damage caused as a result of using the software. Support services are not provided for this software.
- Redistribution of this software in any format is prohibited.
This software has been developed for the two types of compilers (MSC (conventional Microsoft C/C++ compiler) and Clang/C2 (C/C++ compiler supporting C99 standard)) included in Microsoft Visual Studio 2017. It has been tested by using version 15.9.7.
Usage and notes
C interface functions can be used by linking XLPack.lib (XLPack_32.lib for 32 bit programs). The header file is cnumlib.h. For XLPack Lite, XLPack_Lite.lib (XLPack_Lite_32.lib for 32 bit) and cnumlib_lite.h can be used.
The complex number operators are not supported by MSC. In order to complement for it, category A4 functions are provided.
The functions returning complex numbers cannot be used in C++ (e.g. zdotu, cgam, etc.). The subroutine versions (e.g. zdotu_sub, cgam_sub, etc.) are provided as the alternatives.
Please note the notations of two dimensional array and complex numbers in the reference manual.
- In the case of Clang, variable length two dimensional arrays are used for the two dimensional array arguments. However, one dimensional arrays are used in the case of MSC and C++. As the manual is written for the former, in the latter case please interpret accordingly.
Example – “double a[lda]” in the manual should be interpreted as “double a” when using MSC. Please refer to the example codes below.
- “doublecomplex” type is used in the manual. It is equivalent to “double _Complex” for Clang, “_Dcomplex” for MSC, and “complex<double>” for C++.
LAPACKE and CBLAS
LAPACKE and CBLAS functions are supported by this software. They can be used by linking Lapacke.lib (Lapacke_32.lib for 32 bit) in addition to the C interface library. The header files are lapacke.h and cblas.h. For XLPack Lite, Lapacke_Lite.lib (Lapacke_Lite_32.lib for 32 bit) and lapacke_lite.h are provided.
The LAPACKE and CBLAS functions corresponding to the Lapack/BLAS functions included in XLPack are supported.
In the current version, there are some differences on the runtime error handling from the original software as follows.
- For some errors, error messages are output by the Lapack/BLAS base routines instead of Lapacke/CBLAS routines. In those cases, the displayed argument number may be different from Lapacke/CBLAS.
Please refer to the original sites for the usage of each function.