This is the top of the page.
Jump to main content.

Please note that JavaScript and style sheet are used in this website,
Due to unadaptability of the style sheet with the browser used in your computer, pages may not look as original.
Even in such a case, however, the contents can be used safely.

Orchestrating a brigher world


  1. Home
  2. User's Guide
  3. User's Guide: Linking MathKeisan

User's Guide: Linking MathKeisan

Linking for SX

To link, use the SUPER-UX command f90, or the cross-compile command sxf90. If your code is compiled with the f90 -dw flag (the default), link with the libraries listed in Table 1. If your code is compiled with the f90 -ew flag, link with the libraries in Table 2. Link the libraries in the order shown, or use the f90 -h lib_cyclic flag. Please see Table 3 for the integer and real data types used in the libraries.

Table 1: Linking for -dw
Library Name Link Libraries
BLAS -lblas
LAPACK -llapack -lblas
ScaLAPACK -lscalapack -lblacsF90init -lblacs -lblacsF90init -llapack -lblas -lmpi
BLACS -lblacsF90init -lblacs -lblacsF90init -lmpi
PARBLAS -lparblas -Popenmp
CBLAS -lcblas -lblas
SBLAS -lsblas
FFT -lfft
PARFFT -lparfft -Popenmp
ARPACK -larpack -llapack -lblas
PARPACK -lparpack -larpack -llapack -lblas -lmpi
Table 2: Linking for -ew
Library Name Link libraries
BLAS -lblas_64
LAPACK -llapack_64 -lblas_64
ScaLAPACK -lscalapack_64 -lblacsF90init_64 -lblacs_64 -lblacsF90init_64 -llapack_64 -lblas_64 -lmpiw
BLACS -lblacsF90init_64 -lblacs_64 -lblacsF90init_64 -lmpiw
PARBLAS -lparblas_64 -Popenmp
CBLAS not available
SBLAS -lsblas_64
FFT -lfft_64
PARFFT -lparfft_64 -Popenmp
ARPACK -larpack_64 -llapack_64 -lblas_64
PARPACK -lparpack_64 -larpack_64 -llapack_64 -lblas_64 -lmpiw

Link errors may occur if the MathKeisan libraries cannot be found. The default directory containing MathKeisan libraries is /usr/opt/mathkeisan/inst/lib0 on SX machines, and /SX/opt/mathkeisan/inst/lib0 on cross-compile machines. If the libraries are not in these directories, please specify their location using the link flag -Ldir, where dir is the full path name of the directory containing MathKeisan libraries.

When linking with MathKeisan Libraries (except CBLAS and BLACS) using the C/C++ compiler, append -f90lib compile/link option on the command line.
Use -f90lib dw when linking in -dw MathKeisan Libraries and use -f90lib ew when linking in -ew MathKeisan Libraries.

When linking with f90, if any of the symbols __c_cexp, __c_csqrt, __c_npow, __c_pow, __c_ppow, __c_sincos, __c_spow, __c_stkmem, __c_stkmem2, __c_tpow, __c_vcexp, __c_vcsqrt, __c_vpow, __c_vsassign4, __c_vsincos, __c_wcexp, __c_wcsqrt, __c_wpow, __c_wsincos appear unresolved, then append -lcpp to the link command line after all MathKeisan libraries.

Libraries for SX

The MathKeisan SX libraries for different data types are listed in Table 3.

Table 3: MathKeisan SX Libraries for Data Types
Library Name 4-byte integer (f90 -dw) 8-byte integer (f90 -ew)
4-byte real 8-byte real 8-byte real
Library Prefix Library Prefix Library Prefix
BLAS libblas.a S C libblas.a D Z libblas_64.a S D C Z
LAPACK liblapack.a S C liblapack.a D Z liblapack_64.a S D C Z
ScaLAPACK libscalapack.a S C libscalapack.a D Z libscalapack_64.a S D C Z
BLACS libblacs.a S C libblacs.a D Z libblacs_64.a S D C Z
PARBLAS libparblas.a S C libparblas.a D Z libparblas_64.a S D C Z
CBLAS libcblas.a S C libcblas.a D Z not available
SBLAS libsblas.a S C libsblas.a D Z libsblas_64.a S D C Z
FFT libfft.a S C libfft.a D Z libfft_64.a S D C Z
PARFFT libparfft.a S C libparfft.a D Z libparfft_64.a S D C Z
ARPACK libarpack.a S C libarpack.a D Z libarpack_64.a S D C Z
PARPACK libparpack.a S C libparpack.a D Z libparpack_64.a S D C Z

Libraries in Table 3 are for either 4-byte (32-bit) integer data type (Fortran integer(kind=4)) or 8-byte (64-bit) integer date type (Fortran integer(kind=8)).

Code compiled with the f90 default -dw uses 4-byte integers, and should be linked to libraries shown under the heading "4-byte integer".

Code compiled with f90 -ew uses 8-byte integers, and should be linked to libraries shown under the heading "8-byte integer".

The floating-point data type is either implicit, which is indicated when the "Prefix" column is empty, or is determined by the prefix of the subprogram name, as follows:

Table 4: SX Data Types Based on Prefixes
Prefix 4-byte integer (f90 -dw) 8-byte integer (f90 -ew)
S 4-byte real (Fortran real(kind=4)) 8-byte real (Fortran real(kind=8))
D 8-byte real (Fortran real(kind=8)) 8-byte real (Fortran real(kind=8))
C 8-byte complex (Fortran complex(kind=4)) 16-byte complex (Fortran complex(kind=8))
Z 16-byte complex (Fortran complex(kind=8)) 16-byte complex (Fortran complex(kind=8))

Note that in Table 4, the subprograms for 8-byte integer data type (f90 -ew) have 8-byte real data type for both the S and D prefixes, and 16-byte complex data type for both the C and Z prefixes.

Copyright © NEC MathKeisan® 2017. All rights reserved.