[comp.soft-sys.andrew] Yet another 3100 bug

nsb@THUMPER.BELLCORE.COM (Nathaniel Borenstein) (08/10/90)

OK, so my 3100 compilation finally gets as far as trying to link the
runapp binary.  The Imakefile for atk/apps is set up so that it tries to
get the X11 library simply by using -lX11.  Great.  Again, we get the 
non-libg0 version.  

The fix I found is, in atk/apps/Imakefile, to replace "-lX11" with
"$(XLIBDIR)/libX11.a".  I trust something like that will be in the next
patch.

I really don't understand how anyone ever managed to compile Andrew on
the 3100 without hitting all these problems.   Well, now I'll type "make
World" again and see how far it gets this time...   -- Nathaniel

cmf@UNIX.CIS.PITT.EDU ("Carl M. Fongheiser") (08/10/90)

Nathaniel Borenstein <nsb@thumper.bellcore.com> writes:

> I really don't understand how anyone ever managed to compile Andrew on
> the 3100 without hitting all these problems.   Well, now I'll type "make
> World" again and see how far it gets this time...   -- Nathaniel


I seriously doubt anybody *did* compile Andrew without hitting these
problems.  I sure didn't.  I fought with it for three days, at least 1
of which was just making sure I had all the pieces to build a -G 0
library.  It was that frustration that led me to start work on the G0
converter.  Unfortunately, it's still a ways from working right.

Once you've finished though, it's well worth it.  The fastest fad
animation I've ever seen was on my DECstation 2100.  The 3100 can only
be better.

				Carl Fongheiser
				cmf@unix.cis.pitt.edu

sean@DSL.PITT.EDU (Sean McLinden) (08/10/90)

> OK, so my 3100 compilation finally gets as far as trying to link the
> runapp binary.  The Imakefile for atk/apps is set up so that it tries to
> get the X11 library simply by using -lX11.  Great.  Again, we get the 
> non-libg0 version.  
> 
> The fix I found is, in atk/apps/Imakefile, to replace "-lX11" with
> "$(XLIBDIR)/libX11.a".  I trust something like that will be in the next
> patch.

I got around it by defining the -L option at the level of the config files.
Basically, the following is what I did to get things to work:

in config/site.mcr:

        MIPSLIBC_G0 = /systems/pmax/usr/lib/mips_G0/libc_G0
        XLIBDIR = /systems/pmax/usr/lib/mips_G0
        XSRCDIR = /sources/pmax/X11/mit/
        XUTILDIR = /systems/pmax/usr/bin/X11
        XBASEDIR = /systems/pmax
        ROOTDIR = /systems/pmax
        BASEDIR = /systems/pmax/usr/andrew
        DEFAULT_ANDREW_ENV = /systems/pmax/usr/andrew
        MAKEDOFLAGS = -L/systems/pmax/usr/lib/mips_G0 ${MAKEDODEBUG} \
	 -d ${BASEDIR}/lib -b ${BASEDIR}/bin


in config/allsys.mcr: (this is needed because these are not read,
properly, from the other files in time to make the Makefiles correctly.

        XBASEDIR = /systems/pmax
        XSRCDIR = /services/X11/mit/
        BASEDIR = /systems/pmax/usr/andrew
        DESTDIR = /systems/pmax/usr/andrew

in config/pmax_3/system.mcr:

        CC = cc -Dvoid=int -G 0 "-Wl,-D,1000000" \
	 -L/systems/pmax/usr/lib/mips_G0

Also, if you define AMDS, you'll need to get "mpp" (why anyone chose
to implement Yet Another Macro Preprocessor when there are at least
half a dozen floating around for Unix is beyond me, (let alone why
it is copyrighted by IBM and part of the Transarc code)!

> I really don't understand how anyone ever managed to compile Andrew on
> the 3100 without hitting all these problems.   Well, now I'll type "make
> World" again and see how far it gets this time...   -- Nathaniel

If you have already gotten past the build of the examples, the
make world will fail because it quits if the ".eh" files already
exist (which I why I also remove /usr/andrew before a "make world").

Also, unless you figure out something that I didn't, you'll need to
actually run X11R4 (not DECWindows), to get Andrew to run. Otherwise
the applications will start but the fonts, cursors, and icons will
be screwed up.

Don't forget that building AMDS will destroy your system mailer
unless you make the BASEDIR changes (this might have been fixed
with Patchlevel 6), since it overwrites /usr/lib/sendmail, /bin/mail,
and other things without asking and NOT part of "make install" but
rather as part of "make world").

Other than that it was easy.

Sean

guy@auspex.auspex.com (Guy Harris) (08/11/90)

>The fix I found is, in atk/apps/Imakefile, to replace "-lX11" with
>"$(XLIBDIR)/libX11.a".  I trust something like that will be in the next
>patch.

Make it an option, please; I originally submitted the change to use
"-lX11" in order that, when building on systems where "-lX11" gets you a
shared library, "runapp" gets built with a shared library. 

datri@convex.com (Anthony A. Datri) (08/11/90)

>of which was just making sure I had all the pieces to build a -G 0 library

I've been watching this for a while, waiting for someone to leak a clue
as to what a G0 library is.  Could one-who-knows please do so?

--

zs01+@ANDREW.CMU.EDU (Zalman Stern) (08/11/90)

Yeah, building ATK on a pmax is a bitch. But many many patches ago, it did
build cleanly at lesat once for me following the directions in the README
file at the top of the tree. Gary is working on building ATK on his pmax so
this stuff should get better.

How its supposed to work:

You put all the -G 0 libraries in some directory. (The libs that you need
are enumerated in the documentation.) If that directory is not
$(BASEDIR)/lib/mips_G0, then you must edit the copy of makedo.csh in the
source tree. (This is also documented.) Makedo adds this directory to the
library search path via a -L switch to ld. External libraries used in
makedo lines should use -l instead of absolute library paths. (Note: this
may lose on systems that don't support the -L switch to ld. The only real
alternative is to replace all explicit library references with macros. To
support the -G 0 crud, there will have to be one macro for makedo lines and
one for other purposes.)

I'm not sure how I got region.do to work. A good fix is to change the
Imakefile to use -lX11 instead of $(XLIBDIR)/libx11.a (see aove note).  It
shouldn't hurt to have runapp linked against the non -G 0 X11 library.
Code in runapp can be linked against standard libraries without ill effect.
(Unless your standard libraries and -G 0 ones are incompatible, in which
case all bets are off.)

The MIPSLIBC_G0 docs look pretty broken. In addition it might increase the
general sanity in the world to make the macro contain the .a instead of the
code in the Imakefile. (On the other hand, changing it now might be more
hassle than its worth.)

For similar fun, try building CMU CS software on systems that don't support
the CPATH and LPATH environment variables sometime...

Disclaimers: I don't hack on ATK any more. I hate (I)makefile hacking more
than anything else I have to do on a regular basis.

Sincerely,
Zalman Stern | Internet: zs01+@andrew.cmu.edu | Usenet: I'm soooo confused...
Information Technology Center, Carnegie Mellon, Pittsburgh, PA 15213-3890
*** Friends don't let friends program in C++ ***