From: Rich Cook (rcook_at_llnl.gov)
Date: Fri Jan 22 2010 - 18:15:43 CST

OK, problem solved, the following steps result in a successful build
on AIX 5.

    export CC=xlc
    export CXX=xlC
    export SHLIB_SUFFIX=".a"
    TCL_CONFIG_OPTIONS="--disable-shared"

cd /usr/global/tools/vmd/1.8.7

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/tcl$
{TCL_SRC_VERSION}-src.tar.gz
    cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src/tcl${TCL_SRC_VERSION}/
unix
    ./configure ${TCL_CONFIG_OPTIONS} --prefix=/usr/global/tools/vmd/
1.8.7/$SYS_TYPE/
    gmake || errexit "tcl build failed"
    gmake test || errexit "tcl make test 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/tk$
{TCL_SRC_VERSION}-src.tar.gz
    cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src/tk${TCL_SRC_VERSION}/
unix
    ./configure ${TCL_CONFIG_OPTIONS} --prefix=/usr/global/tools/vmd/
1.8.7/$SYS_TYPE/
    sedfiles 's/-O/-g/' Makefile
    gmake || errexit "tk build failed"
    gmake install || errexit "tk install failed"

    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"

cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src

if testbool $BUILD_FROM_CVS ; then
    tar -xvzf /usr/global/tools/vmd/1.8.7/tarballs/2009-12-16-cvs-
checkout.tgz
    mv vmd vmd-1.8.7
    cd /usr/global/tools/vmd/1.8.7/$SYS_TYPE/src/vmd-1.8.7
    tar -xvzf /usr/global/tools/vmd/1.8.7/tarballs/
vmd-1.8.7.src.tar.gz vmd-1.8.7/lib
    mv vmd-1.8.7/lib .
    rmdir vmd-1.8.7
else
    tar -xvzf /usr/global/tools/vmd/1.8.7/tarballs/vmd-1.8.7.src.tar.gz
fi

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 -e 's/.SILENT:/.LOUD:/' -e 's/CXXFLAGS=${CXXFLAGS}/CXXFLAGS
+=/' 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
cp /usr/global/tools/vmd/1.8.7/tarballs/pdflatex .
export PATH=${PATH}:$(pwd)
sedfiles 's/make pdf/gmake pdf/' /usr/global/tools/vmd/1.8.7/$SYS_TYPE/
src/plugins/autoimd/Makefile
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 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

#./configure ${VMD_VERSION} OPENGL FLTK TK TCL PTHREADS LP64 NOSILENT
cd src
gmake || errexit "vmd build failed"
gmake install || errexit "vmd install failed"

On Jan 20, 2010, at 3:38 PM, Rich Cook wrote:

