Problem Compiling NAMD (version 2.7b2)

From: Michael Homa (mhoma_at_uic.edu)
Date: Fri Mar 12 2010 - 12:06:34 CST

Hi:

I'm trying to compile NAMD on our Linux cluster and am running into a
problem; it shows up as a link error on the NAMD build. Maybe someone can
point me in the right direction. First off, I apologize for the length and
detail. Being brief makes it "difficult" for someone to offer meaningful
direction since the details are missing. On the other hand, when you
include all the details, the email becomes long and difficult to absorb,
resulting in the reader getting bored and saying SNMP - Simply Not My
Problem.

My Environment
--------------
A small cluster with the head node, 32-bit, runing RHEL (kernel version:
2.6.9-89.0.16.ELsmp). Using GCC (version gcc version 3.4.6) with glibc:
glibc-2.3.4-2.13, OpenMPI: version mpich2-1.0.7. All the components were
installed in a filesystem called: /usr/common:

   /usr/common/charm
   /usr/common/tcl
   /usr/common/fftw
   /usr/common/namd

as well as mpi:

   /usr/common/mpich2

Charm++
-------
Successfully compiled/linked version 6.1.3 using the following build:

  ./build charm++ mpi-linux gcc \
  --incdir /usr/common/mpich2/include \
  --libdir /usr/common/mpich2/lib -O

I had problems when I tried to build with the smp option which I
finally removed. I can't explain why the smp caused the build to fail.
Maybe if I get NAMD successfully built, I can go back and try again.
The only customization I did was to add -lmpich and -lpthread to the
file src/arch/mpi-linux/conv-mach.sh file.

TCL

---
Downloaded and installed tcl-8.3.3. It cleanly gunziped and tared.
FFTW
----
I had version 2.1.5 (double precision) already on the machine. However, I
had subsequent problems linking NAMD because it could not find the
libraries drfftw and dfftw. I successfully recreated FFTW with single
precision using the following:
  ./configure --prefix=/usr/common/fftw --enable-mpi -enable-threads \
  --enable-float --enable-type-prefix=s
The libraries sfftw and srfftw to get built.
NAMD (this is where I'm having the link problem)
------------------------------------------------
I have version NAMD-2.7b2. I've made changes to three files in arch:
Linux-x86.fftw, Linux-x86-g++.arch, and Linux-x86.tcl.
With Linux-x86.fftw:
  o I pointed FFTDIR to the location of FFTW (/usr/common/fftw)
  o I removed the options on FFTFLAGS (not sure why I did this)
  o I pointed the FFTLIB to the two single precision libraries
    (-lsfftw -lsfftw)
With regard to Linux-x86.tcl:
  o I pointed TCLDIR to the location of TCL
  o I pointed the TCLLIB to version 8.3 of the libraries (-ltcl8.3)
With regard to Linux-x86-g++.arch:
  o I removed the -march=pentiumpro option (the head node is a Sun box
    with dual AMD Opterons)
  o I changed CHARMARCH to mpi-linux-gcc
I did the NAMD config using the following:
  ./config Linux-x86-g++.arch \
  --charm-arch mpi-linux-gcc \
  --with-tcl \
  --tcl-prefix /usr/common/tcl \
  --with-fftw \
  --fftw-prefix /usr/common/fftw
I get what I think is the appropriate output/configuration:
Selected arch file arch/Linux-x86-g++.arch contains:
NAMD_ARCH = Linux-x86
CHARMARCH = mpi-linux-gcc
CXX = g++
CXXOPTS = -O3 -ffast-math -static
CC = gcc
COPTS = -O3 -ffast-math -static
Creating directory: Linux-x86-g++.arch
Creating link: .. to .rootdir
Writing build options to Linux-x86-g++.arch/Make.config
Using Charm++ build found in Make.charm:
CHARMBASE = /usr/common/charm
Linking Makefiles
Linking src, plugins, and psfgen
Generated Linux-x86-g++.arch/Make.config contains the following:^M
include .rootdir/Make.charm
include .rootdir/arch/Linux-x86-g++.arch
CHARMARCH = mpi-linux-gcc
CHARM = $(CHARMBASE)/$(CHARMARCH)
NAMD_PLATFORM = $(NAMD_ARCH)
include .rootdir/arch/$(NAMD_ARCH).base
include .rootdir/arch/$(NAMD_ARCH).tcl
include .rootdir/arch/$(NAMD_ARCH).fftw
TCLDIR = /usr/common/tcl
FFTDIR = /usr/common/fftw
However the subsequent make in the Linux-x86-g++.arch produces a link
error:
collect2: ld returned 1 exit status
Fatal Error by charmc in directory /usr/common/NAMD-2.7b2/Linux-x86-g++.arch
Command g++ ... (in order for this email not to become just way too long,
I removed some of the output; if necessary, I can include it)
-lckqt -lmpich -lpthread -ldl -ltcl8.3 -ldl -lsfftw -lm -lmoduleNeighborLB
-lmodulecommlib -l returned error code 1
charmc exiting
There are a series of warnings regarding prior to the link:
  Using 'X' (where X is, for example, dlopen) in statically linked
  applications requires at runtime the shared libraries from the glibc
  version for linking
I site dlopen but the message is repeated for many others.
I've reviewed the list archives, used google, and reviewed the README, I
have found others who have had various link errors but no one mentions
what they did to resolve it (I know that there are many solutions for a link
error). Short of using a previous version of NAMD, I'm out of ideas
as to what else to try. If someone sees a mistake I've made, please point
it to me. Or, if you can suggest something, I'd be grateful.
Michael Homa
Operating Systems Support and Database Group
Academic Computing and Communication Center
University of Illinois at Chicago
email:  mhoma_at_uic.edu

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:53:53 CST