Using Electric 1-3: UNIX Installation

Chapter I: INTRODUCTION

| ## 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.
- Since the LISP and TCL languages are not distributed as part of the GNU download, users who wish to add these facilities must acquire the sources separately. This language extension file (which is also a GNU-zipped tar file) can be extracted in the same manner as the main Electric distribution. 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 modifications necessary to enable the language facility. It will be necessary to recompile all of Electric when adding the language extension.
- 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 uses "widget libraries" to control the windows on the display. The default widget library is Motif or Lesstif (Lesstif is an open-source clone of Motif). 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. 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

- If you do not wish to use Motif/Lesstif, Electric can use the MIT Athena widget library which is free and usually installed (HP UNIX users may have to install it specially and modify the Makefile to locate it). To switch to these, edit Makefile after running "configure" (comments near the top explain what to do).
- 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.
- 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.
- 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 facet tech-Artwork. The top part of the facet shows text in sizes 4 through 20.
  Don't forget to restart X after making changes to the ".Xdefaults" file.

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