[comp.text.tex] when are .fmts portable across architectures?

img@eng.cam.ac.uk (Ian Green) (06/05/91)

When I generate a .fmt file (say lplain, TeX3.0) on a sun4, it appears
to work with virtex on hp300s and hp800s, as well as the sun4.

I was wondering if it is possible to share .fmts files *under some
circumstances*?  (I suspect that this is not possible in general.)

What are these circumstances, if any?

(My hp300 .fmts appear to work under virmf on hp800s.  The two,
lplain-hp800 and lplain-hp300, are exactly the same size, but cmp says
they are different.  Is this difference significant?  [eg it's not
simply a time stamp])

I'm afraid I don't know enough to figure this out for myself.
ian green

karl@geech.gnu.ai.mit.edu (Karl Berry) (06/05/91)

> I was wondering if it is possible to share .fmts files *under some
> circumstances*?  (I suspect that this is not possible in general.)
Yes, it is possible.  Yes, you are right, it is not possible in general.

Here is the story for web2c, i.e., Unix TeX.  I don't anything about
other TeX implementations.  Format (and base, everything I'm going to
say about TeX's .fmt files also holds for Metafont's .base files) files
produced by one implementation are unlikely to be compatible with those
produced by another (in particular, web2c does some rearranging of the
data for speed; other implementations probably do other rearranging, or
none).

First of all, your format must not do any glue setting.  Glue setting,
in Knuth's implementation, is done in a machine-dependent way, and it's
written out to the .fmt file as a machine real (in C, this could be
either float or double).  This is very unlikely to be portable to other
machines.

However, all the formats I know of (plain, latex, eplain, amstex,
amslatex, texinfo) don't do any glue setting.  (Actually, come to think
of it, maybe Texinfo does.  Have to check.)  So they are ok on that
account.

In versions of web2c earlier than 5.84b (i.e., the latest), there is a
another condition: the machines have to have the same endian-ness.  In
5.84b, I rewrote the .fmt-writing code to do BigEndian output.

No one has sent me mail telling me either 1) they are successfully
sharing .fmt files across different endian architectures, or 2) my code
is bombing out.

Hope this helps.

karl@cs.umb.edu