using mpich to compile siesta2.0.2

Asked by chenhao on 2017-11-11

Dear all
when compiling siesta2.0.2with mpich ,it reports an error:
..........
 dc_lapack.a liblapack.a libblas.a /THFS/home/xauat-ch/lib/libscalapack.a /THFS/home/xauat-ch/lib/blacsCinit_MPI-LINUX-0.a /THFS/home/xauat-ch/lib/blacsF77init_MPI-LINUX-0.a /THFS/home/xauat-ch/l
ib/blacs_MPI-LINUX-0.a /THFS/home/xauat-ch/lib/liblapack.a /THFS/home/xauat-ch/lib/librefblas.a

cdiag.o: In function `cdiag_':
/THFS/home/xauat-ch/sourcecode/siesta-2.0.2/Src/cdiag.F:254: undefined reference to `descinit_'
/THFS/home/xauat-ch/sourcecode/siesta-2.0.2/Src/cdiag.F:327: undefined reference to `indxg2p_'
/THFS/home/xauat-ch/sourcecode/siesta-2.0.2/Src/cdiag.F:328: undefined reference to `indxg2p_'
/THFS/home/xauat-ch/sourcecode/siesta-2.0.2/Src/cdiag.F:332: undefined reference to `numroc_'
/THFS/home/xauat-ch/sourcecode/siesta-2.0.2/Src/cdiag.F:333: undefined reference to `numroc_'
....
pzheevd.f:(.text+0xea): undefined reference to `chk1mat_'
pzheevd.f:(.text+0x131): undefined reference to `chk1mat_'
pzheevd.f:(.text+0x235): undefined reference to `pchk2mat_'
pzheevd.f:(.text+0x470): undefined reference to `indxg2p_'
pzheevd.f:(.text+0x4a1): undefined reference to `indxg2p_
.....

this is my arch.make file
#
# This file is part of the SIESTA package.
#
# Copyright (c) Fundacion General Universidad Autonoma de Madrid:
# E.Artacho, J.Gale, A.Garcia, J.Junquera, P.Ordejon, D.Sanchez-Portal
# and J.M.Soler, 1996-2006.
#
# Use of this software constitutes agreement with the full conditions
# given in the SIESTA license, as signed by all legitimate users.
#
.SUFFIXES:
.SUFFIXES: .f .F .o .a .f90 .F90

SIESTA_ARCH=x86_64-unknown-linux-gnu--unknown

FPP=
FPP_OUTPUT=
FC= /THFS/home/xauat-ch/mpich2/bin/mpif90
RANLIB=ranlib

SYS=nag

SP_KIND=4
DP_KIND=8
KINDS=$(SP_KIND) $(DP_KIND)

FFLAGS=-g -O2
FPPFLAGS= -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DGFORTRAN
LDFLAGS=

ARFLAGS_EXTRA=

FCFLAGS_fixed_f=
FCFLAGS_free_f90=
FPPFLAGS_fixed_F=
FPPFLAGS_free_F90=

HOME_LIB=/THFS/home/xauat-ch/lib
BLAS_LIBS=$(HOME_LIB)/librefblas.a
LAPACK_LIBS=$(HOME_LIB)/liblapack.a
BLACS_LIBS=$(HOME_LIB)/blacsCinit_MPI-LINUX-0.a $(HOME_LIB)/blacsF77init_MPI-LINUX-0.a $(HOME_LIB)/blacs_MPI-LINUX-0.a
SCALAPACK_LIBS=$(HOME_LIB)/libscalapack.a

COMP_LIBS=dc_lapack.a liblapack.a libblas.a

NETCDF_LIBS=
NETCDF_INTERFACE=

LIBS=$(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(NETCDF_LIBS)

#SIESTA needs an F90 interface to MPI
#This will give you SIESTA's own implementation
#If your compiler vendor offers an alternative, you may change
#to it here.
MPI_INTERFACE=libmpi_f90.a
MPI_INCLUDE=.
MPI_LIB=/THFS/home/xauat-ch/mpich2/lib
DEFS_MPI=-DMPI

#Dependency rules are created by autoconf according to whether
#discrete preprocessing is necessary or not.
.F.o:
 $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $<
.F90.o:
 $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_free_F90) $<
.f.o:
 $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_fixed_f) $<
.f90.o:
 $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $<

when compiling siesta4.0 ,it reports the same error

please help me
thank you very much

Question information

Language:
English Edit question
Status:
Solved
For:
Siesta Edit question
Assignee:
No assignee Edit question
Solved by:
chenhao
Solved:
2017-11-11
Last query:
2017-11-11
Last reply:
2017-11-11
Nick Papior (nickpapior) said : #1

It seems you are missing some objects in your ScaLAPACK library.

1) I would highly suggest you to update to the latest ScaLAPACK library (there BLACS and ScaLAPACK are joined into one library, -lscalapack)
2) Don't add two lapack and blas libraries. You both have LAPACK_LIBS, BLAS_LIBS and the same libraries in COMP_LIBS.
Remove liblapack.a and libblas.a from COMP_LIBS.

If you still find the same error message when linking then ask your local system administrator as your problem is unrelated to SIESTA and is due to your scalapack library.

chenhao (guofudyiyasuo) said : #2

Thank you very much
When updating the ScaLAPACK library ,the problem solved.Thank you