Compiling MAGIC 7.5.140 for Mac OS X 10.5 Leopard
Today I decided to try and see if I could get the latest source of MAGIC (7.5.140) compiled on Mac OS X 10.5 without a lot of major hassles. Turns out there are a few things you need to know, and I'll detail them here, but the end result is that yes, you can get it compiled and it'll use the X11/OpenGL display and it's not bad at all.
I used MAGIC on some old DEC VAXStations and even an Amiga 1000 back at Auburn University when I taught there. It was a lot better than the home-grown layout tools that I had been using in my graduate work at Purdue - but most of that was likely because the guys at Purdue had to write their own tools - there just weren't any layout tools for the old TEK 4014 screens they had, and they didn't get color screens until late in my work. So it was probably a necessity. But MAGIC is just beautiful.
It can display the overlaps with different visual cues so that you know you have a gate when the poly crosses the n-diffusion. Also it had design rule checks built-in which made it a hundred times easier to really make something in MAGIC as you didn't have to constantly worry if your layout was going to fail in mask fabrication or in the actual foundry. The real kicker for grad students was the MOSIS rules and the pads they created.
With the MOSIS rules and the 'tiny chip' pad, we could have designs sent out to be fabbed at any of a number of silicon foundries in the country. It was an amazing thing to send out the file and see the chips come back and have the students see what they had made. Pretty cool stuff. Anyway, let's get to the building.
First thing is to get the source. I went to the MAGIC site and got the source for 7.5.140. I then unpacked it into a directory and went into the magic directory (a symlink is made in the un-tar).
The only change needed is to edit the configure command due to a linking issue with X11 and OpenGL - as OpenGL is referenced in both the X11 libs and the OpenGL Framework. Apple discusses it here and the fix to the configure script is pretty easy. Replace:
-lGL
with:
-lGL -dylib_file \ /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:\ /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
where it's all one line - I just put in the line breaks for readability sake.
Then it's the standard configure, make, and make install and it's installed in /usr/local/bin with supporting files in /usr/local/lib. Make sure you have the path right and you're golden.
I did notice that wish 8.4 segfaulted when I tried to run it, but that was fixed by using the configure command:
configure --with-interpreter=scheme
so that the default Tcl/Tk interpreter is not used, but the built-in scheme interpreter is used, and then there aren't the issues. I'm sure if I built Tcl/Tk 8.4 from scratch and used that, it'd work, but I don't need an interpreter for MAGIC - I'm not doing that fancy of layouts and I didn't have one in the past, so I'm OK for now. If it gets to be an issue, I can deal with it later.
That's it... it runs.
magic circuit.mag
and up comes the file. Just like I remember. Pretty sweet.
UPDATE: I tried getting it to work with the Tcl interpreter and it just wasn't going to fly. I'm not sure why, but the segfaults were in wish and that's not a good sign. Also, I had a hard time getting the scroll bars to work and the middle-button emulation wasn't working as I had hoped. So all in all, it's working, but only barely. It's not something I'd use for real. Oh well... it was a good try.
UPDATE: they have implemented the scrolling with the arrow keys, so it's not the scroll bars that's the problem, it's user error and remembering it the way it used to be. So I think I'll keep it for a while. Also, I figured out the middle-button issue - I had to enable 3 button behavior on X11.app in the Preferences. WIth that, I get the same one finger = left... two fingers = right... and Option+one finger = middle. Perfect. Now it's good enough to use. Good.