How to build ScaLAPACK with Arm Compiler.

ScaLAPACK is a library of high-performance linear algebra routines for parallel distributed memory machines. For more information, see the ScaLAPACK website.

The following components are used for this build:

Component Version
ScaLAPACK 2.0.2
Arm compiler 19.0
Arm Performance Libraries (ArmPL) 19.0
Operating system RHEL 7.5
Hardware Cavium ThunderX2


  1. Download and unpack the library source.

    wget -O scalapack-2.0.2.tgz
    tar -zxvf scalapack-2.0.2.tgz
    cd scalapack-2.0.2
  2. Make a copy of, and rename it as

    Note: ScaLAPACK requires a file which is tuned for the target machine, and is based on the example that is included in the distribution.

  3. Modify the file for the Arm HPC compiler and Arm Performance Libraries as follows:

    Set trailing underscores for calling Fortran subroutines from C:

    CDEFS = -DAdd_ 

    Set the C and Fortran flags:

    FCFLAGS = ‑O3‑mcpu=native
    CCFLAGS = ‑O3‑mcpu=native ‑fsimdmath

    Link to the ArmPL libraries for BLitAS and LAPACK calls by removing the definitions of BLASLIB and LAPACKLIB, and setting LIBS:

    LIBS = $(ARMPL_DIR)/lib/

    Note: ARMPL_DIR is the location of the ArmPL installation. For example:

  4. Build the ScaLAPACK library:

    make lib
  5. Copy the libscalapack.a static library, created by the make lib command, to your preferred installation directory.

Resolving issues with deprecated MPI features

This section shows how to resolve issues with deprecated calls when building with Open MPI 4.0.0.

ScaLAPACK uses the MPI_Type_struct function, which was deprecated in version 2 of the MPI standard and removed entirely from version 3. All occurrences of this obsolete feature can be replaced with the correct MPI2 form using sed:

sed -i -e 's/MPI_Type_struct/MPI_Type_create_struct/g' ./BLACS/SRC/cgamn2d_.c
sed -i -e 's/MPI_Type_struct/MPI_Type_create_struct/g' ./BLACS/SRC/dgamn2d_.c
sed -i -e 's/MPI_Type_struct/MPI_Type_create_struct/g' ./BLACS/SRC/igamn2d_.c
sed -i -e 's/MPI_Type_struct/MPI_Type_create_struct/g' ./BLACS/SRC/igamx2d_.c
sed -i -e 's/MPI_Type_struct/MPI_Type_create_struct/g' ./BLACS/SRC/sgamn2d_.c
sed -i -e 's/MPI_Type_struct/MPI_Type_create_struct/g' ./BLACS/SRC/sgamx2d_.c
sed -i -e 's/MPI_Type_struct/MPI_Type_create_struct/g' ./BLACS/SRC/zgamn2d_.c
sed -i -e 's/MPI_Type_struct/MPI_Type_create_struct/g' ./BLACS/SRC/zgamx2d_.c sed -i -e 's/MPI_Attr_get/MPI_Comm_get_attr/g' ./BLACS/SRC/blacs_get_.c

For details about the features removed in Open MPI 4.0.0, see Removed MPI constructs on the Open MPI website.

You can re-enable the support for these features when building Open MPI. For more information, see Building Open MPI with Arm Compiler.