RJLRef: $PH/06f522/how2buildBde060916.htm
This is a generic description
of how to build bde starting from a schema.sch file
For bde this file is bde/schema/94sbde_schema.sch (.txt - a text file).
Note: chgen13 is aliased
to
$CASE/gen/ver_13/chgen/executables/chgen,
and $PH/COOL-BDE/bdegen13 is
sym-linked to $CASE/bdegen13.
$RBGB = ~lechner/bde2alpha_rl/sandbox/bdeNT050526/bdegen13/bde
Step 1 is about running
chgen.
Step 2 is about running imake
= xmkmf -a to build bde.exe for XWindows.
---------------------------
Step 0: Set environment
variables: and check out the bde tree from CVS:
(You should do this in your
.login cmd proc)
(tcsh):
setenv PH
/usr/cs/fac1/lechner/public_html
setenv CASE /usr/proj3/case/
setenv BDEROOT
$CASE/95s523/95sbde/base/Master
setenv CVSROOT $BDEROOT
(bash):
set PH
/usr/cs/fac1/lechner/public_html; export PH;
set CASE /usr/proj3/case/;
export CASE;
set BDEROOT
/usr/proj3/case/95s523/95sbde/base/Master; export BDEROOT;
set CVSROOT $BDEROOT; export
CVSROOT;
Then Check out the bde tree
from CVS at $BDEROOT to your $CWD:
cvs co bde
The bde tree that is created
in your $CWD will include the last-checked-in pr_util_[no]log/*.{c,h} files, bde/src/*.cc
files Imakefiles and xmkmf[no]log.csh procs and bde/lib.
Note: ../{lib,include,schema}
are required so xmkmf[no]log.csh can run make in bde/pr_util_[no]log and in
bde/src. (Otherwise, you must create symlinks to these directories.)
---------------------------
Step 1 (optional): Regenerate
bde/pr_util_[no]log :
Skip this step unless you
want to change the data model for bde. NEVER run chgen UNLESS you WANT to
generate an [obsolete] version of pr_util_[no]log. See below for command-line
options.
You can get an option list by
running chgen without arguments:
-------------------
mercury(162)> cd
mercury(163)> alias
chgen13 $CASE/gen/ver_13/chgen/executables/chgen
mercury(164)> chgen13
gendir = /usr/proj3/case/gen/ver_13/chgen
exec =
/usr/proj3/case/gen/ver_13/chgen/executables/i386-linux/chgen13
Running chgen on mercury
[i386-linux]. Compiled: (943274B Nov
11:2005) DATE_OF_CHGEN_RELEASE = Ã11:0029
Chgen V 13 by 05s523, report
errors to Dr. Lechner:
CHGEN_RELEASE_DATE =
051111:0029
CHGEN-F-INVARGS, Usage: chgen
'schema-filename'[.sch] [-keysize=n] [-nobp] [-ansi] [-quiet] [-validate]
[-noforward] [-maxviews=n] [-noorder] [-gendbschema] [-metafile] [-nosource] [-datinput]
[-log] [-viewname <viewname>]
-------------------------
Most chgen command-line
options are explained in Section 2.9 of
$PH/COOL-GEN/chgen_docs/genv10log_manual.pdf.
Section 9 of that report
gives a complete test case example chgen application. Since genv13 the default
values are adequate for bde. The -log option is needed to generate code for
logging and replay of database transactions.
Due to a change from
latex/.ps to MSWord/.doc format,
chgen reports since genv11 do
NOT subsume earlier ones.
E.g. Section 5.User's Manual
for genv11 (page 119) of
$PH/COOL-GEN/chgen_docs/genv11projectDocs/genv11_project.htm
only reports additions and
differences from genv10log to genv11
(e.g. its one new
command-line option is -datinput).
Chgenv12 did not change the
user interface or generated code.
Chgenv13 did change both:
(1) The genv13 team produced
a new source file pr_accessors.c:
See $PH/COOL-GEN/genv13/05s523Genv13FRept_SBLMMM050519.doc.
(2) I changed two
heavily-used genv13 options into defaults:
-ansi, -nobp are no longer
required - see
$PH/COOL-GEN/genv13/aareadme_genv13.
The generated code from
chgen13 has not yet caught up to this change.
For meta-data use in chgen
boot-strapping, see Figs 3.1 thru 3.9 in
$PH/COOL-GEN/chgen_docs/genv11projectDocs/genv11_project.htm
Run $PH/COOL-BDE/bdegen13/bde/pr_util_[no]log/savepr[no]logfiles.csh
before any use of
chgen and before any
significant manual revisions to pr_*.c.
This will save prior
pr_util_[no]log files into a time-stamped
subdirectory PRUTILCHKPNT =
pr[no]logfiles.$PRDATE .
To run chgen13 in
bde/pr_util:
alias chgen13 $CASE/gen/ver_13/chgen/executables/chgen
[.tcsh]
chgen13 [-log] ../schema/94sbde_schema.sch
Step 1 is only needed when
schema.sch or chgen/src code is changed.
Beware: bde/pr_util_[no]log
reverts back to the auto-generated version,
which destroys the prior
pr_*.c contents of bde/pr_util_[no]log.
If you altered these pr_*.c
files directly they will be over-written and lost.
Currently, you should run
savepr[no]logfiles.csh manually before any use of
chgen and before any
significant revisions to pr_*.c.
=================================================
Step 2: (mandatory): Run the bde make shellproc xmkmf[no]log.csh:
Run xmkmf[no]log.csh in
your checked-out bde tree root
directory,
which I call bde below. All my examples are from my own bdegen13/bde
root
$RBGB = ~
lechner/bde2alpha_rl/sandbox/bdeNT050526/bdegen13/bde.
You can copy this bde tree from
there but better is to check it out from CVS,
If you plan to share your
updates of bde/src or bde/pr_util* sources,
you must check out the bde
tree from CVS and check updates back in)
because merging changes to
bde is very hard otherwise.
See $PH/cvs docs or read 'man
cvs' for info on CVS use.
Step 2 is usually the FIRST step in building bde,
unless you want to
regenerate
bde/pr_util_[no]log files with chgen as in Step 1 above).
Step 2 will build bde in one
of four ways,
depending on $HOSTTYPE = alpha
or i386-linux,
in one of four places
bde/pr_util_[no]log/$HOSTTYPE/bin/bde.exe.
The [no]log option is
controlled by running one of two command
procedures: bde/xmkmf[no]log.csh. Either one of these
first
runs the X11 Makefile
generator imake (via xmkmf -a). This builds
Makefiles from Imakefiles in
bde, bde/src and bde/pr_util_[no]log.
Then it calls [g]make in all
three directories.
[Make will not work in these
sub-directories without the -D symbols
which bde/Makefile provides
at the top level.]
gmake runs three times:
a) compiles bde application
files from bde/src/*.cc for $HOSTTYPE
into
bde/pr_util_[no]log/$HOSTTYPE/obj/*.o ;
(b) compiles files pr_util_[no]log/pr_*.c
(auto-generated by chgen but
often manually updated by me or you)
into pr_util_[no]log/$HOSTTYPE/probj/*.o and
combines them into
an object library
pr_util_[no]log/$HOSTTYPE/probj/pr_util.a
(c) links the C++ obj files
with each other and the pr_util.a object library
and puts the executable into
bde/pr_util_[no]log/$HOSTTYPE/bin/bde.exe.
For
historical reasons, xmkmf[no]log also makes symlinks to the proper
one of four
bde/executables/$HOSTTYPE/bde[log].exe files so they
can be invoked thru the
command proc bde/executables/bde[log].
Caveat: The above hyperlinks
to bde are under $PH/COOL-BDE/bdegen13/bde
which is NOT as up-to-date as
my current Unix workspace path
$RBGB = ~lechner/bde2alpha_rl/sandbox/bdeNT050526/bdegen13/bde
$RBGB is where my intermittent
attempts to make bde less fragile, and
occasional cvs checkin
actions take place: It contains my latest fragile builds
of bde for Unix and Linux
host types with pr_util_[no]log from gen/ver_13.
Caution: pr_util_[no]log has
been updated-in-place many times since it
was last regenerated by
running chgen13 (cvs diff yields a few K
lines).
Warning: bde will NOT compile
on MSWindows machines, because
it is based on the Unix/Linux
X-Windows system which is alien to Microsoft.
The startup $CASE/05f523/bde2fox
project will support MSWindows eventually.
[You are welcome to work on
this project :-)]
Before you modify your
bde/pr_util_[no]log files, you should
first run
bde/pr_util_[n]log/savepr[no]logfiles.csh,
to save a time-stamped backup
copy, as before Step 1 above.
[TBD: Makc the shell
command
$CASE/gen/ver_13/chgen/executables/chgen [-log]
call savepr[no]logfiles.csh
before code-generating a possibly obsolete
version of
bde/pr_util_[no]log.]
Caveat: Unfortunately the
make process is an inefficient brute-force one which is too slow on saturn,
but I have not yet satisfied the
multi-platform requirements in a more efficient way.
For the same reason. some
checks not captured by the make dependencies still need manual intervention
(e.g. dprint.* updates).
NOTE: bde contains dprint.h which is checked into
CVS, and bde/pr_util_[no]log contains two identical dprint.c files. Since
dprint.c is platform and -log-option-independent, only one copy sold have been
checked into CVS. These two versions will merge into one and printrowcounts()
will be generated by chgen13+ and moved
elsewhere.
[TBContinued]