cblacs routines

cblacs routines


I try to create a grid with Cblacs subroutines. I found an example from the net. A part of it like this:


/** Header files for Blacs and Pblas are not available from Intel Mkl */
void Cblacs_pinfo(int*, int*);
void Cblacs_get(int, int, int*);
void Cblacs_gridinit(int*, char*, int, int);
void Cblacs_gridinfo(int, int*, int*, int*, int*);
void Cblacs_barrier(int , char*);
void Cblacs_gridexit(int);

int main(int argc, char* argv[])

/* Start MPI */

MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);

if (rank==0 && nprocs<4)
{ printf("\\n Number of processors should be at least 4\\n");
return 0;



return 0;

I compiledthe codelike this:

mpiicc -o ben.exe ben_pblas.c -I/RS/progs/intel/mkl/ -L/RS/progs/intel/mkl/ -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lmkl_lapack -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_lapack -lmkl_core -liomp5 -lpthread

I have no error while compiling, it creates .exe file. but when I run the.exe file it gives the error:

error while loading shared libraries: libmkl_scalapack_lp64.so: cannot open shared object file: No such file or directory

I couldn't achieve to use mkl library. if you help me,I will be very happy


3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting oguren

error while loading shared libraries: libmkl_scalapack_lp64.so: cannot open shared object file: No

Apparently, you didn't set the LD_LIBRARY_PATH for your run time. This is among the tasks performed by sourcing the compiler environment script, if you are using the MKL distributed with the compiler.

Ummm, I am new at coding using the NETLIB packages (I am training myself as a part of my doctoral research), and that leads me to ask: Shouldn't you also need to invoque  

right before the code ends:

  /*! Finalize BLACS: */
  return EXIT_SUCCESS;

I am also new to this forum, so please excuse any style-related flaws.

Thanks in advanced!

Eduardo J. Sanchez P.

Leave a Comment

Please sign in to add a comment. Not a member? Join today