Debian Clusters for Education and Research: The Missing Manual

NAMD: Troubleshooting Errors

From Debian Clusters

Jump to: navigation, search

This is the troubleshooting errors page of a four part tutorial on building and testing NAMD and charm++. The full tutorial includes

Contents

Errors

If you follow the instructions above, you shouldn't experience any of these errors (I hope!). The solutions for them are posted right as part of the tutorial. Rather than crowding up the tutorial with what can go wrong, I decided to post all the errors (and the solutions I found for them) here at the end for anyone else experiencing these problems.

Building/Testing Charm++ Errors

C Compiler Errors

If you're trying to compile charm++ with a GNU version of gcc/g++ above 3.x, you'll see errors like this:

../bin/charmc  -O  -c -I. traceCore.C
In file included from converseEvents.h:5,
                 from traceCore.C:12:
traceCore.h:20: error: previous declaration of 'int Cpv__traceCoreOn_ [2]' with 'C++' linkage
traceCoreAPI.h:8: error: conflicts with new declaration with 'C' linkage
traceCore.C: In constructor 'TraceCore::TraceCore(char**)':
Fatal Error by charmc in directory /usr/local/src/NAMD_2.6_Source/charm-5.9/mpi-linux-gcc/tmp
   Command g++ -fPIC -Wno-deprecated -I../bin/../include -D__CHARMC__=1 -I. -O -I/shared/include 
   -c traceCore.C -o traceCore.o returned error code 1
charmc exiting...
make[2]: *** [traceCore.o] Error 1
make[2]: Leaving directory `/usr/local/src/NAMD_2.6_Source/charm-5.9/mpi-linux-gcc/tmp'
make[1]: *** [converse] Error 2
make[1]: Leaving directory `/usr/local/src/NAMD_2.6_Source/charm-5.9/mpi-linux-gcc/tmp'
make: *** [charm++] Error 2

This can be solved by symlinking /usr/bin/gcc and /usr/bin/g++ to older versions. See above.

mpi.h Error

You'll see errors like the following if the charm builder can't find the MPI libraries.

machine.c:17:17: mpi.h: No such file or directory
machine.c:144: error: syntax error before "MPI_Request"
machine.c:144: warning: no semicolon at end of struct or union
machine.c:145: warning: data definition has no type or storage class
machine.c:150: error: syntax error before '*' token
machine.c:150: warning: data definition has no type or storage class
machine.c:151: error: syntax error before '*' token
machine.c:151: warning: data definition has no type or storage class
machine.c: In function `CmiTimerIsSynchronized':
machine.c:190: error: `MPI_SUCCESS' undeclared (first use in this function)
machine.c:190: error: (Each undeclared identifier is reported only once
machine.c:190: error: for each function it appears in.)
machine.c:190: error: `MPI_COMM_WORLD' undeclared (first use in this function)
machine.c:190: error: `MPI_WTIME_IS_GLOBAL' undeclared (first use in this function)
...snipped...
Fatal Error by charmc in directory /usr/local/src/NAMD_2.6_Source/charm-5.9/mpi-linux-gcc/tmp
   Command gcc -fPIC -I../bin/../include -D__CHARMC__=1 -DFOR_CPLUS=1 -O -c machine.c -o machine.o 
   returned error code 1

You can fix this by giving the charm++ ./build command a --basedir=. Set the base directory to be the directory that encompasses where mpi.h is located. You can find this with locate mpi.h if you don't know. If it doesn't exist, you need to install MPICH, or go with a net-linux installation, which is not covered in this tutorial. (Basically, specify net-linux instead of mpi-linux in ./build.)

Testing Charm++: No Pthreads Error

Without editing charm-5.9/include/conv-mach.sh to include the POSIX thread libraries, you'll see errors like this:

../../../bin/charmc  -o pgm  megatest.o groupring.o nodering.o varsizetest.o varraystest.o groupcast.o
   nodecast.o synctest.o fib.o arrayring.o tempotest.o packtest.o queens.o migration.o marshall.o priomsg.o 
   priotest.o rotest.o statistics.o templates.o inherit.o reduction.o callback.o immediatering.o bitvector.o 
   -language charm++
