Using Electric 1-4: Macintosh Installation

Chapter 1: INTRODUCTION

| ## 1-4: Macintosh Installation |

Macintosh users must run System 7 or later. Electric comes with project files for Metrowerks, although it has been built with MPW and THINK_C. System 10 users can choose between Qt (which costs money) and ProjectBuilder (which is not fully working yet).

The Electric distribution is a single file in UNIX "tar" format, GNU-zipped. On the Macintosh, use the program MacGzip to un-zip the file, and MacTar to un-tar the file. To install Electric, follow this procedure:

- After the files have been extracted, there will be a top-level directory called electric-VERSION with four subdirectories: src, lib, examples, and html.
- Beware of Macintosh line-feed conventions, which are different from those on other operating systems. If you use an older "tar" program (other than "MacTar"), you may need to set the "Convert Newlines" option before extracting the "tar" file. Also, if you use "Internet Config", check to be sure its "Change Newline" setting set. To be sure that the extraction has worked properly, examine the file cadrc, which is in the top level directory. This file should have less than 10 lines of text. If the file appears as a single line, or if there are spurious unprintable characters at the start or end of each line, then the text conversion has been done incorrectly.
- For System 7, 8, and 9, there is a Metrowerks project (called Electric.xml). Run Metrowerks, import this file, and save it in the top level, alongside the src directory. Due to the size of the code that is being built, you may have to increase the size of the Metrowerks partition.
- For System 10, there are two ways to go: Qt or ProjectBuilder. Qt is the only fully-working solution, but unfortunately it is not free on the Macintosh (it is actually quite expensive). Also, you need Qt release 3.1.0 or later. To build with Qt, use a terminal window and type ./configure to generate a Makefile. Edit the Makefile and switch to Qt widgets (uncomment the Qt part, comment the Motif part, and in the Qt section, change comments to switch to "Qt on Macintosh"). Qt also requires that you set "Font Smoothing Style" to "Standard" in the "General" System Preferences. If you do not have Qt, then there are ProjectBuilder files (called Electric.pbproj and the English.lproj folder). Be warned that this is not fully debugged, so use with care.
- Compile Electric. This will create the application Electric.
- Double-click the Electric application to run the system.

Here are some detail on the Electric distribution:

- The src directory contains the source code. It is hierarchically organized by function.
- The html directory contains one subdirectory, manual, which is this manual in HTML format. To see the document, point your browser to the file index.html inside of the manual directory.
- The examples directory has some demo files.
- The IRSIM simulator, LISP interpreter, and Foreign language interfaces are not distributed as part of the GNU download. Users who wish to add these facilities must acquire the Static Free Software extras described here. Use the same procedure to extract this extension file (which will also be a GNU-zipped tar file). Extract it into the same location as the main source distribution and it will add the necessary files to the source tree. Then import the project file ElectricSFS.xml to create the Metrowerks project for Electric with the language extension.
- To add the TCL interpreter, follow these instructions:
  - Download ActiveTcl from http://www.tcl.tk and install it.
  - If using Qt/System 10, edit Makefile and add TCL. Otherwise:
    - In the compiler, add an include path to the installed TCL "include" directory.
    - Also in the compiler, add the appropriate TCL library to the project.
  - Edit the appropriate "mac" include file in src/include (for example, macsfsheaders.h) and uncomment the definition of "FORCETCL".
- To add a Java interpreter (System 10 only) follow these instructions:
  - Download Java from http://java.sun.com and install it.
  - If using Qt, edit Makefile and add Java. Otherwise:
    - In the compiler, add an include path to the installed Java "include" directory.
    - Also in the compiler, add the appropriate Java library to the project.
  - Edit the appropriate "mac" include file in src/include (for example, macsfsheaders.h) and uncomment the definition of "FORCEJAVA".
- Installation of Electric requires some care. Although Electric will run properly from the directory where it was built, you cannot move the executable to a different location and expect it to work. This is because Electric makes use of a collection of support files. The main support file is called cadrc. In addition, Electric needs to find the lib and html directories. If these support files cannot be found, Electric will not be able to initialize its graphical user interface (just type "-quit" to exit the program if this happens). It is sufficient to move the support files, along with the executable, to a public location. Then make an alias to the executable and place that anywhere you like. When the alias is run, the directory with the executable will become the current directory, and all of the needed support files will be found.
- Electric can speak your language! Currently, it has been translated into French. Contact Static Free Software if you are interestested in doing a translation. To use this facility, you must obtain the Static Free Software extras and build the "International" version of Electric in ElectricIntl.xml or ElectricSFSIntl.xml. Before compiling, set the desired language by changing the routine "elanguage()" in "graph/graphmac.c".
  At any time, you can disable the foreign language and return to English by moving the translation files. These files are in the "lib/international" folder, with a subfolder that has the language name (for example, French translations are in "lib/international/fr"). Beneath that is a folder called "LC_MESSAGES" and inside of that are the translation files.

| Previous |  |  | Table of Contents |  | Next |