[CPMD-list] compiling problem on AMD opteron64 under Linux when using MPI and PGI 5.2

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


On Wed, 13 Oct 2004, Adrain Zhou wrote:

AZ> Deal all,
AZ>  

AZ> The former problem has been solved. Thanks to axel.  But I met the
AZ> follwing new problems at linking stage. Apparently it is due to
AZ> underscore,

adrain,
not necessarily.

AZ> ......
AZ> .....
AZ> .....
AZ> : undefined reference to `dcopy_'
AZ> friesner_c_p.o(.text+0xed1): In function `frie_c_p__':
AZ> : undefined reference to `dscal_'
AZ> friesner_c_p.o(.text+0xfd8): In function `frie_c_p__':
AZ> : undefined reference to `dcopy_'
AZ> matrix_p.o(.text+0x2299): In function `matrix_p__':
AZ> : undefined reference to `zgemm_'
AZ> matrix_p.o(.text+0x43db): In function `matrix_p__':
AZ> : undefined reference to `zgemm_'
AZ> matrix_p.o(.text+0x63df): In function `matrix_p__':
AZ> : undefined reference to `zgemm_'

ok, seems you do not link to a library containing BLAS...

[...]

AZ> : undefined reference to `pthread_mutex_lock'
AZ> /usr/lib64/liblam.a(lammutex.o)(.text+0x97): In function `lam_mutex_trylock':
AZ> : undefined reference to `pthread_mutex_trylock'
AZ> /usr/lib64/liblam.a(lammutex.o)(.text+0x12f): In function `lam_mutex_unlock':
AZ> : undefined reference to `pthread_mutex_unlock'

...and these are references to the POSIX threads library.
seems that you have compile LAM-MPI with threads, but are
not linking the threads library.

[...]

AZ> Here is the Makefile I used
AZ> FFLAGS = -r8 -pc=64 -Msignextend -Msecond_underscore
AZ> #LFLAGS = -Bstatic -L. -latlas_x86-64 $(QMMM_LIBS)
AZ> LFLAGS = -Bstatic -L/home1/aijun/bak/lib/-latlas_x86-64

                                           ^^^^ you are missing 
                                           some whitespace here.
this way your atlas library will not be recognized.

also you need to add -lpthread to satisfy the links into
the threading library.

finally, for newer linux distributions with glibc versions newer 
than 2.2.4, static linking becomes increasingly problematic. :-(
while with older libc implementations, there was a very large 
chance to be for a long time forward compatible with newer 
distributions and and (to some degree) backward compatible, 
the forward compatibility will be essentially killed with static
linking, since even statically linked binaries will require 
some shared libraries (which now have to be binary identical
to the ones available at linking time). so to keep at some 
compatibility (which now _can_ be handled from within the shared 
libraries of newer glibc packages), it is highly recomended to 
only link compiler runtime and numerical libraries statically 
and libc, libm, and libpthread dynamically. for your version 
of PGI this should be the default, if you drop the -Bstatic flag.

AZ> CFLAGS =
AZ> CPP = /lib/cpp -P -C -traditional
AZ> CPPFLAGS = -D__Linux -D__PGI -DLAPACK -DFFT_DEFAULT -DPOINTER8 -D__pgf90 \
AZ>                -DPARALLEL -DMP_LIBRARY=__MPI -DMYRINET -DADD_BLAS_TWO_UNDERSCORE
                                                          
                                                            ^^^^^^^^^^^^^^^
                                            where does this one come from?
this preprocessor directive is not defined anywhere in the cpmd sources...

regards,
	axel.

AZ> NOOPT_FLAG =
AZ> CC = cc
AZ> FC = env LAMHF77=pgf90 mpif77 -c -fastsse -tp k8-64
AZ> LD = env LAMHF77=pgf90 mpif77  -fastsse -tp k8-64
AZ> AR =
AZ> #----------------------------------------------------------------------------
AZ> CFGDEST = .
AZ> CFGMACH = PGI-AMD64-MPI
AZ>  
AZ> Any comments on how to remove it are highly appreciated.
AZ> 
AZ> Many thanks,
AZ> Regards,
AZ> Adrain
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 CPMD-list mailing list