Next: , Previous: BestLibrary, Up: General


2.2 Accessing the Library (Linux)

Note: The following instructions assume the use of MPICH2 to provide MPI functionality, and that MPICH2 has been installed in a directory path which is pointed to by the environment variable MPIDIR. For example:

       setenv MPIDIR /usr/local/mpich2

2.2.1 Accessing the Library under Linux using GNU g77/gcc

If the Linux 64-bit g77 version of AMD ScaLAPACK was installed in the default directory, /opt/acml3.1.0/gnu64, then the command:

     g77 -m64 driver.f -L/opt/acml3.1.0/gnu64 \
     -lscalapack -lblacsF77init -lblacs -lblacsF77init -lacml \
     -L$MPIDIR/lib -lmpich

can be used to compile the program driver.f and link it to the ScaLAPACK, BLACS, ACML and MPICH libraries. The AMD ScaLAPACK Library is supplied in a static version only. The command

     g77 -m32 driver.f -L/opt/acml3.1.0/gnu32 \
     -lscalapack -lblacsF77init -lblacs -lblacsF77init -lacml \
     -L$MPIDIR/lib -lmpich

will compile and link a 32-bit program with 32-bit ScaLAPACK, BLACS, ACML and MPICH libraries.

2.2.2 Accessing the Library under Linux using GNU gfortran/gcc

Similar commands apply for the gfortran versions of AMD ScaLAPACK. For example,

     gfortran -m64 driver.f -L/opt/acml3.1.0/gfortran64 \
     -lscalapack -lblacsF77init -lblacs -lblacsF77init -lacml \
     -L$MPIDIR/lib -lmpich

can be used to compile the program driver.f and link it to the ScaLAPACK, BLACS, ACML and MPICH libraries. The AMD ScaLAPACK Library is supplied in a static version only. The command

     gfortran -m32 driver.f -L/opt/acml3.1.0/gfortran32 \
     -lscalapack -lblacsF77init -lblacs -lblacsF77init -lacml \
     -L$MPIDIR/lib -lmpich

will compile and link a 32-bit program with 32-bit ScaLAPACK, BLACS, ACML and MPICH libraries.

2.2.3 Accessing the Library under Linux using PGI compilers pgf77/pgf90/pgcc

Similar commands apply for the PGI versions of AMD ScaLAPACK. For example,

     pgf77 -tp=k8-64 -Mcache_align driver.f -L/opt/acml3.1.0/pgi64 \
     -lscalapack -lblacsF77init -lblacs -lblacsF77init -lacml \
     -L$MPIDIR/lib -lmpich
     
     pgf77 -tp=k8-32 -Mcache_align driver.f -L/opt/acml3.1.0/pgi32 \
     -lscalapack -lblacsF77init -lblacs -lblacsF77init -lacml \
     -L$MPIDIR/lib -lmpich

will compile driver.f and link it to the ScaLAPACK, BLACS, ACML and MPICH libraries using 64-bit and 32-bit versions respectively.

Note that the -Mcache_align flag is important - it tells the compiler to align objects on cache-line boundaries.

2.2.4 Accessing the Library under Linux using PATHSCALE compilers pgf77/pgf90/pgcc

Similar commands apply for the PATHSCALE versions of AMD ScaLAPACK. For example,

     pathf90 -m64 driver.f -L/opt/acml3.1.0/pathscale64 \
     -lscalapack -lblacsF77init -lblacs -lblacsF77init -lacml \
     -L$MPIDIR/lib -lmpich
     
     pathf90 -m32 driver.f -L/opt/acml3.1.0/pathscale32 \
     -lscalapack -lblacsF77init -lblacs -lblacsF77init -lacml \
     -L$MPIDIR/lib -lmpich

will compile driver.f and link it to the ScaLAPACK, BLACS, ACML and MPICH libraries using 64-bit and 32-bit versions respectively.

Note that the -Mcache_align flag is important - it tells the compiler to align objects on cache-line boundaries.

The 32-bit AMD ScaLAPACK libraries are currently only available for hardware supporting both SSE and SSE2 instructions.