> Sadly, changing versions had zero effect. Same crash. :-(
>
> On Jan 14, 2010, at 9:27 PM, John Stone wrote:
>
>>
>> Rich,
>> You might try using the same version of Tcl I'm using and
>> see if that has any impact. I had no trouble once I used the
>> flags I sent along to you. Either way, I do strongly suggest
>> reporting the problem to the Tcl developers on their bug tracking
>> site. They are usually pretty responsive, but I don't know how much
>> testing they do on AIX or if they've even got regular access to an
>> AIX host machine.
>>
>> Cheers,
>> John
>>
>> On Thu, Jan 14, 2010 at 05:03:21PM -0800, Rich Cook wrote:
>>> Well, that's interesting. Your flags do not help, but I looked at
>>> that thread and the original poster mentioned that make test failed.
>>> I tried to do a make test in the Tcl source directory and it fails
>>> exactly as VMD does. The problem is with Tcl therefore. Sigh.
>>> I guess I'm going to have to figure out how to make Tcl work on AIX
>>> here. This is the joy of my job! :-)
>>>
>>> On Jan 14, 2010, at 2:44 PM, John Stone wrote:
>>>
>>>>
>>>> Rich,
>>>> My AIX builds are based on AIX 6.1 on the NCSA "BluePrint" Blue
>>>> Waters
>>>> software testbed machine here at Illinois. I'm using Tcl 8.5.6
>>>> and I
>>>> compiled everything from source myself. When I compiled Tcl from
>>>> source, I had to workaround a bug in the Tcl stack space checking
>>>> that causes problems on AIX, documented here:
>>>> http://**old.nabble.com/--tcl-Bugs-1889719---Stack-space-check-
>>>> fails-
>>>> on-AIX-td18235084.html
>>>>
>>>> For both VMD and NAMD, we compiled Tcl on this AIX 6.x box
>>>> using configure flags (approximately) like these:
>>>>
>>>> define CFLAGS="-DTCL_NO_STACK_CHECK=1" at configure time, or edit
>>>> the
>>>> makefile to add that definition.
>>>>
>>>> env CC=xlc CFLAGS="-DTCL_NO_STACK_CHECK=1" --prefix=$HOME/tcl85
>>>> --disable-threads --disable-shared
>>>>
>>>> I don't know if using xlc_r matters if you're just linking the
>>>> library to
>>>> code that could use pthreadds.
>>>>
>>>> More info on AIX stacks: https://**computing.llnl.gov/mpi/
>>>> aix_stack.html
>>>>
>>>> You may want "-bmaxdata:0x80000000" at link time.
>>>>
>>>> Cheers,
>>>> John Stone
>>>> vmd_at_ks.uiuc.edu
>>>>
>>>> On Thu, Jan 14, 2010 at 01:02:33PM -0800, Rich Cook wrote:
>>>>> We can also turn this around and let me ask you, what version of
>>>>> Tcl/
>>>>> Tk did you build against? I don't know what difference the AIX
>>>>> version would make.
>>>>>
>>>>> On Jan 11, 2010, at 5:24 PM, Rich Cook wrote:
>>>>>
>>>>>> Hello,
>>>>>> I have been on the injured list for a bit and am just getting
>>>>>> back
>>>>>> to you. It would be cool to meet you sometime if you ever do
>>>>>> drop
>>>>>> by.
>>>>>> Here is I think the info you need. I have forgotton how to get
>>>>>> the
>>>>>> AIX version information.
>>>>>>
>>>>>> rcook_at_up041 (src): uname -a
>>>>>> AIX up041 3 5 00C5D6DD4C00
>>>>>> It's AIX 5.something
>>>>>>
>>>>>> Tcl and Tk are both 8.5.8
>>>>>>
>>>>>> On Dec 30, 2009, at 11:03 AM, John Stone wrote:
>>>>>>
>>>>>>>
>>>>>>> Hi Rich,
>>>>>>> I just got back from your neck of the woods. I passed
>>>>>>> through Livermore twice last week while I was out in California
>>>>>>> visiting relatives. Someday I'll have to make a point to visit
>>>>>>> the lab and some of the people I know there when I'm out that
>>>>>>> way.
>>>>>>>
>>>>>>> Which version of AIX is your machine using? My builds on an AIX
>>>>>>> 6.x
>>>>>>> test machine at NCSA didn't have any of these problems. I
>>>>>>> compiled
>>>>>>> the Tcl/Tk libraries for myself, but I didn't use any
>>>>>>> particularly
>>>>>>> unusual build flags for those compiles. In the past with
>>>>>>> certain
>>>>>>> versions
>>>>>>> of AIX and xlc I have had to do things like override the
>>>>>>> compilation flags
>>>>>>> to reduce optimization in order to get a stable build, but in my
>>>>>>> recent
>>>>>>> builds on the AIX 6.x machine at NCSA I didn't need to do this.
>>>>>>> If you can tell me which exact Tcl/Tk minor version you're
>>>>>>> using,
>>>>>>> I can try doing a build of the same rev and see if this is a
>>>>>>> problem
>>>>>>> with Tcl itself or an interaction with VMD and Tcl.
>>>>>>>
>>>>>>> Cheers,
>>>>>>> John Stone
>>>>>>> vmd_at_ks.uiuc.edu
>>>>>>>
>>>>>>> On Thu, Dec 17, 2009 at 06:08:08PM -0800, Rich Cook wrote:
>>>>>>>> Yes, I have already done that and can give you any info you
>>>>>>>> need.
>>>>>>>>
>>>>>>>> On Dec 17, 2009, at 5:52 PM, John Stone wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Rich,
>>>>>>>>> I thought it was crashing in a Tk call, but I don't have your
>>>>>>>>> traceback in front of me, so that was my vague recollection.
>>>>>>>>> If it
>>>>>>>>> is dying in Tcl itself, then we're going to have to figure out
>>>>>>>>> what
>>>>>>>>> is actually going on there. Can you recompile your Tcl/Tk
>>>>>>>>> library
>>>>>>>>> with
>>>>>>>>> debugging symbols enabled (i.e. by adding -g to the
>>>>>>>>> compilation
>>>>>>>>> flags)?
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> John
>>>>>>>>>
>>>>>>>>> On Thu, Dec 17, 2009 at 05:35:12PM -0800, Rich Cook wrote:
>>>>>>>>>> It crashes when I disable Tk in the same place as before.
>>>>>>>>>> I'm
>>>>>>>>>> confused, because you are telling me to disable Tk but it is
>>>>>>>>>> crashing
>>>>>>>>>> in a Tcl call. Is that intentional? I'm recompiling
>>>>>>>>>> without
>>>>>>>>>> Tcl
>>>>>>>>>> and
>>>>>>>>>> without Tk just to see what happens...
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> 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
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> /* 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
>>>>>>>
>>>>>>
>>>>>>
>>>>>> /* 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
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> /* 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
>>>>
>>>
>>>
>>> /* 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
>>
>
>
> /* 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
>
>
>
>

/* 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