[Pw_forum] Problems on install PWSCF!

Axel Kohlmeyer axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Mon Oct 18 09:25:08 CEST 2004

On Mon, 18 Oct 2004, Adrain Zhou wrote:

dear adrain,

AZ> Dear all,
AZ> I still met some problems on compiling pwscf on AMD opteron64 using LAM-MPI and pgi.

it would occasionally help, if you'd actually _read_ what people
are suggesting. i'v already told you, that your LAM-MPI installation
obviously was compiled with g77 and thus different underscoring 
conventions. for CPMD you may be able to work around this, by just 
adding -Msecond_underscore but for pwscf, where you have more external 
dependencies, and more this will be a bit trickier.

AZ> pgf90-Warning-Unknown switch: -pthread
AZ> broadcast.o(.text+0x28): In function `broadcast_':
AZ> : undefined reference to `mpi_barrier_'
AZ> broadcast.o(.text+0x48): In function `broadcast_':

AZ> Here is the make.sys file I used at first,
AZ> # Use the local copy of fftw
AZ>           -I$(OSHOME)/include -I./
AZ> #
AZ> # Fortran compiler:
AZ> F90 =mpif90
AZ> F77 =mpif77
AZ> CC =mpicc
AZ> #
AZ> F90FLAGS = -w -fast -r8
AZ> F77FLAGS = -w -fast -r8


ok, as i wrote to you before. for this you need to recompile your LAM-MPI
package to use the pgf90 compiler by default with default underscoring
conventions. there is a ready to use RPM for that at:
just use mpipgf90/mpipgf77 to access the pgi compilers, or you can pick
up the corresponding source rpm, and either rebuild it or unpack it and 
look at the .spec file to see, how it was compiled. you'll run into more
problems, if you don't fix this. for espresso, there still is a 

AZ> F90FLAGS = -w -fast -r8 -Msecond_underscore
AZ> F77FLAGS = -w -fast -r8 -Msecond_underscore
AZ> the former problems disappeared, but the new problems is produced
AZ> input.o(.text+0x7857): In function `verify_tmpdir__':
AZ> : undefined reference to `c_mkdir__'
AZ> ../Modules/berry_phase.o(.text+0x4b): In function `berry_phase_ln_setup__':
AZ> : undefined reference to `ln_alloc__'


of course, now the underscoring conventions don't match the ones,
that were found during configuration. now if you just search for
the definition of those symbols, e.g. by

[91|9:16]~/compile/pwscf> grep -i c_mkdir */*.*

clib/c_mkdir.c:    fatal( "c_mkdir: virtual memory exhausted" ) ;
clib/c_mkdir.c:int C_MKDIR( const char * dirname , const int * length )
clib/c_mkdir.c:} /* c_mkdir_ */
CPV/path_routines.f90:      INTEGER, EXTERNAL :: C_MKDIR
CPV/path_routines.f90:           ios = C_MKDIR( TRIM( outdir ), LEN_TRIM( outdir ) )
FPMD/path_routines.f90:      INTEGER, EXTERNAL :: C_MKDIR
FPMD/path_routines.f90:           ios = C_MKDIR( TRIM( outdir ), LEN_TRIM( outdir ) )
include/c_defs.h:#  define C_MKDIR C_MKDIR
include/c_defs.h:#  define C_MKDIR c_mkdir_
include/c_defs.h:#  define C_MKDIR c_mkdir_
include/c_defs.h:#  define C_MKDIR c_mkdir_
include/c_defs.h:#  define C_MKDIR c_mkdir__
include/c_defs.h:#  define C_MKDIR c_mkdir
include/c_defs.h:#  define C_MKDIR c_mkdir_
include/c_defs.h:#    define C_MKDIR c_mkdir__
PW/input.f90:  INTEGER, EXTERNAL  :: c_mkdir
PW/input.f90:           ios = c_mkdir( TRIM( tmp_dir ), LEN_TRIM( tmp_dir ) )

you'll see, that those underscoring conventions are set in
the file include/c_defs.h  (or clib/cp.h if you use the v2.0.x sources). 
a closer look into that file reveals, that the matching underscoring 
converntions should be used, when you have define __GNU_LINK in 
combination with __PGI.

so add -D__GNU_LINK to your CPPFLAGS and look forward to having
much (negative) fun with the next package, that is not that flexible.

	axel kohlmeyer.

AZ> Adrain
AZ> ---------------------------------
AZ> Do You Yahoo!?
AZ> 150ÍòÇúMP3·è¿ñËÑ£¬´øÄú´³ÈëÒôÀÖµîÌÃ
AZ> ÃÀÅ®Ã÷ÐÇÓ¦Óо¡ÓУ¬ËѱéÃÀͼ¡¢ÑÞͼºÍ¿áͼ
AZ> 1G¾ÍÊÇ1000Õ×£¬ÑÅ»¢µçÓÊ×ÔÖúÀ©ÈÝ£¡


Dr. Axel Kohlmeyer                        e-mail: axel.kohlmeyer at rub.de
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
D-44780 Bochum  http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/

More information about the users mailing list