Chapter 1: INTRODUCTION

## 1-3: UNIX Installation

Electric runs on most UNIX variants, including SunOS, Solaris, BSD, HPUX, AIX, and (of course) GNU/Linux.

The Electric distribution is a single file in UNIX "tar" format, GNU-zipped (see http://www.gzip.org for more information). To install Electric, follow this procedure:

- Extract the contents of the "tar" file. This will create a top-level directory called electric-VERSION with four subdirectories: src, lib, examples, and html.
- To configure for your system, go into the top-level directory and type:

  ./configure
  This will examine the system and create a file called Makefile.
- To build electric you now only need to type make. This compiles Electric and creates the executable file electric in the top level.
- Type ./electric 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.
- Electric uses "widget libraries" to control the windows on the display. The default widget library is Motif. You can use Lesstif, but has some bugs (you will have to remove the "XtDestroyWidget()" call in "DiaDoneDialog()"). You can also use Qt by editing the Makefile after running "configure" (comments near the top explain what to do). Note that when you download these packages, you must download both the libraries for your system and the "devel" package which has header files for the compiler. Also note that many systems use shared libraries for these widget packages, and this may require some additional steps when installing. This is because the libraries get installed in a place that the shared library system doesn't know about. If you have superuser access, you can use ldconfig to tell the system where to find the libraries. Otherwise, you can use the LD_LIBRARY_PATH environment variable (on AIX use LIBPATH and on HP-UP use SHLIB_PATH). This variable is a colon-separated list of paths to be searched for shared libraries. For example, this setting will work on many systems:
  `LD_LIBRARY_PATH = /usr/X11R6/lib/`
  `export LD_LIBRARY_PATH`
- Electric's TrueType package is Rainer Menzner's "T1Lib". You can get it from here: ftp://sunsite.unc.edu/pub/Linux/libs/graphics
  Once you have it, unpack it (it will create a directory with the version number as part of its name, for example "T1-1.1.0"), go into that directory, type "./configure" and then type "make". You can then install with "make install".

  Now go to the Electric directory and edit the "Makefile". Near the top are comments labeled "T1LIB TRUETYPE". Uncomment the two lines (remove the "#" from the beginning of the lines) and change the lines so that they point into the T1Lib folder that you have just installed. For example, if the T1Lib libraries installed into "/usr/local/lib" and the T1Lib headers installed into "/usr/local/include", then you want these lines to read:
  `TRUETYPE_LIBS = /usr/local/lib/libt1.a`
  `TRUETYPECFLAGS = -DTRUETYPE=1 -I/usr/local/include`
  Next (this is the most painful part), you have to set the environment variable T1LIB_CONFIG to point to the file "t1lib.config". This file may be installed in "/usr/local/share/t1lib". There will certainly be a copy in the "examples" folder of the distribution. The catch here is that this file has relative path names in it which must be converted to absolute. So, if you have extracted the T1Lib distribution into the folder "/home/strubin/T1-1.1.0", then the file should look like this:
  `This is a configuration file for t1lib`
  `FONTDATABASE=/home/strubin/T1-1.1.0/examples/FontDataBase`
  `ENCODING=/home/strubin/T1-1.1.0/Fonts/enc:.`
  `AFM=/home/strubin/T1-1.1.0/Fonts/afm:.`
  `TYPE1=/home/strubin/T1-1.1.0/Fonts/type1:.`
  Finally, rebuild Electric with the TrueType library. When you run it, you will get a warning if any of the TrueType initialization fails (in which case it will revert to the non-TrueType code). Otherwise, you have it. Note that Electric uses the first font in the database by default. To change the font that Electric uses, set the environment variable ELECTRIC_TRUETYPE_FONT to the desired font name. You can see a list of available fonts by setting this environment variable to an unknown name, in which case Electric will show all fonts in its error message.

- On Solaris, when using the Forte C compiler, uncomment the line that starts with "FORTECFLAGS" in Makefile.
- 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).
  The make install command will place the executable and the support files in a public location, but they may not be together. For example, it is not uncommon for the executable to be placed in "/usr/local/bin", but the support files in "/usr/local/lib/electric". Because of this, the executable needs to know where the support files are located. There are three ways to do this:
  - You can set the ELECTRIC_LIBDIR environment variable to point to the location of the support files.
  - You can change the #define of "LIBDIR" in "src/include/config.h" to point to the location of the support files.
  - You can keep a local copy of ".cadrc" (this file can be in your home directory or in the current directory). Inside of the ".cadrc" file, change the "electric library default-path" command to point to the remaining support files (the lib and html directories).
  You can use the command make install.html to install the online manual in a public place (typically "/usr/local/share/doc/electric/html"). Be sure that the #define of "DOCDIR" in "src/include/config.h" agrees with this path, or else the See Manual command will not work.
