Wednesday, April 06, 2005

Install TAO

Prerequirement:
PETSC must be installed

edit : include/tao_sys.h
search for the line: extern int PetscLogInfo(void *,const char*,...);
change to: extern int PetscLogInfo(void *,const char[],...);
This is because the prototype in tao_sys.h is different from that in
petsclog.h of PETSC

Run the following commands

export TAO_DIR=`pwd`
export BOPT=O_c++
export PETSC_ARCH=cygwin-intel
make all
make tao_testexamples >& examples.log

check for errors in examples.log

Install PETSC on Intel Microsoft Windows 2000

This note describes how to install PETSC on a machine with following specs:

CPU: Pentium 4
OS: Windows 2000
Compiler : Intel Compiler
Math : Intel MKL
MPI : MPICH
Shell: cygwin

Prerequirement:
install MKL: MKL should be in C:\Program Files\intel, with directory name MKL70, MKL61 or MKL, make sure ia32/mkl_c_dll.lib should be the only one library needed
install MPICH: MPICH should be in C:\Program Files\MPICH

edit :

search in *.py for 'C:\Program' and 'cygdrive', change drive letter for your pre-installed software

edit : ${PETSC_DIR}/makefile
search for the FIRST "MINFO_", change MINFO_ to ${MINFO}
remove the next few lines until line: -@$(RM) MINFO MINFO_
change this line to: -@$(RM) MINFO
This is because unknown problem with sed

environment:
adding the MKL DLL directorty to PATH
before entering cygwin, run vcvars32 first to set the environment

entering cygwin
go to root of PETSC
run following commands:
PETSC_DIR=`pwd`; export PETSC_DIR
config/configure.py --with-fc=0 -with-vendor-compilers=intel
make BOPT=O_c++ all
make BOPT=O_c++ test
NOTE: configure.py will use flag -TP for compiling both .c and .cpp files.

If everything is right, configure.py should automatically locate pre-installed
MKL and MPICH. The end of ${PETSC_DIR}/configure.log should look like
following:


Compilers:
C Compiler: /cygdrive/c/users/xw/work/petsc-2.2.1/bin/win32fe/win32fe icl --nodetect -MT
C++ Compiler: /cygdrive/c/users/xw/work/petsc-2.2.1/bin/win32fe/win32fe icl --nodetect -MT -GX -GR -TP
PETSc:
**
** Configure has determined that your PETSC_ARCH must be specified as:
** ** PETSC_ARCH: cygwin-intel
**
**
** Configure has determined that your PETSC_DIR must be specified as:
** ** PETSC_DIR: /cygdrive/c/users/xw/work/petsc-2.2.1
**
** Please make the above changes to your environment or on the command line for make.
**
BLAS/LAPACK: /cygdrive/c/Program\ Files/Intel/MKL70/ia32/lib/mkl_c_dll.lib
MPI:
Type: Default MPICH install location (C:\Program Files\MPICH with MS compatible SDK
Version: 1.2
Includes: ['/cygdrive/c/Program\\ Files/MPICH/SDK/include']
Library: ['/cygdrive/c/Program\\ Files/MPICH/SDK/lib/mpich.lib', 'ws2_32.lib']
Python Configure Actions
These are the actions performed by configure on the filesystem
-----------------------------------------------------------------
PETSc:
Build : Set default architecture to cygwin-intel in bmake/variables
Build : Set default optimization to g in bmake/common/bopt_
File creation : Generated list of jobs for testing in bmake/cygwin-intel/jobs
File creation : Generated list of jobs for testing in bmake/cygwin-intel/ejobs
File creation : Generated list of jobs for testing in bmake/cygwin-intel/rjobs
File creation : Created bmake/cygwin-intel/configure.py for automatic reconfiguration
Framework:
Substitution : bmake/config/rules.in was substituted to produce bmake/cygwin-intel/rules
Substitution : bmake/config/packages.in was substituted to produce bmake/cygwin-intel/packages
Substitution : bmake/config/variables.in was substituted to produce bmake/cygwin-intel/variables
File creation : Created configure header bmake/cygwin-intel/petscconf.h
File creation : Created C specific configure header bmake/cygwin-intel/petscfix.h

How to show tootips of a toolbar in a dialog window?

It is easy to add a toolbar to a dialog window. However, it takes some effort to make the tooltips of the toolbar to work. Here are the steps needed to be taken.

1. Add the following line to the message map in the header file of the dialog box

afx_msg BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT* pResult);

2. Add the following line to the cpp file of the dialog box

ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipText )

3. Add following line to InitDialog()

EnableTooltips();

4. Add the following function


BOOL CConfBrowser_MFCDlg::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
UINT nID =pNMHDR->idFrom;
if (pTTT->uFlags & TTF_IDISHWND)
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
}
if (nID)
{
pTTT->lpszText = MAKEINTRESOURCE(nID);
pTTT->hinst = AfxGetResourceHandle();
return(TRUE);
}
return(FALSE);
}