[CPMD-list] pthread compilation problems
Axel Kohlmeyer
axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Fri Jul 1 16:45:48 CEST 2005
On Fri, 1 Jul 2005, arnaud marmier wrote:
AM> Hello,
hi arnaud,
AM> I got a sequential version easily enough, but am having trouble with
AM> the MPI.
AM>
AM> Essentially I get the following kind of errors :
AM>
AM> /usr/local/Cluster-Apps//mpi/gm/pgi/64//1.2.6..14a.1/lib/libmpich.a(gmpi_malloc.o)(.text+0x48c7):
AM> In function `mALLOPt':
AM> : undefined reference to `pthread_mutex_lock'
AM> /usr/local/Cluster-Apps//mpi/gm/pgi/64//1.2.6..14a.1/lib/libmpich.a(gmpi_malloc.o)(.text+0x49ee):
AM> In function `.st3894':
AM> : undefined reference to `pthread_mutex_unlock'
AM> make: *** [cpmd.x] Error 2
AM>
AM> After checking a bit more it seems that the mpich library has been
AM> compiled using threads and that I need to link to the threading library.
AM> I have tried adding -lpthread to the FFLAGS, even copying some of the
AM> libpthread.a libs in the SOURCE directory, but to no avail.
you need to add -lpthread to LFLAGS.
FFLAGS is for compiling, LFLAGS for linking.
two more remarks:
given your setup, you also may want to remove -Bstatic, or else
you may run into trouble when the threads library is updated.
finally, you may want to try out replacing -fastsse
with -fast or just with -O2 -Munroll .
depending on your setup and hardware, using a slightly
lower level of optimization may actually produce a faster
executable. especially using the SSE unit seems not to
be very helpful for a large numerical code.
best regards,
axel.
AM>
AM> I include the Makefile Header for info :
AM>
AM> #----------------------------------------------------------------------------
AM> # Makefile for cpmd.x (plane wave electronic calculation)
AM> # Configuration: PGI-AMD64-MPI
AM> # Creation of Makefile: Jul 1 2005
AM> # on Linux mott2 2.4.21-32.0.1.ELsmp #1 SMP Tue May 17 17:46:36 EDT 2005
AM> x86_64
AM> x86_64 x86_64 GNU/Linux
AM> # Author: marmier
AM> #----------------------------------------------------------------------------
AM> #
AM> SHELL = /bin/sh
AM> #
AM> #--------------- Default Configuration for PGI-AMD64-MPI ---------------
AM> SRC = .
AM> DEST = .
AM> BIN = .
AM> #QMMM_FLAGS = -D__QMECHCOUPL
AM> #QMMM_LIBS = -L. -lmm
AM> FFLAGS = -r8 -pc=64 -Msignextend
AM> LFLAGS = -Bstatic -L. -latlas_x86-64 $(QMMM_LIBS)
AM> CFLAGS =
AM> CPP = /lib/cpp -P -C -traditional
AM> CPPFLAGS = -D__Linux -D__PGI -DFFT_DEFAULT -DPOINTER8 -D__pgf77 \
AM> -DPARALLEL -DMYRINET
AM> NOOPT_FLAG =
AM> CC = mpicc -O2 -Wall -m64
AM> FC = mpif77 -c -fastsse -tp k8-64
AM> LD = mpif77 -fastsse -tp k8-64
AM> AR = ar
AM>
AM>
AM> Thnaks in advance,
AM>
AM> Best wishes,
AM> Arnaud
AM>
AM>
AM> _______________________________________________
AM> CPMD-list mailing list
AM> CPMD-list at cpmd.org
AM> http://cpmd.org/mailman/listinfo/cpmd-list
AM>
AM>
--
=======================================================================
Dr. Axel Kohlmeyer e-mail: axel.kohlmeyer at theochem.ruhr-uni-bochum.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/
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.
More information about the CPMD-list
mailing list