/shared/lib/libmpich.a(attr_get.o): In function `MPI_Attr_get':
attr_get.c:(.text+0x41): undefined reference to `pthread_getspecific'
attr_get.c:(.text+0x77): undefined reference to `pthread_setspecific'
attr_get.c:(.text+0x315): undefined reference to `pthread_getspecific'
attr_get.c:(.text+0x34b): undefined reference to `pthread_setspecific'
attr_get.c:(.text+0x3a6): undefined reference to `pthread_getspecific'
attr_get.c:(.text+0x3dc): undefined reference to `pthread_setspecific'

To solve it, add -pthread to the CMK_LIBS argument.

Building NAMD Errors

csh Error

Without the binary for csh, you won't be able to build NAMD. You'll see the following error:

-su: ./config: /bin/csh: bad interpreter: No such file or directory

This is easily fixed with

apt-get install csh

charm++.h Error

An error like the following

g++ -I/Projects/namd2/charm-5.9/mpi-linux/include -DCMK_OPTIMIZE=1 -Isrc -Iinc -Iplugins/include 
   -I/Projects/namd2/tcl/linux/include -I/root/tcl/include -DNAMD_TCL -DUSE_NON_CONST 
   -I/Projects/namd2/fftw/linux/include -I/root/fftw/include -DNAMD_FFTW  -DNAMD_VERSION=\"2.6\" 
   -DNAMD_PLATFORM=\"Linux-i686-MPI\"  -O3 -march=pentiumpro -ffast-math -static -o obj/common.o
   -c src/common.C
src/common.C:22:21: charm++.h: No such file or directory
src/common.C: In function `void NAMD_quit(const char*)':
src/common.C:67: error: `CkPrintf' was not declared in this scope
src/common.C:69: error: `CmiAbort' was not declared in this scope

or

src/common.C:22:21: charm++.h: No such file or directory
make: .rootdir/charm-5.9//mpi-linux/bin/charmc: Command not found

indicates that make cannot find charm++.h. There are two locations that need to be specified for this: the first is NAMD_2.6_Source/Make.charm. The line should be

CHARMBASE = .rootdir/charm-5.9

or wherever else you built charm++. After you do this, you may need to delete your Linux-<architecture>-MPI directory and run ./configure (with the proper options) again.

The second file to edit is arch/Linux-<your architecture>-MPI.arch. Open this file and change the line CHARMACH to

CHARMARCH = mpi-linux-gcc

or whatever other folder was created for you in the /charm-5.9 directory when you built charm++. See NAMD: Building namd for more information.

tcl Error

If something's wrong with the way tcl is being pointed to, errors like these will arise:

g++ -I.rootdir/charm-5.9//mpi-linux-gcc/include -DCMK_OPTIMIZE=1 -Isrc -Iinc   -Iplugins/include
   -I/Projects/namd2/tcl/linux/include -I/root/tcl/include -DNAMD_TCL -DUSE_NON_CONST
   -I/Projects/namd2/fftw/linux/include -I/root/fftw/include -DNAMD_FFTW  -DNAMD_VERSION=\"2.6\"
   -DNAMD_PLATFORM=\"Linux-i686-MPI\"  -O3 -march=pentiumpro -ffast-math -static -o obj/mainfunc.o
   -c src/mainfunc.C
In file included from src/mainfunc.C:31:
src/ScriptTcl.h:19:17: tcl.h: No such file or directory
In file included from src/mainfunc.C:31:
src/ScriptTcl.h:49: error: ISO C++ forbids declaration of `Tcl_Interp' with no type
src/ScriptTcl.h:49: error: expected `;' before '*' token
src/ScriptTcl.h:50: error: `ClientData' has not been declared
src/ScriptTcl.h:50: error: `Tcl_Interp' has not been declared
src/ScriptTcl.h:50: error: ISO C++ forbids declaration of `parameter' with no type
src/ScriptTcl.h:50: error: ISO C++ forbids declaration of `parameter' with no type

This is fixed by editing arch/Linux-<your architecture>.tcl to match the following.

TCLDIR=/usr
TCLINCL=-I$(TCLDIR)/include -I$(HOME)/tcl/include -I/usr/include/tcl8.4/
TCLLIB=-L$(TCLDIR)/lib -L$(HOME)/tcl/lib -ltcl8.4 -ldl

See NAMD: Building namd for more information.

Multiple Definitions Error

An error that might be seen towards the very end of the build involves "multiple definitions". Pages and pages of errors may scroll by similar to

/usr/lib/libc.a(malloc.o):(.data+0x10): multiple definition of `__libc_malloc_initialized'
.rootdir/charm-5.9//mpi-linux-gcc/bin/../lib/libmemory-default.o:(.data+0x4): first defined here
/usr/lib/libc.a(malloc.o): In function `__malloc_check_init':
(.text+0xf90): multiple definition of `__malloc_check_init'
.rootdir/charm-5.9//mpi-linux-gcc/bin/../lib/libmemory-default.o:memory.c:(.text+0x10c1): first defined here
/usr/lib/libc.a(malloc.o): In function `_int_free':
(.text+0x1fe0): multiple definition of `_int_free'
.rootdir/charm-5.9//mpi-linux-gcc/bin/../lib/libmemory-default.o:memory.c:(.text+0x2db8): first defined here
/usr/lib/libc.a(malloc.o): In function `_int_malloc':
(.text+0x2940): multiple definition of `_int_malloc'
.rootdir/charm-5.9//mpi-linux-gcc/bin/../lib/libmemory-default.o:memory.c:(.text+0x27fc): first defined here

This is solved by opening arch/Linux-<architecture>-g++.arch and taking out all instances off --static.

Personal tools