Compiling a Scalapack Sample Program

Post here if you have a question about linking your program with LAPACK or ScaLAPACK library

Compiling a Scalapack Sample Program

Postby antony777 » Wed May 25, 2011 1:34 am

Hi all!

I recently installed scalapack using the installation script. I checked in the TESTING directories some programs with mpiexec -np . It works.

Now I tried to compile a sample program like this:

mpif90 premierprogramme.f90 -o test /home/antony/mathlibs/scalapack/lib/libscalapack.a /home/antony/mathlibs/scalapack/lib/blacs.a /home/antony/mathlibs/scalapack/lib/blacsC.a /home/antony/mathlibs/scalapack/lib/blacsF77.a /home/antony/mathlibs/scalapack/lib/libreflapack.a

but I got all the following errors:

/home/antony/mathlibs/scalapack/lib/libscalapack.a(PB_Cstypeset.o): In function `PB_Cstypeset':
PB_Cstypeset.c:(.text+0x17a): undefined reference to `saxpy_'ck/lib/libscalapack.aPB_Cstypeset.c:(.text+0x185): undefined reference to `scopy_'hlibs/scalapack/lib/bPB_Cstypeset.c:(.text+0x190): undefined reference to `sswap_'antony/mathlibs/scalaPB_Cstypeset.c:(.text+0x19b): undefined reference to `sgemv_'
PB_Cstypeset.c:(.text+0x1a6): undefined reference to `ssymv_'
PB_Cstypeset.c:(.text+0x1b1): undefined reference to `ssymv_'
PB_Cstypeset.c:(.text+0x1bc): undefined reference to `strmv_'
PB_Cstypeset.c:(.text+0x1c7): undefined reference to `strsv_'
PB_Cstypeset.c:(.text+0x1fe): undefined reference to `sger_'
PB_Cstypeset.c:(.text+0x209): undefined reference to `sger_'
PB_Cstypeset.c:(.text+0x214): undefined reference to `ssyr_'
PB_Cstypeset.c:(.text+0x21f): undefined reference to `ssyr_'
PB_Cstypeset.c:(.text+0x22a): undefined reference to `ssyr2_'
PB_Cstypeset.c:(.text+0x235): undefined reference to `ssyr2_'
PB_Cstypeset.c:(.text+0x240): undefined reference to `sgemm_'
PB_Cstypeset.c:(.text+0x24b): undefined reference to `ssymm_'
PB_Cstypeset.c:(.text+0x256): undefined reference to `ssymm_'
PB_Cstypeset.c:(.text+0x261): undefined reference to `ssyrk_'
PB_Cstypeset.c:(.text+0x26c): undefined reference to `ssyrk_'
PB_Cstypeset.c:(.text+0x277): undefined reference to `ssyr2k_'
PB_Cstypeset.c:(.text+0x282): undefined reference to `ssyr2k_'
PB_Cstypeset.c:(.text+0x28d): undefined reference to `strmm_'
PB_Cstypeset.c:(.text+0x298): undefined reference to `strsm_'
/home/antony/mathlibs/scalapack/lib/libscalapack.a(svvdot.o): In function `svvdot_':
svvdot.f:(.text+0x18): undefined reference to `sdot_'
/home/antony/mathlibs/scalapack/lib/libscalapack.a(smmadd.o): In function `smmadd_':
smmadd.f:(.text+0x2bd): undefined reference to `saxpy_'
smmadd.f:(.text+0x532): undefined reference to `sscal_'
smmadd.f:(.text+0x8e7): undefined reference to `saxpy_'
smmadd.f:(.text+0x951): undefined reference to `scopy_'
/home/antony/mathlibs/scalapack/lib/libscalapack.a(smmcadd.o): In function `smmcadd_':
smmcadd.f:(.text+0x2bd): undefined reference to `saxpy_'
smmcadd.f:(.text+0x532): undefined reference to `sscal_'
smmcadd.f:(.text+0x8e7): undefined reference to `saxpy_'
smmcadd.f:(.text+0x951): undefined reference to `scopy_'
/home/antony/mathlibs/scalapack/lib/libscalapack.a(smmtadd.o): In function `smmtadd_':
smmtadd.f:(.text+0x51d): undefined reference to `saxpy_'
smmtadd.f:(.text+0x582): undefined reference to `sscal_'
smmtadd.f:(.text+0x814): undefined reference to `saxpy_'
smmtadd.f:(.text+0x876): undefined reference to `scopy_'
smmtadd.f:(.text+0x9ee): undefined reference to `saxpy_'
smmtadd.f:(.text+0xb5d): undefined reference to `sscal_'
smmtadd.f:(.text+0xdec): undefined reference to `saxpy_'
smmtadd.f:(.text+0xe46): undefined reference to `scopy_'
/home/antony/mathlibs/scalapack/lib/libscalapack.a(smmtcadd.o): In function `smmtcadd_':
smmtcadd.f:(.text+0x51d): undefined reference to `saxpy_'
smmtcadd.f:(.text+0x582): undefined reference to `sscal_'
smmtcadd.f:(.text+0x814): undefined reference to `saxpy_'
smmtcadd.f:(.text+0x876): undefined reference to `scopy_'
smmtcadd.f:(.text+0x9ee): undefined reference to `saxpy_'
smmtcadd.f:(.text+0xb5d): undefined reference to `sscal_'
smmtcadd.f:(.text+0xdec): undefined reference to `saxpy_'
smmtcadd.f:(.text+0xe46): undefined reference to `scopy_'
/home/antony/mathlibs/scalapack/lib/libscalapack.a(smmdda.o): In function `smmdda_':
smmdda.f:(.text+0x2da): undefined reference to `saxpy_'
smmdda.f:(.text+0x5ac): undefined reference to `sscal_'
smmdda.f:(.text+0x97b): undefined reference to `saxpy_'
smmdda.f:(.text+0x9e5): undefined reference to `scopy_'
/home/antony/mathlibs/scalapack/lib/libscalapack.a(smmddac.o): In function `smmddac_':
smmddac.f:(.text+0x2da): undefined reference to `saxpy_'
smmddac.f:(.text+0x5ac): undefined reference to `sscal_'
smmddac.f:(.text+0x97b): undefined reference to `saxpy_'
smmddac.f:(.text+0x9e5): undefined reference to `scopy_'
/home/antony/mathlibs/scalapack/lib/libscalapack.a(smmddat.o): In function `smmddat_':
smmddat.f:(.text+0x562): undefined reference to `saxpy_'
smmddat.f:(.text+0x5bd): undefined reference to `sscal_'
smmddat.f:(.text+0x878): undefined reference to `saxpy_'
smmddat.f:(.text+0x8c9): undefined reference to `scopy_'
smmddat.f:(.text+0xa4c): undefined reference to `saxpy_'
smmddat.f:(.text+0xb9b): undefined reference to `sscal_'
smmddat.f:(.text+0xe15): undefined reference to `saxpy_'
smmddat.f:(.text+0xe61): undefined reference to `scopy_'
/home/antony/mathlibs/scalapack/lib/libscalapack.a(smmddact.o): In function `smmddact_':
smmddact.f:(.text+0x562): undefined reference to `saxpy_'
smmddact.f:(.text+0x5bd): undefined reference to `sscal_'
smmddact.f:(.text+0x878): undefined reference to `saxpy_'
smmddact.f:(.text+0x8c9): undefined reference to `scopy_'
smmddact.f:(.text+0xa4c): undefined reference to `saxpy_'
smmddact.f:(.text+0xb9b): undefined reference to `sscal_'
smmddact.f:(.text+0xe15): undefined reference to `saxpy_'
smmddact.f:(.text+0xe61): undefined reference to `scopy_'
/home/antony/mathlibs/scalapack/lib/libscalapack.a(stzscal.o): In function `stzscal_':
stzscal.f:(.text+0xf8): undefined reference to `sscal_'
stzscal.f:(.text+0x187): undefined reference to `sscal_'
stzscal.f:(.text+0x233): undefined reference to `sscal_'
stzscal.f:(.text+0x3b6): undefined reference to `sscal_'
stzscal.f:(.text+0x459): undefined reference to `sscal_'
/home/antony/mathlibs/scalapack/lib/blacsC.a(blacs_pinfo_.o): In function `blacs_pinfo_':
blacs_pinfo_.c:(.text+0x61): undefined reference to `bi_f77_get_constants_'
/home/antony/mathlibs/scalapack/lib/blacsC.a(Cblacs_pinfo.o): In function `Cblacs_pinfo':
blacs_pinfo_.c:(.text+0x61): undefined reference to `bi_f77_get_constants_'



I tried also to make my example directory:

antony@terrawulf:~/mathlibs/scalapack/build/scalapack-1.8.0/EXAMPLE> ls
CSCAEXMAT.dat DSCAEXMAT.dat Makefile pdscaex.f pdscaexinfo.o psscaex.f SCAEX.dat SSCAEXRHS.dat ZSCAEXRHS.dat
CSCAEXRHS.dat DSCAEXRHS.dat pcscaex.f pdscaexinfo.f pdscaex.o pzscaex.f SSCAEXMAT.dat ZSCAEXMAT.dat
antony@terrawulf:~/mathlibs/scalapack/build/scalapack-1.8.0/EXAMPLE> make
/opt/cluster/mpich2-1.0.5p4/bin/mpif77 -o /home/antony/mathlibs/scalapack/build/scalapack-1.8.0/TESTING/xdscaex pdscaex.o pdscaexinfo.o /home/antony/mathlibs/scalapack/build/scalapack-1.8.0/libscalapack.a /home/antony/mathlibs/scalapack/lib/blacsF77.a /home/antony/mathlibs/scalapack/lib/blacs.a /home/antony/mathlibs/scalapack/lib/blacsF77.a /home/antony/mathlibs/scalapack/lib/libreflapack.a /home/antony/mathlibs/scalapack/lib/librefblas.a
pdscaex.o: In function `MAIN__':
pdscaex.f:(.text+0x169): undefined reference to `numroc_'
pdscaex.f:(.text+0x197): undefined reference to `numroc_'
pdscaex.f:(.text+0x1c6): undefined reference to `numroc_'
pdscaex.f:(.text+0x232): undefined reference to `descinit_'
pdscaex.f:(.text+0x28f): undefined reference to `descinit_'
pdscaex.f:(.text+0x2ec): undefined reference to `descinit_'
pdscaex.f:(.text+0x33f): undefined reference to `iceil_'
pdscaex.f:(.text+0x65d): undefined reference to `pdlaread_'
pdscaex.f:(.text+0x692): undefined reference to `pdlaread_'
pdscaex.f:(.text+0x6e2): undefined reference to `pdlacpy_'
pdscaex.f:(.text+0x72f): undefined reference to `pdlacpy_'
pdscaex.f:(.text+0x949): undefined reference to `pdlaprnt_'
pdscaex.f:(.text+0xa4e): undefined reference to `pdlaprnt_'
pdscaex.f:(.text+0xaa2): undefined reference to `pdgesv_'
pdscaex.f:(.text+0xc5b): undefined reference to `pdlaprnt_'
pdscaex.f:(.text+0xcb2): undefined reference to `pdlawrite_'
pdscaex.f:(.text+0xccb): undefined reference to `pdlamch_'
pdscaex.f:(.text+0xd25): undefined reference to `pdlange_'
pdscaex.f:(.text+0xd7d): undefined reference to `pdlange_'
pdscaex.f:(.text+0xe3d): undefined reference to `pdgemm_'
pdscaex.f:(.text+0xe7e): undefined reference to `pdlange_'
make: *** [pdscaex] Error 1


any help would be greatly appreciated!

Regards,
antony777
 
Posts: 3
Joined: Wed May 25, 2011 1:15 am

Re: Compiling a Scalapack Sample Program

Postby admin » Wed May 25, 2011 1:42 am

mpif90 premierprogramme.f90 -o test /home/antony/mathlibs/scalapack/lib/libscalapack.a /home/antony/mathlibs/scalapack/lib/blacs.a /home/antony/mathlibs/scalapack/lib/blacsC.a /home/antony/mathlibs/scalapack/lib/blacsF77.a /home/antony/mathlibs/scalapack/lib/libreflapack.a

The BLAS is missing from your link.

/opt/cluster/mpich2-1.0.5p4/bin/mpif77 -o /home/antony/mathlibs/scalapack/build/scalapack-1.8.0/TESTING/xdscaex pdscaex.o pdscaexinfo.o /home/antony/mathlibs/scalapack/build/scalapack-1.8.0/libscalapack.a /home/antony/mathlibs/scalapack/lib/blacsF77.a /home/antony/mathlibs/scalapack/lib/blacs.a /home/antony/mathlibs/scalapack/lib/blacsF77.a /home/antony/mathlibs/scalapack/lib/libreflapack.a /home/antony/mathlibs/scalapack/lib/librefblas.a

This link is correct. From your output, all the undefined reference belongs to the scalapack lib, thus I would rebuild scalapack. If this is still not working, a flag is not correctly set.
You can try a
Code: Select all
nm /home/antony/mathlibs/scalapack/build/scalapack-1.8.0/libscalapack.a | grep -i descinit

To check that you have the descinit obj inside libscalapack.a

Julie
admin
Site Admin
 
Posts: 504
Joined: Wed Dec 08, 2004 7:07 pm


Return to Linking Problem

Who is online

Users browsing this forum: No registered users and 2 guests