Problem building NAMD (multiple definitions)

From: Miroslav Hodak (hodak_at_chips.ncsu.edu)
Date: Mon May 23 2011 - 05:47:08 CDT

Dear All,

I have been struggling getting to build NAMD. I know that binaries are
provided, but I want to try NAMD with Plumed, which requires building
from source.

My compilation actually goes pretty well, I follow instructions from
notes.txt, and it makes it through the NAMD compilation, but I receive
the following errors at the linking step:

/usr/lib/libc.a(malloc.o):(.data+0x10): multiple definition of
`__libc_malloc_initialized'
.rootdir/charm-6.3.2/mpi-linux/bin/../lib/libmemory-default.o:(.data+0x10):
first defined here
/usr/lib/libc.a(malloc.o): In function `__malloc_check_init':
(.text+0x200): multiple definition of `__malloc_check_init'
.rootdir/charm-6.3.2/mpi-linux/bin/../lib/libmemory-default.o:/home/miro/src/NAMD_2.8b3_Source/charm-6.3.2/mpi-linux/tmp/memory-gnu-hooks.c:393:
first defined here
/usr/lib/libc.a(malloc.o): In function `free':
(.text+0x4b50): multiple definition of `free'
.rootdir/charm-6.3.2/mpi-linux/bin/../lib/libmemory-default.o:/home/miro/src/NAMD_2.8b3_Source/charm-6.3.2/mpi-linux/tmp/memory.c:601:
first defined here
/usr/lib/libc.a(malloc.o): In function `malloc':
(.text+0x4c10): multiple definition of `malloc'
.rootdir/charm-6.3.2/mpi-linux/bin/../lib/libmemory-default.o:/home/miro/src/NAMD_2.8b3_Source/charm-6.3.2/mpi-linux/tmp/memory.c:594:
first defined here
/usr/lib/libc.a(malloc.o): In function `realloc':
(.text+0x59a0): multiple definition of `realloc'
.rootdir/charm-6.3.2/mpi-linux/bin/../lib/libmemory-default.o:/home/miro/src/NAMD_2.8b3_Source/charm-6.3.2/mpi-linux/tmp/memory.c:620:
first defined here
collect2: ld returned 1 exit status

I also get bunch of warning about static libraries (statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking), but I assume that those are harmless and
error comes from multiple definitions anyways.

The errors apparently come from CHARMM, it appears that these files have
statically compiled standard system memory management libraries in them.
I am not really sure how to solve this, I looked at charmm compile
option and I do not see anything relevant.

Can somebody help?

Thanks,
Miro

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 05:23:59 CST