LAPACK Performance Libraries v1.0r2
Release Note

Scope

This release note covers the LAPACK Performance Libraries v1.0r2.

Contents

Introduction to the LAPACK Performance Libraries

LAPACK (Linear Algebra PACKage) is a software library for numerical linear algebra. It provides routines for solving systems of linear equations and linear least squares, eigenvalue problems, and singular value decomposition. It also includes routines to implement the associated matrix factorizations such as LU, QR, Cholesky and Schur decomposition. LAPACK was written in FORTRAN 90 and the original routines handle both real and complex matrices in both single and double precision.

The LAPACK Performance Libraries are based on LAPACK 3.7.0 (see the Netlib site at http://www.netlib.org/lapack). The Fortran code is converted to C code and the provided functions handle real matrices and single precision only.

The LAPACK Performance Libraries are comprised of three separate physical libraries: the LAPACK principal function library, the BLAS basic function library and the F2C support function library. The F2C library is a run-time library that is used by the LAPACK and BLAS library.

The BLAS (Basic Linear Algebra Subprograms) library contains functions that provide standard building blocks for performing basic vector and matrix operations. These functions form the low-level layer of LAPACK. Machine-specific optimized BLAS libraries are available for a variety of computer architectures. The LAPACK Performance Libraries v1.0r2 provide such an optimized BLAS implementation for Infineon TriCore.

New in version v1.0r2

Update LAPACK version

The LAPACK version is updated from 3.6.1 to 3.7.0. Refer to the Netlib website to find what's new in version 3.7.0.

Optimized BLAS library

All of the BLAS functions now have optimized C code for use with the TASKING VX-toolset for TriCore C compiler.

Optimization results

Due to the optimizations in the BLAS functions the following improvements were obtained. Only the results for a selection of commonly used functions are mentioned here.
Function Parameters v1.0r1 v1.0r2 Relative change
sgemm size=30x30, not transposed, α=1, β=0 134 MFLOPS 206 MFLOPS +54%
sgemv size=30x30, not transposed, α=1, β=1 131 MFLOPS 189 MFLOPS +44%
ssymm size=25x25, side=L, uplo=U, α=1, β=0 58 MFLOPS 107 MFLOPS +84%

Notes

API changes

The API has been changed in the following areas.

If you have legacy code you can keep using the old API, but since the old prototypes are not available anymore in the new lapack.h include file, you will have to provide your own prototypes.

Binary interface changes

By default, the LAPACK libraries are now configured to assume 4-byte alignment for single-word objects (int, long, float). An application that uses these libraries must be built with the same compiler option (--eabi=H) to prevent alignment mismatches.

MATLAB® example

The matlab-cholesky example is added to the product and shows how to use MATLAB® to rapidly develop an algorithm using the LAPACK functions that are provided with the MATLAB® LAPACK Add-On. When you are done with prototyping in MATLAB®, you can easily transform the algorithm to C code for TriCore by using the MATLAB® Coder. The C code for TriCore then calls the functions supplied with the LAPACK Performance Libraries.
For details on how to re-generate the C code using MATLAB® or how to import the example in the TASKING VX-toolset for TriCore, please refer to the readme that is part of the example.

Building the LAPACK Performance Libraries

Installation directory

The LAPACK Performance Libraries are shipped as a set of source files and makefiles. In order to use the libraries, you need to extract the source files and build the libraries first.

For Windows, the LAPACK Performance Libraries will be installed in the 'Program Files (x86)' folder by default. This folder has only limited write access, so in order to be able to unpack and build the libraries from within this location you need Windows Administrator rights. To be able to continue you have to start a command prompt as administrator. You can achieve this by following these steps:

  1. Click Start, click All Programs, and then click Accessories.
  2. Right-click Command prompt, and then click Run as administrator.
  3. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Yes.

If you do not have administrator rights on your PC, then install the LAPACK Performance Libraries outside the 'Program Files (x86)' folder, by selecting a different location when the installation program asks you to provide an installation folder.

Important notice

Do not install the product in an existing TASKING VX-toolset installation directory, since this may damage your TASKING VX-toolset license file.

Unpack, build and copy

For the next instruction it is assumed that the product is installed in the default location and that you have opened a command prompt with administrator rights.

In directory ctc\lib\src.lapack of the LAPACK Performance Libraries product a makefile is available that takes care of unpacking, building and copying the LAPACK Performance Libraries. It is advised that you use this makefile. The makefile executes the following commands:

  1. It unpacks the libraries by running the self extracting ZIP files: unpack-tc-libblas-sources.exe, unpack-tc-libf2c-sources.exe and unpack-tc-liblapack-sources.exe.
    Note that it is required for you to have a valid license key for unpacking the libraries. Refer to section License Information for more information.

  2. As a next step the LAPACK, BLAS and F2C libraries are built with the TriCore VX-toolset. There are two sets of makefiles, one for AURIX (located in subdirectory tc16x) and one for AURIX 2G (located in subdirectory tc162). In total there are six sub makefiles available:

  3. As a last step, the libraries are copied to the proper location. The AURIX libraries are copied to directory ctc\lib\tc16x, while the AURIX 2G libraries are copied to directory ctc\lib\tc162 of the LAPACK Performance Libraries product.

Now suppose you have purchased TriCore VX-toolset version v6.2r1 and it is installed in the default location: C:\Program Files (x86)\TASKING\TriCore v6.2r1. If you want to build the LAPACK Performance Libraries for AURIX and AURIX 2G using this version, then go to the location of the main makefile and run the make utility amk by specifying its complete path. Invoke the following commands in a command shell:

    C:
    cd "\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\lib\src.lapack"
    "C:\Program Files (x86)\TASKING\TriCore v6.2r1\ctc\bin\amk"

As a result of this make action, the libraries are unpacked, they are built and the AURIX versions are copied to the ctc\lib\tc16x directory of the LAPACK Performance Libraries product. The AURIX 2G versions of the libraries are copied to the ctc\lib\tc162 directory.

It is also possible to build the LAPACK Performance Libraries with an older version of the tools, i.e. TriCore VX-toolset versions v4.x or v5.x. However these older versions of the tools do no support AURIX 2G derivatives. In case you want to build the LAPACK Performance Libraries with an older version, you need to run the make utility amk with argument aurix to avoid build errors.

    C:
    cd "\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\lib\src.lapack"
    "C:\Program Files (x86)\TASKING\TriCore v5.0r1\ctc\bin\amk" aurix

As a result of this make action, only the libraries for AURIX are unpacked, they are built and copied to the ctc\lib\tc16x directory of the LAPACK Peformance Libraries product.

This completes the preparation of the libraries.

Using the LAPACK Performance Libraries

Once the LAPACK Performance Libraries have been built, an application can use the LAPACK functions. All that is required is that the tools know where to find the libraries.

Using the command prompt

When invoking the compiler, specify the location of the header file by using the -I option.
For example:

    ctc ... -I"C:\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\include.lapack" myapp.c ...

When invoking the linker, specify the location of the libraries by using the -L option and the libraries by using the -l option.
For example:

    ltc ... myapp.o -L"C:\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\lib\tc16x"
            -llapack_fpu -lblas_fpu -lf2c_fpu ...

Using Eclipse

Specify the location of the header file in the C/C++ Compiler Options on the Settings Properties page:

  1. Select C/C++ Compiler >> Include Paths.
    The Include paths box shows the directories that are added to the search path for include files.
  2. To define a new directory for the search path, click on the Add button in the Include paths box.
  3. Type or select a path, e.g. "C:\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\include.lapack"

Specify the libraries in the Linker Options on the Settings Properties page:

  1. Select Linker >> Libraries.
    The Libraries box shows the list of libraries that are linked with the project.
  2. To add the libraries, click on the Add button in the Libraries box.
  3. Type or select the full path to the LAPACK library:
    "C:\Program Files (x86)\TASKING\LAPACK v1.0r2\ctc\lib\tc16x\liblapack_fpu.a"
  4. Repeat steps 2. and 3. for libraries libblas_fpu.a and libf2c_fpu.a.

Examples

In the examples directory of the product you can find two different examples of computing the Cholesky factorization. The cholesky example is the handwritten version, while the matlab-cholesky example uses code that is generated by MATLAB®.

Using the Documentation

In the ctc\doc directory of the product you can find the API documentation. The API documentation is in HTML format and provided to you as a ZIP file. If you want to use the documentation then unzip the file named lapack_apidoc.zip with any unzip program. Note that if you have installed the LAPACK Performance Libraries in the 'Program Files (x86)' folder, you have to run the unzip tool as administrator. By default the HTML files are extracted to directory ctc\doc\lapack-apidoc. Open the file index.html that is present in this directory with your favorite browser to start navigate the documentation.

Note that the LAPACK Performance Libraries are based on Fortran code that is converted to C code. The API documentation is partially derived from the Fortran code and partially derived from the C code and therefore may not be ideal. You will find function signatures in C notation, where the arguments are denoted in lowercase and in many cases the arguments are pointers. The described parameters on the other hand are in Fortran notation, i.e. parameters are denoted in uppercase and all parameters are pointers implicitly.

TASKING VX-toolset for Tricore Related Issues

The sqrtf() function in the C library of the TASKING VX-toolset for TriCore up to release v6.2r1 does not meet the precision requirement of the LAPACK test suite. An improved version of the sqrtf() function is included in the F2C support function library of the LAPACK Performance Libraries product. When linking against the LAPACK libraries the improved precision version will prevail over the C library version.

The LAPACK ieeeck() function does not pass the LAPACK test suite if it is compiled with the default compiler optimization level '-O2' because it will replace expressions of the form 'x == x' with TRUE. However, if x equals NaN the expression should return FALSE. Therefore, the ieeeck.c module is compiled with compiler option '-O0'.

License Information

TASKING products are protected with TASKING license management software.

License key

You need a license key when you install a TASKING product on a computer. When you order a TASKING product from Altium or one of its distributors, a license key will be sent to you by email or on paper.

See Obtaining a License on our website for more information.

Local TASKING License Server (not applicable to evaluation licenses)

If you have ordered a TASKING product with a floating license, you can have it serviced by the Remote TASKING License Server (the most convenient solution) or through a Local TASKING License Server (in case you have no external network access for example). Consult your Altium representative for assistance on deciding what the best setup would be for your situation.

If you like to setup up a local license server, we kindly refer you for more information to Support for TASKING License Management System (TLM) on our website. Here you can also download the Local TASKING License Server package.

It is advised that you install the Local TASKING License Server before you install products that require this server.