🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lsi
Article #757

compiling Magic on a SUN3 --- problem with Rect structures

#757
From: clark
Date: Fri, 13 Feb 1987 15:53
49 lines
3466 bytes



	I have been trying to get Magic to run on a Sun110 workstation,
as are many others from what I can see from the net traffic on this
newsgroup. I have the 1986 release of the Berkeley design tools and
obtained source code as well as binaries for Magic on the distribution
tape. The binary works fine on the Sun3/160 and I am very happy with it.
However, running this binary form of Magic on a Sun3/110 is not so good,
as the software thinks the Sun3/110 is a black and white display device.
The Sun release manual for its version 3.2 operating system (which is
required for the Sun3/110s to work properly) says that programs which use
the display devices must be recompiled under the new operating system.
	O.K., I thought, all I have to do is recompile Magic. However,
when I attempted recompilation with the sources provided on the
distribution tape, I encountered a compiler error when compiling
routines in the ~cad/src/magic/graphics library. The errors occured in
those files containing statements for including  both 
the Magic include file geometry.h and the Sun include file
sunwindow/window_hs.h (such as grSun1.c etc.). The error occurs because
both of these include files (eventually) define a structure called
'Rect'. When the compiler gets to the definition in the geometry.h
file it craps out because the 'Rect' structure has already been defined.
The Magic definition is actually different than the Sun definition of
a Rect so one can not merely delete the Magic definition. I attempted to
fix the problem by modifying the Sun Include files (by creating a new
set of include files where the Rect was renamed to Rect2 and including
these new files only when geometry.h was also included. My idea was that
if a routine included geometry.h then the Rect structure it wanted was the
Magic one and not the Sun one. After doing this all of the Magic routines
compiled with no problem and the system installed O.K. However, the
program core dumps right at the beginning, even before the magic window
comes up. I feel that my trick with the altered include files is the
cause of the crashes.
	I am wondering if any body else has come across this problem,
and what they did about it. Obviously Magic must be compilable somehow
since I have a working (3.0 operating system version) binary. I find it
hard to believe that the developers of Magic would include structures
(Rect) that are already in use by the Sun graphics interface and not
make them equivalent. (By the way sunwindow/window_hs.h is a file
including other include statements; the actual definition of Rect is
found in sunwindow/rect.h).


Jim Clark
clark@harvard.harvard.edu
Division of Applied Sciences
Harvard University 
Technical Details
Message-ID: <1221@husc6.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!ptsfa!lll-lcc!ames!think!husc6!endor!clark

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!ptsfa!lll-lcc!ames!think!husc6!endor!clark
From: clark@endor.UUCP
Newsgroups: comp.lsi
Subject: compiling Magic on a SUN3 --- problem with Rect structures
Message-ID: <1221@husc6.UUCP>
Date: Fri, 13-Feb-87 10:53:15 EST
Article-I.D.: husc6.1221
Posted: Fri Feb 13 10:53:15 1987
Date-Received: Sat, 14-Feb-87 18:43:16 EST
Sender: news@husc6.UUCP
Reply-To: clark@harvard.harvard.edu (Jim Clark)
Distribution: comp.lsi
Organization: Aiken Computation Lab Harvard, Cambridge, MA
Lines: 49
Keywords: Magic SUN3/160C Rect structures
Summary: I get compiler errors when compiling Magic on a SUN3