Page 1 of 1

Scalapack linking error.

PostPosted: Mon Aug 30, 2010 6:45 am
by vitruss
Dear Scalapack/Lapack users!
I'm trying to compile Wien2k using ACML4.4.0 and gfortran with openmpi for SMP parallelization on Debian Squeeze AMD64 machine. I've compiled fftw2 and Scalapack (using installer) which are required. And now compiling Wien2k. During compilation the next problems appears:
Code: Select all
mpif90  -o ./lapw1c_mpi abc.o atpar.o bandv1.o calkpt.o cbcomb.o coors.o cputim.o dblr2k.o dgeqrl.o dgewy.o dgewyg.o dlbrfg.o dsbein1.o dscgst.o dstebz2.o dsyevx2.o dsyr2m.o dsyrb4.o dsyrb5l.o dsyrdt4.o dsywyv.o dsyxev4.o dvbes1.o eisps.o errclr.o errflg.o forfhs.o gaunt1.o gaunt2.o gbass.o gtfnam.o hamilt.o hns.o horb.o inikpt.o inilpw.o lapw1.o latgen.o lmsort.o locdef.o lohns.o lopw.o matmm.o modules.o nn.o outerr.o outwin.o prtkpt.o prtres.o pzheevx16.o rdswar.o rint13.o rotate.o rotdef.o seclit.o seclr4.o seclr5.o select.o service.o setkpt.o setwar.o sphbes.o stern.o tapewf.o ustphx.o vectf.o warpin.o wfpnt.o wfpnt1.o ylm.o zhcgst.o zheevx2.o zher2m.o jacdavblock.o make_albl.o global2local.o par_syrk.o my_dsygst.o refblas_dtrsm.o seclit_par.o pdsyevx17.o pdstebz17.o pdgetri_my.o pzgetri_my.o W2kutils.o W2kinit.o -ffree-form -O3 -lpthread -L/opt/scalapack/lib -lscalapack -lblacs -L/usr/lib/openmpi/lib -lmpi -L/opt/acml4.4.0/gfortran64/lib -lacml -L/opt/fftw2/lib -lfftw_mpi -lfftw -lm -lpthread
/opt/scalapack/lib/libscalapack.a(SL_init.o): In function `sl_init_':
SL_init.f:(.text+0x39): undefined reference to `blacs_pinfo_'
/opt/scalapack/lib/libscalapack.a(pzgemr.o): In function `Cpzgemr2do':
pzgemr.c:(.text+0x1394): undefined reference to `Cblacs_pinfo'
/opt/scalapack/lib/libscalapack.a(pzgemr.o): In function `pzgemr2do_':
pzgemr.c:(.text+0x14a4): undefined reference to `Cblacs_pinfo'
/opt/scalapack/lib/libscalapack.a(pztrmr.o): In function `Cpztrmr2do':
pztrmr.c:(.text+0x17d6): undefined reference to `Cblacs_pinfo'
/opt/scalapack/lib/libscalapack.a(pztrmr.o): In function `pztrmr2do_':
pztrmr.c:(.text+0x1911): undefined reference to `Cblacs_pinfo'
/opt/scalapack/lib/libscalapack.a(pdgemr.o): In function `Cpdgemr2do':
pdgemr.c:(.text+0x1664): undefined reference to `Cblacs_pinfo'
/opt/scalapack/lib/libscalapack.a(pdgemr.o):pdgemr.c:(.text+0x1774): more undefined references to `Cblacs_pinfo' follow

Here are software versions which have been used:
Code: Select all
gfortran                   4:4.4.4-2                  The GNU Fortran 95 compiler
libopenmpi-dev             1.4.2-3                    high performance message passing library -- header files
libopenmpi1.3              1.4.2-3                    high performance message passing library -- shared library
openmpi-bin                1.4.2-3                    high performance message passing library -- binaries
openmpi-checkpoint         1.4.2-3                    high performance message passing library -- checkpoint support
openmpi-common             1.4.2-3                    high performance message passing library -- common files


Can you please help me with compiling this software?

Re: Scalapack linking error.

PostPosted: Mon Aug 30, 2010 10:57 am
by admin
Vitruss
You need more than -lscalapack -lblacs.
I need to add the blacsC for sure and also maybe the blacsF77 library in the linking sequence.
Julie

Re: Scalapack linking error.

PostPosted: Tue Aug 31, 2010 12:01 am
by vitruss
Here is what I have now. Amount of errors is reduced, but they still present.
Code: Select all
mpif90  -o ./lapw1c_mpi abc.o atpar.o bandv1.o calkpt.o cbcomb.o coors.o cputim.o dblr2k.o dgeqrl.o dgewy.o dgewyg.o dlbrfg.o dsbein1.o dscgst.o dstebz2.o dsyevx2.o dsyr2m.o dsyrb4.o dsyrb5l.o dsyrdt4.o dsywyv.o dsyxev4.o dvbes1.o eisps.o errclr.o errflg.o forfhs.o gaunt1.o gaunt2.o gbass.o gtfnam.o hamilt.o hns.o horb.o inikpt.o inilpw.o lapw1.o latgen.o lmsort.o locdef.o lohns.o lopw.o matmm.o modules.o nn.o outerr.o outwin.o prtkpt.o prtres.o pzheevx16.o rdswar.o rint13.o rotate.o rotdef.o seclit.o seclr4.o seclr5.o select.o service.o setkpt.o setwar.o sphbes.o stern.o tapewf.o ustphx.o vectf.o warpin.o wfpnt.o wfpnt1.o ylm.o zhcgst.o zheevx2.o zher2m.o jacdavblock.o make_albl.o global2local.o par_syrk.o my_dsygst.o refblas_dtrsm.o seclit_par.o pdsyevx17.o pdstebz17.o pdgetri_my.o pzgetri_my.o W2kutils.o W2kinit.o -ffree-form -O3 -lpthread -L/opt/scalapack/lib -lscalapack -lblacs -lblacsF77 -lblacsC -L/usr/lib/openmpi/lib -lmpi -L/opt/acml4.4.0/gfortran64/lib -lacml -L/opt/fftw2/lib -lfftw_mpi -lfftw -lm -lpthread
/opt/scalapack/lib/libblacsF77.a(blacs_pinfo_.o): In function `blacs_pinfo_':
blacs_pinfo_.c:(.text+0x95): undefined reference to `bi_f77_get_constants_'
blacs_pinfo_.c:(.text+0xd3): undefined reference to `bi_f77_init_'
/opt/scalapack/lib/libblacsF77.a(Cblacs_pinfo.o): In function `Cblacs_pinfo':
blacs_pinfo_.c:(.text+0x95): undefined reference to `bi_f77_get_constants_'
blacs_pinfo_.c:(.text+0xd3): undefined reference to `bi_f77_init_'


Here is the content of scalapack/lib dir:
Code: Select all
vit@host$ ls -l /opt/scalapack/lib
total 19424
-rw-r--r-- 1 root root  836108 Aug 26 17:22 blacs.a
-rw-r--r-- 1 root root    5554 Aug 26 17:22 blacsC.a
-rw-r--r-- 1 root root    4866 Aug 26 17:22 blacsF77.a
lrwxrwxrwx 1 root root       7 Aug 26 16:29 libblacs.a -> blacs.a
lrwxrwxrwx 1 root root       8 Aug 26 16:29 libblacsC.a -> blacsC.a
lrwxrwxrwx 1 root root      10 Aug 26 16:29 libblacsF77.a -> blacsF77.a
-rw-r--r-- 1 root root  742434 Aug 26 17:16 librefblas.a
-rw-r--r-- 1 root root 9625646 Aug 26 17:22 libreflapack.a
-rw-r--r-- 1 root root 8657840 Aug 26 17:23 libscalapack.a

Re: Scalapack linking error.

PostPosted: Tue Aug 31, 2010 1:54 pm
by admin
Please do not ask me why, but try
Code: Select all
-lblacsF77 -lblacsC -lblacs -lblacsF77 -lblacsC
instead of
Code: Select all
-lblacs -lblacsF77 -lblacsC

Julie

Re: Scalapack linking error.

PostPosted: Wed Sep 01, 2010 12:29 am
by vitruss
Thanks! It is compiled! I saw this "features" a couple of times, but never thought it can be used here.