Mass compilation on all platforms (Unix and Windows shown)
Ken Langendock
Ken at Langendock.com
Wed Nov 15 19:12:56 CST 2006
A lot of discussion about compiling for UNIX has gone around today.
Since I have been building applications that run on VaxVMS, UNIX,
WINDOWS and HPMPE using ISAM, IMAGE/ELOQUENCE and ORACLE for the past 17
years, I have developed a way of making my code portable across all
platforms.
I cannot take credit for all of these tricks, many of the following
examples are a direct result of assistance from Steve and others at
Cognos support (Thanks Steve) over the last 11 years.
I am sure many people have ways of compiling source code on different
machines. I have found calling QUIZ or QDESIGN from within QTP to retain
subfiles cause memory failures on WINDOWS when compiling a large system.
Because of that I do no use that method on any platform (KISS - Keep it
simple...)
For my example you can compile a complete system (on UNIX and WINDOWS)
by doing the following:
On UNIX:
$setup.sh (this sets up environment variables for interactive and batch)
$PH_USR/pdl procloc=$PDL dict=$PHDICT CC='(ISAM,$LANGUAGE)'
auto=$PDL/compile.pds
$PH_USR/qtp procloc=$SRC dict=$PHDICT cc='(ISAM,$LANGUAGE)'
auto=$SRC/compile.qts
$PH_USR/quiz procloc=$SRC dict=$PHDICT cc='(ISAM,$LANGUAGE)'
auto=$SRC/compile.qzs
$PH_USR/qdesign procloc=$SRC dict=$PHDICT cc='(ISAM,$LANGUAGE)'
auto=$SRC/compile.qks
On WINDOWS:
call %BAT%\setup.bat (this sets up environment variables for interactive
and batch)
call %PH_USR%\qutil procloc=%PDL% dict=%PHDICT% cc={ISAM,ENGLISH}
auto=%PDL%\compile.pdl
call %PH_USR%\qtp procloc=%SRC% dict=%PHDICT% cc={ISAM,%ENGLISH%}
auto=%SRC%\compile.qts
call %PH_USR%\quiz procloc=%SRC% dict=%PHDICT% cc={ISAM,%ENGLISH%}
auto=%SRC%\compile.qzs
call %PH_USR%\qdesign procloc=%SRC% dict=%PHDICT% cc={ISAM,%ENGLISH%}
auto=%SRC%\compile.qks
Also do NOT specify any destination in the BUILD statement. I know
people love to do that, but if you want the code to be portable forget
it.
Instead KISS (keep it simple...):
QTP - RUN MySourceA
QUIZ - BUILD MySourceC
QDESIGN - SCREEN MySourceC
The trick is in the compile script for QTP/QUIZ/QDESIGN. These source
files work on all platforms but I only showed UNIX and Windows:
;-----------------------------------------------------------------------
; COMPILE.QTS Compiles all QTP source code
;-----------------------------------------------------------------------
USE MySourceA.qts NOLIST NODETAIL ; Creates a subfile
@if WINDOWS
!if not "%PHTEMP%"=="" copy %PHTEMP%\*.*d %SUBFILES% >nul 2>&1
@elseif UNIX
!cp $PHTEMP/* $SUBFILES/
@endif
exit
;-----------------------------------------------------------------------
; COMPILE.QZS Compiles all QUIZ source code
;-----------------------------------------------------------------------
@if WINDOWS
!copy %SUBFILES%\*.* %PHTEMP% >nul 2>&1
@elseif UNIX
!cp $SUBFILES/* $PHTEMP/
@endif
USE MySourceB.qzs NOLIST NODETAIL ; Uses a subfile created in QTP
extract
;-----------------------------------------------------------------------
; COMPILE.QKS Compiles all QDESIGN source code
;-----------------------------------------------------------------------
@if WINDOWS
!copy %SUBFILES%\*.* %PHTEMP% >nul 2>&1
@elseif UNIX
!cp $SUBFILES/* $PHTEMP/
@endif
USE MySourceC.qks NOLIST NODETAIL ; Uses a subfile created in QTP
extract
More information about the powerh-l
mailing list