From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Dec 16 2009 - 10:56:56 CST

Rich,
  Which version of Tcl/Tk are you compiling against?
(I need to know the exact major/minor version numbers)
Are you compiling from the VMD 1.8.7 source tar file, or
are you compiling from CVS? The latest VMD CVS contains a
fix for a problem that cropped up with very recent versions
of Tcl 8.4.x. If you are compiling from the VMD 1.8.7 tar
file and are using a recent version of Tcl 8.4.x, then try
replacing the TclTextInterp.C source file in your build
directory with this one, and see if after recompiling your
problem is solved.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Tue, Dec 15, 2009 at 02:26:00PM -0800, Rich Cook wrote:
> I figured out how to build VMD 1.8.7 on AIX. The script is below.
> However, after building, I get a segfault and coredump at this line in
> main:
>
> if (!app->VMDinit(argc, argv, displayTypeName, displayLoc,
> displaySize)) {
>
> Somehow the Tcl interpreter gets hosed:
> Stack Trace
> C TclExecuteByteCode, FP=fffffffffff1c90
> C TclObjInterpProcCore, FP=fffffffffff46e0
> C TclObjInterpProc, FP=fffffffffff4890
> C TclEvalObjvInternal, FP=fffffffffff4910
> C TclExecuteByteCode, FP=fffffffffff4b80
> C TclObjInterpProcCore, FP=fffffffffff75d0
> C TclObjInterpProc, FP=fffffffffff7780
> C TclEvalObjvInternal, FP=fffffffffff7800
> C TclExecuteByteCode, FP=fffffffffff7a70
> C TclObjInterpProcCore, FP=fffffffffffa4c0
> C TclObjInterpProc, FP=fffffffffffa670
> C TclEvalObjvInternal, FP=fffffffffffa6f0
> C TclEvalObjvInternal, FP=fffffffffffa960
> C TclExecuteByteCode, FP=fffffffffffabd0
> C TclObjInterpProcCore, FP=fffffffffffd620
> C TclObjInterpProc, FP=fffffffffffd7d0
> C TclEvalObjvInternal, FP=fffffffffffd850
> C TclEvalEx, FP=fffffffffffdac0
> C Tcl_EvalEx, FP=fffffffffffdd00
> C Tcl_Eval, FP=fffffffffffdd70
> C Initialize, FP=fffffffffffddf0
> C Tk_Init, FP=fffffffffffe110
> C++ TclTextInterp::TclTextInterp, FP=fffffffffffe180
> C++ UIText::UIText, FP=fffffffffffe230
> C++ VMDApp::VMDinit, FP=fffffffffffe310
> C++ main, FP=fffffffffffe540
> .__start, FP=fffffffffffe600
>
> Any ideas?
>
>
>
> Here is my build script, in case you are amused by such things.
> SYS_TYPE is an LLNL thing. just pretend it's not there.
>
> #!/usr/bin/env bash
> # NOTE: THIS SCRIPT WORKS FINE, but
> # it's not worth the hassle. Just install the binary distribution using
> # install.sh.
> TCL_VERSION="aix-rs6000"
> VMD_VERSION="AIX5_64"
> export CC=xlc
> export CXX=xlC
> export LD=xlC
> export CPPFLAGS="-g -qlanglvl=extended -qcpluscmt"
> export CFLAGS="$CPPFLAGS"
> export CXXFLAGS="$CPPFLAGS"
> export SHLIB_SUFFIX=".a"
> TCL_CONFIG_OPTIONS="--enable-shared=no"
>
> set -x
> cd /usr/global/tools/vmd/1.8.7
>
> rm -rf /usr/global/tools/vmd/1.8.7/$SYS_TYPE
> mkdir -p /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src
>
> echo "============================================================"
> echo "Build Tcl"
> cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src
> tar -xvzf /usr/global/tools/vmd/1.8.7/tarballs/tcl8.5.8-src.tar.gz
> cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src/tcl8.5.8/unix
> ./configure ${TCL_CONFIG_OPTIONS} --prefix=/usr/global/tools/vmd/
> 1.8.7/$SYS_TYPE/
> sedfiles 's/-O/-g/' Makefile
> #sedfiles 's/.so/.a/g' config.status
> #chmod 775 config.status
> #config.status || errexit "tcl config failed"
> gmake || errexit "tcl build failed"
> gmake install || errexit "tcl install failed"
>
> echo "============================================================"
> echo "Build Tk"
> cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src
> tar -xvzf /usr/global/tools/vmd/1.8.7/tarballs/tk8.5.8-src.tar.gz
> cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src/tk8.5.8/unix
> ./configure ${TCL_CONFIG_OPTIONS} --prefix=/usr/global/tools/vmd/
> 1.8.7/$SYS_TYPE/
> sedfiles 's/-O/-g/' Makefile
> #sedfiles 's/.so/.a/g' config.status
> #chmod 775 config.status
> #config.status || errexit "tk config failed"
> gmake || errexit "tk build failed"
> gmake install || errexit "tk install failed"
>
>
> #tar -xvzf /usr/global/tools/vmd/1.8.7/tarballs/
> ActiveTcl8.5.7.1.291226-${TCL_VERSION}-threaded.tar.gz
> #cd ActiveTcl8.5.7.1.291226-${TCL_VERSION}-threaded
> ## install without using the graphical user interface, which is a PITA
> #DISPLAY= ./install.sh --directory /usr/global/tools/vmd/
> 1.8.7/$SYS_TYPE/
>
> cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src
> tar -xvzf /usr/global/tools/vmd/1.8.7/tarballs/vmd-1.8.7.src.tar.gz
>
> echo "============================================================"
> echo "Build plugins"
> cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src/plugins
> sedfiles 's/-w -q/ -qcpluscmt -qlanglvl=extended -w -q/' Make-arch
> sedfiles 's/.SILENT:/.LOUD:/' Makefile */Makefile
> gmake ${VMD_VERSION} TCLINC=-I/usr/global/tools/vmd/1.8.7/$SYS_TYPE/
> include TCLLIB=-L/usr/global/tools/vmd/1.8.7/$SYS_TYPE/lib/
> export PLUGINDIR=/usr/global/tools/vmd/1.8.7/$SYS_TYPE/src/vmd-1.8.7/
> plugins
> gmake distrib || errexit "plugins failed to build"
>
> echo "============================================================"
> echo "Now build SURF"
> cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src/vmd-1.8.7/lib/surf
> uncompress -c surf.tar.Z | tar -xv || errexit "could not untar surf
> library"
> gmake depend
> gmake || errexit "SURF build failed"
> mv surf surf_${VMD_VERSION}
>
> echo "============================================================"
> echo "Now make Fltk"
> cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src/
> tar -xvzf /usr/global/tools/vmd/1.8.7/tarballs/fltk-1.1.10rc3-
> source.tar.gz
> cd fltk-1.1.10rc3 || errexit "cannot cd to fltk directory"
> ./configure --prefix=/usr/global/tools/vmd/1.8.7/$SYS_TYPE --enable-
> localzlib --enable-localpng
> gmake || errexit "Fltk build failed"
> gmake install || errexit "Cannot install Fltk library"
>
>
> echo "============================================================"
> echo "Now the main thing can be built"
> cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src/vmd-1.8.7
> sedfiles -e "s:install_bin_dir=\"/usr/local/bin\":install_bin_dir=\"/
> usr/global/tools/vmd/1.8.7/$SYS_TYPE/bin\":" -e "s:install_library_dir=
> \"/usr/local/lib:install_library_dir=\"/usr/global/tools/vmd/
> 1.8.7/$SYS_TYPE/lib:" -e 's:$python_dir/lib_$config_arch/include/
> python2.5:/usr/local/include/python2.5:g' -e 's:$python_dir/lib_
> $config_arch/lib/python2.5:/usr/local/lib/python2.5:g' configure
> chmod 775 configure
> export TCL_INCLUDE_DIR=/usr/global/tools/vmd/1.8.7/$SYS_TYPE//include
> export TCL_LIBRARY_DIR=/usr/global/tools/vmd/1.8.7/$SYS_TYPE//lib
> export TK_INCLUDE_DIR=/usr/global/tools/vmd/1.8.7/$SYS_TYPE//include
> export TK_LIBRARY_DIR=/usr/global/tools/vmd/1.8.7/$SYS_TYPE//lib
>
> ./configure ${VMD_VERSION} OPENGL FLTK TK TCL PTHREADS LP64
> if [ $(uname) == AIX ]; then
> sedfiles 's/-O/-g/g' src/Makefile
> fi
>
> #./configure ${VMD_VERSION} OPENGL FLTK TK TCL PTHREADS LP64 NOSILENT
> cd src
> gmake || errexit "vmd build failed"
> gmake install
>
> /* A function that takes a single integer argument and returns
> a pointer to a function that takes two integer arguments and
> returns a floating-point number. */
> float (*func2(int a))(int, int);
> Rich Cook
> rcook_at_llnl.gov
>
>
>

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078