[Pw_forum] Compiling problems on AMD opteron64 under Linux using MPI

Axel Kohlmeyer axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Wed Oct 13 07:27:48 CEST 2004


On Wed, 13 Oct 2004, Adrain Zhou wrote:

AZ> Dear all,
AZ>  

AZ> Many thanks to Axel and Nicola . The former problem has been solved.
AZ> But I met the following new problems at linking stages.

AZ> .....
AZ> .....
AZ> : undefined reference to `mpi_barrier_'
AZ> init_pool.o(.text+0x74): In function `init_pool_':
AZ> : undefined reference to `mpi_comm_split_'
AZ> init_pool.o(.text+0xaf): In function `init_pool_':
AZ> : undefined reference to `mpi_barrier_'
AZ> init_pool.o(.text+0xeb): In function `init_pool_':
AZ> : undefined reference to `mpi_comm_split_'

hello again.
seems, like you have compiled your LAM-MPI library with 
g77 underscoring rules, but have not instructed the pgi compiler
to do so. try adding -Msecond_underscore to F90FLAGS and F77FLAGS,
and recompile everything (make clean ; make all).

AZ> init_us_1.o(.text+0x2783): In function `init_us_1_':
AZ> : undefined reference to `dscal__'
AZ> interpolate.o(.text+0x2087): In function `cinterpolate_':
AZ> : undefined reference to `zcopy__'

so here your BLAS symbols have two underscores, that's weird
for linux machines...

[...]

AZ> 
AZ> Apparently, it is due to underscore. Could anybody tell me how to remove it by just adding some options. Here is the makefile
AZ> # Use the local copy of fftw
AZ> CPPFLAGS = -DADD_BLAS_ONE_UNDERSCORE -D__LINUX64 -D__PGI -D__PARA -D_MPI -D_LAM -D__FFTW -D__USE_INTERNAL_FFTW \
AZ>   -I$(OSHOME)/include -I./

aha! why do you use -DADD_BLAS_ONE_UNDERSCORE ???

you seem to have deleted the comment block preceding the CPPFLAGS
definition, which already gives the explanation:

# Add -DADD_BLAS_ONE_UNDERSCORE to CPPFLAGS if your blas/lapack library
# names contain two underscores at the end

bingo. your blas does not have two underscores, so you don't need it.

AZ> #
AZ> # Fortran compiler:
AZ> F90 =mpif90
AZ> F77 =mpif77
AZ> CC =mpicc
AZ> #
AZ> # Please note: -r8 is necessary for numerical stability ..
AZ> #
AZ> F90FLAGS = -fast -r8
AZ> F77FLAGS = -fast -r8
AZ> CCFLAGS  =  $(CPPFLAGS)
AZ> #
AZ> # This is needed to tell the compiler where modules are
AZ> #
AZ> MODULEFLAG= -I$(OSHOME)/Modules -I$(OSHOME)/PW -I$(OSHOME)/PH
AZ> #
AZ> # Loader:
AZ> # this below uses precompiled pgi libraries ( not very efficient but stable )
AZ> #
AZ> LIBS = -L/opt/pgi/linux86-64/5.2/lib -llapack -lblas $(FFTW_LIB)

don't use these. their performance is HORRIBLE. use ATLAS (which you 
should already have, according to your post to the cpmd mailing list)
or ACML (best version 2.1, which should have been bundled with PGI).

regards,
	axel.

AZ> #
AZ> # for cineca machines:
AZ> #
AZ> #LIBS = -L/usr/local/pgi/linux86/lib/ -llapack -L/cineca/lib/ATLAS -lf77blas -latlas $(FFTW_LIB)
AZ> #
AZ> LD=$(F90)
AZ> LDFLAGS = $(OSHOME)/flib/ptools.a $(OSHOME)/flib/flib.a $(OSHOME)/clib/clib.a $(LIBS) $(MODULEFLAG)
AZ>  
AZ>  
AZ> 
AZ> 
AZ> 
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 Pw_forum mailing list