From: Sabuj Pattanayek (sabuj.pattanayek_at_vanderbilt.edu)
Date: Wed Mar 15 2006 - 09:50:11 CST
Hi,
I recompiled fftw and tcl using --enable-static and --disable-shared 
respectively, cleaned out the compile directory and started a new 
compile, I am getting different linking errors, from glibc?:
gcc -Isb/src -I/sb/apps/tcltk-8.4.12/Linux2/i686/include -DNAMD_TCL 
-DUSE_NON_CONST -O3 -march=i686 -static -DNAMD_VERSION=\"2.6b1\" 
-DNAMD_PLATFORM=\"Linux-i686-MPI\"  -o psfgen obj/tcl_main.o 
obj/tcl_psfgen.o obj/charmm_file.o obj/charmm_parse_topo_defs.o 
obj/extract_alias.o obj/hash.o obj/hasharray.o obj/memarena.o 
obj/pdb_file.o obj/pdb_file_extract.o obj/psf_file.o 
obj/psf_file_extract.o obj/topo_defs.o obj/topo_mol.o 
obj/topo_mol_output.o obj/stringhash.o 
-L/sb/apps/tcltk-8.4.12/Linux2/i686/lib -ltcl8.4 -ldl  -lm
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclLoadDl.o)(.text+0x2a): 
In function `TclpDlopen':
: warning: Using 'dlopen' in statically linked applications requires at 
runtime the shared libraries from the glibc version used for linking
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixFCmd.o)(.text+0xd83): 
In function `GetGroupAttribute':
: warning: Using 'getgrgid' in statically linked applications requires 
at runtime the shared libraries from the glibc version used for linking
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixFCmd.o)(.text+0xfb1): 
In function `SetGroupAttribute':
: warning: Using 'getgrnam' in statically linked applications requires 
at runtime the shared libraries from the glibc version used for linking
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixFCmd.o)(.text+0xdbb): 
In function `GetGroupAttribute':
: warning: Using 'endgrent' in statically linked applications requires 
at runtime the shared libraries from the glibc version used for linking
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixFCmd.o)(.text+0x10c9): 
In function `SetOwnerAttribute':
: warning: Using 'getpwnam' in statically linked applications requires 
at runtime the shared libraries from the glibc version used for linking
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixFCmd.o)(.text+0xe4f): 
In function `GetOwnerAttribute':
: warning: Using 'getpwuid' in statically linked applications requires 
at runtime the shared libraries from the glibc version used for linking
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixFCmd.o)(.text+0xe8b): 
In function `GetOwnerAttribute':
: warning: Using 'endpwent' in statically linked applications requires 
at runtime the shared libraries from the glibc version used for linking
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixChan.o)(.text+0x171a): 
In function `TcpGetOptionProc':
: warning: Using 'gethostbyaddr' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for 
linking
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixChan.o)(.text+0x1acd): 
In function `CreateSocketAddress':
: warning: Using 'gethostbyname' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for 
linking
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclIOSock.o)(.text+0x46): 
In function `TclSockGetPort':
: warning: Using 'getservbyname' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for 
linking
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x1d): 
In function `TclpThreadCreate':
: undefined reference to `pthread_attr_init'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x27): 
In function `TclpThreadCreate':
: undefined reference to `pthread_attr_setscope'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x44): 
In function `TclpThreadCreate':
: undefined reference to `pthread_create'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x5c): 
In function `TclpThreadCreate':
: undefined reference to `pthread_attr_destroy'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x72): 
In function `TclpThreadCreate':
: undefined reference to `pthread_attr_setstacksize'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x87): 
In function `TclpThreadCreate':
: undefined reference to `pthread_attr_setdetachstate'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x9a): 
In function `TclpThreadCreate':
: undefined reference to `pthread_create'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0xb2): 
In function `TclpThreadCreate':
: undefined reference to `pthread_create'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0xc7): 
In function `TclpThreadCreate':
: undefined reference to `pthread_attr_destroy'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0xf2): 
In function `Tcl_JoinThread':
: undefined reference to `pthread_join'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x11f): 
In function `TclpThreadExit':
: undefined reference to `pthread_exit'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x136): 
In function `Tcl_GetCurrentThread':
: undefined reference to `pthread_self'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x15b): 
In function `TclpInitLock':
: undefined reference to `pthread_mutex_lock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x17f): 
In function `TclFinalizeLock':
: undefined reference to `pthread_mutex_unlock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x1a3): 
In function `TclpInitUnlock':
: undefined reference to `pthread_mutex_unlock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x1c7): 
In function `TclpMasterLock':
: undefined reference to `pthread_mutex_lock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x1eb): 
In function `TclpMasterUnlock':
: undefined reference to `pthread_mutex_unlock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x22f): 
In function `Tcl_MutexLock':
: undefined reference to `pthread_mutex_lock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x24a): 
In function `Tcl_MutexLock':
: undefined reference to `pthread_mutex_lock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x25e): 
In function `Tcl_MutexLock':
: undefined reference to `pthread_mutex_unlock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x26c): 
In function `Tcl_MutexLock':
: undefined reference to `pthread_mutex_lock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x28a): 
In function `Tcl_MutexLock':
: undefined reference to `pthread_mutex_init'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x2b9): 
In function `Tcl_MutexUnlock':
: undefined reference to `pthread_mutex_unlock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x2e7): 
In function `TclpFinalizeMutex':
: undefined reference to `pthread_mutex_destroy'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x327): 
In function `TclpThreadDataKeyInit':
: undefined reference to `pthread_mutex_lock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x33b): 
In function `TclpThreadDataKeyInit':
: undefined reference to `pthread_mutex_unlock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x35a): 
In function `TclpThreadDataKeyInit':
: undefined reference to `pthread_key_create'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x372): 
In function `TclpThreadDataKeyInit':
: undefined reference to `pthread_mutex_unlock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x3a2): 
In function `TclpThreadDataKeyGet':
: undefined reference to `pthread_getspecific'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x3ce): 
In function `TclpThreadDataKeySet':
: undefined reference to `pthread_setspecific'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x402): 
In function `TclpFinalizeThreadData':
: undefined reference to `pthread_getspecific'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x41d): 
In function `TclpFinalizeThreadData':
: undefined reference to `pthread_setspecific'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x45a): 
In function `TclpFinalizeThreadDataKey':
: undefined reference to `pthread_key_delete'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x51b): 
In function `Tcl_ConditionWait':
: undefined reference to `pthread_cond_timedwait'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x537): 
In function `Tcl_ConditionWait':
: undefined reference to `pthread_mutex_lock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x54c): 
In function `Tcl_ConditionWait':
: undefined reference to `pthread_mutex_unlock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x572): 
In function `Tcl_ConditionWait':
: undefined reference to `pthread_cond_wait'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x593): 
In function `Tcl_ConditionWait':
: undefined reference to `pthread_cond_init'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x5cb): 
In function `Tcl_ConditionNotify':
: undefined reference to `pthread_cond_broadcast'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x5fb): 
In function `TclpFinalizeCondition':
: undefined reference to `pthread_cond_destroy'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x6c4): 
In function `TclpNewAllocMutex':
: undefined reference to `pthread_mutex_init'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x708): 
In function `TclpFreeAllocMutex':
: undefined reference to `pthread_mutex_destroy'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x75c): 
In function `TclpFreeAllocCache':
: undefined reference to `pthread_key_delete'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x795): 
In function `TclpGetAllocCache':
: undefined reference to `pthread_getspecific'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x7aa): 
In function `TclpGetAllocCache':
: undefined reference to `pthread_mutex_lock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x7c5): 
In function `TclpGetAllocCache':
: undefined reference to `pthread_mutex_unlock'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x7d6): 
In function `TclpGetAllocCache':
: undefined reference to `pthread_getspecific'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x7f0): 
In function `TclpGetAllocCache':
: undefined reference to `pthread_key_create'
/sb/apps/tcltk-8.4.12/Linux2/i686/lib/libtcl8.4.a(tclUnixThrd.o)(.text+0x821): 
In function `TclpSetAllocCache':
: undefined reference to `pthread_setspecific'
collect2: ld returned 1 exit status
make: *** [psfgen] Error 1
Thanks,
Sabuj Pattanayek
Brian Bennion wrote:
> 
> 
> You should review the compilation instructions for NAMD on the NAMDwiki
>  http://www.ks.uiuc.edu/Research/namd/wiki/index.cgi?NamdCompile
> 
> NAMD is statically linked to tcl and fftw ie uses libtcl8.4.a libraries 
> not .so files...
> 
> 
> 
> On Mon, 13 Mar 2006, Sabuj Pattanayek wrote:
> 
>> Hi,
>>
>> I almost have namd compiled but it errored during the linking stage. I 
>> have install tcltk-8.4.12 in a separate directory and I put the 
>> following in the arch/Linux-i686.tcl file:
>>
>> TCLDIR=/sb/apps/tcltk-8.4.12/Linux2/i686
>> TCLINCL=-I$(TCLDIR)/include
>> TCLLIB=-L$(TCLDIR)/lib -ltcl8.4 -ldl
>> TCLFLAGS=-DNAMD_TCL -DUSE_NON_CONST
>> TCL=$(TCLINCL) $(TCLFLAGS)
>>
>> All is well during the compile stage until it tries to link everything 
>> and I get this error:
>>
>> /usr/bin/ld: cannot find -ltcl8.4
>>
>> I'm not sure why this is happening because libtcl8.4.so exists in the 
>> lib directory defined by TCLDIR. I also tried linking libtcl8.4.so to 
>> libtcl.so and using -ltcl in the arch/Linux-i686.tcl file but I also 
>> receive the same error. Does anyone know why this might be happening? 
>> Does namd only link with a tcltk-8.3.x revision?
>>
>> Thanks,
>> Sabuj Pattanayek
>>
> 
> ************************************************
>   Brian Bennion, Ph.D.
>   Biosciences Directorate
>   Lawrence Livermore National Laboratory
>   P.O. Box 808, L-448    bennion1_at_llnl.gov
>   7000 East Avenue       phone: (925) 422-5722
>   Livermore, CA  94550   fax:   (925) 424-6605
> ************************************************
> 
This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:43:23 CST