- The IRSIM simulator and LISP interpreter 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 edit Makefile and you will find the instructions necessary to enable these facilities. It will be necessary to recompile all of Electric when adding these extras.
- To add Java, follow these instructions:
  - Download the Java Development Kit (JDK) from http://java.sun.com. Install it. For the purposes of these instructions, assume that it is installed into /usr/java/jdk. If you install it elsewhere, adjust these instructions accordingly.
  - After configuration, but before making Electric, edit the Makefile and uncomment the lines near the top that enable Java. Change the definition of LANGJAVA_DIR to point to the installed JDK location.
  - On Solaris, add this string to the environment variable LD_LIBRARY_PATH:
    `:/usr/java/jdk/jre/lib/sparc:/usr/java/jdk/jre/lib/sparc/classic:/usr/java/jdk/jre/lib/sparc/native_threads`
  - On GNU/Linux, add this string to the environment variable LD_LIBRARY_PATH:
    `:/usr/java/jdk/jre/lib/i386:/usr/java/jdk/jre/lib/i386/classic:/usr/java/jdk/jre/lib/i386/native_threads`
  - Be sure to export "LD_LIBRARY_PATH" if your shell requires it.
  - Electric's Java interface works better if you also install the "Bean Shell" (see www.beanshell.org). Download the ".jar" file and place it in the "java" subdirectory of your "lib" directory. You must use version 1.1Alpha4 or later (version 1.01 is not acceptable).
- To add the TCL interpreter, download it from http://www.tcl.tk and install it. Then edit Makefile and you will find the instructions necessary to enable the interpreter.
- Electric has two ways to control the display. By default, the system runs on any depth monitor, but is slow on older machines and must be run locally (that is, the client and the server must be on the same computer). The alternate method of display is faster and can run over the network, but it can only support displays that are set to 8bpp (8 bits per pixel). In addition, this alternate method will suffer from "colormap flashing" when the cursor enters and leaves the Electric windows. To switch to this alternate method, edit Makefile after running "configure" (comments near the top explain what to do). Note also that Motif and Lesstif do not work well with this alternate display method, so you will also have to switch to using the Athena widgets.
- Electric is able to invoke the SPICE simulator automatically. In order to do this, it needs to know the location of this program. You can change the #define of "SPICELOC" in src/include/config.h, or you can set the environment variable ELECTRIC_SPICELOC.
- If you wish the "file" command to recognize Electric libraries, add these two lines to "/etc/magic" (or wherever the "magic" information is stored):
  `0 long 031176377777 Electric library`
  `0 long 037777774711 Electric library`
- There are two command-line arguments that can be given which will control the display. If you use the "-m" option, Electric will look for multiple displays and use them (it searches for files named "/dev/fb*"). If you use the "-geom WxH+X+Y", it will set the graphics window to be "W" wide, "H" high, and with its corner at (X, Y).
- Additional X-Windows options can be typed into the file ".Xdefaults". The resources "Electric.font0" through "Electric.font8" set the font to use for point sizes 4, 6, 8, 10, 12, 14, 16, 18, and 20. The resource "Electric.fontmenu" controls the text used in the component menu, and the resource "Electric.fontedit" controls the text used in the text editor. Here is a sample line from the file:
  `Electric.font5: -misc-fixed-medium-r-normal-*-*-140-*-*-*-*-*-*`
  To see what all of these fonts look like, load the library samples.txt (with the Readable Dump subcommand of the Import command of the File menu) and edit the cell tech-Artwork. The top part of the cell shows text in sizes 4 through 20.
  Don't forget to restart X after making changes to the ".Xdefaults" file.
- 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, edit the "Makefile" and follow the instructions for "Internationalization". You must then set the environment variable "LANGUAGE" to the proper language ("fr" for French). On Solaris, you must also set the environment variable "NLSPATH" to point to Electric's "lib/international" directory.
  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 |