XCircuit Compile and Install

General

XCircuit starting version 2.3.2 uses GNU automake to configure the system. The automake script, in addition to the usual search for OS compatibility, looks for the following things: GNU automake is preferred. Use the original Imake only if the GNU make is not working properly.

In addition, compilation from source is always preferred to installation of a precompiled executable (such as an RPM file). Compilation from source allows GNU autoconf to tailor xcircuit to the abilities of your system, as described above.

Installation preparation

  1. Download xcircuit from the xcircuit download page. XCircuit source comes in either tar.gz or tar.bz2 formats.
  2. Uncompress with, as appropriate,
    	gunzip xcircuit-version.tar.gz    or
    	bunzip2 xcircuit-version.tar.bz2
    	
  3. Untar the archive file with
    	tar xf xcircuit-version.tar
    	
  4. The result of the above steps is a directory named xcircuit-version containing the source.
    	cd xcircuit-version
    	
  5. Follow the GNU automake instructions, below. If automake fails, revert to the original imake style.

GNU Compile and Install (preferred)

GNU automake is intended to greatly simplify the process of program installation by querying the OS for detailed information on its capabilities. In most cases, the following should work without a hitch:
  ./configure [options]
  make
  make install
For default configuration, the xcircuit install process must be run as root user, so the process can access the /usr/local/ directory tree for installation. GNU install puts the xcircuit executable into /usr/local/bin/ and files it needs on startup in /usr/local/share/xcircuit-version/.

GNU Configure Options

All compile-time features are set during the ./configure process. Run

   ./configure --help
for a list of configure options. For most users, the relevant options are the following:
--prefix=PREFIX
Location to install xcircuit. Defaults to /usr/local/. The executable goes to /usr/local/bin/, man pages to /usr/local/man/man1/, and everything else to /usr/local/share/xcircuit-VERSION/. Defaults can be separated by explicitly declaring --exec-prefix=DIR, --mandir=DIR, and --libdir=DIR.
--disable-lgf
Save space by not compiling the compatibility with "analog" and "diglog" .lgf-format files.
--disable-schema
Don't compile the schematic capture system. This is a major feature of xcircuit, so disabling it is not recommended. However, you may do so if you anticipate having no need for circuit netlists.
--with-python=DIR
If the configure step cannot find a Python interpreter, it can be explicitly referenced. Requires the Python library (libpythonVERSION.a or libpythonVERSION.so) and the python include file Python.h. The Python option uses the Python language as an interpreter for xcircuit.
--with-xpm=DIR
If the configure step cannot find the XPM package, it can be explicitly referenced. The XPM package enables the toolbar and an icon when xcircuit is iconified.
--with-gs=DIR
If the configure step cannot find ghostscript, it can be explicitly referenced. The Ghostscript option allows any PostScript file to be rendered on the xcircuit background and saved with the xcircuit file.
--disable-double-buffer
This option is almost wholly deprecated due to the speed of modern processors. However, if you have problems with slow rendering, you might find it useful.
--disable-focus-fix
Don't attempt to work around broken window managers. Normally this option should not be tampered with, but odd behavior regarding capture of key events in the xcircuit window may require it.
Note for HP users: The original HP "m4" processor cannot handle the man page translation. If available, use GNU m4 by changing the configure method above to the following:
M4=path-to-GNU-m4 ./configure [options]

Imake Compile and Install (if GNU make fails)


  xmkmf
  make
  make install
  make install.man

Imake Options

  1. All compile-time features are set from within Imakefile. Be sure to reference Imakefile first if you have difficulties compiling.
  2. Decide where you want xcircuit and its library files to reside, and set XCIRCUIT_LIB_DIR, XCIRCUIT_MAN_DIR, and XCIRCUIT_BIN_DIR accordingly. The default path is "/usr/local/lib/xcircuit-2.2/".
  3. It should not be necessary to change CC, CCOPTIONS, or CDEBUGFLAGS for Linux systems, unless you encounter problems during compiling.
  4. DEC Alpha systems: Add "-taso" to CCOPTIONS to get the compiler to make necessary changes to deal with 64-bit addressing. It may also be necessary to add the "-D" flag.
  5. The XCircuit Imakefile defaults to defining "HAVE_PYTHON". However, this assumes several things: That Python 2.1 is installed on the system, that it is installed in /usr/local/, and that the Python include files have been installed. This is all true for a standard installation from Python source, but not necessarily for a pre-installed Python. If you don't want to use the Python interpreter, you can undefine HAVE_PYTHON in the Imakefile. If you have Python, but it's a different version or installed in a different place, make appropriate changes to the definitions
    
            PYTHON_VERSION=2.1
            PYTHON_LIB_DIR=/usr/local/lib
            PYTHON_INCLUDE_DIR=/usr/local/include/python${PYTHON_VERSION}
       
    in the Imakefile. PYTHON_LIB_DIR is the directory where the library file "libpython2.1.a" (or equivalent, depending on the version) has been installed. PYTHON_INCLUDE_DIR is the directory containing all of Python's .h files, but must at least contain "Python.h".

    The Python library preferably should be built as a shared (.so) library. See the section "Shared Python Library" below.

  6. Anyone using xcircuit for drawing purposes only (no schematic capture wanted) may undefine SCHEMA in the Imakefile. If you're not sure, leave it alone.
  7. By default, the Imakefile assumes that your system has xpm (pixmaps); if you don't, or you get error messages about no include file "xpm.h" found, then delete the line "#define HAVE_XPM" from the Imakefile and recompile. The only thing you will be missing is the color icon.
The makefile should automatically install the application defaults file "XCircuit.ad" in /usr/lib/X11/app-defaults/XCircuit.

The makefile should also automatically install the man page in (depending on the Imake configuration) /usr/local/man/man1/xcircuit.1x.

If the program is extremely slow in rendering the screen or if the system tends to swap during program execution, you may need to undefine DO_BUFFER in the Imakefile. Clean, no-flicker rendering is made possible by drawing on a Pixmap and then doing a quick copy from the Pixmap to the screen. Depending on the default screen depth (usually 8 or 16 bits) and the window size, the Pixmap can take a MB of memory or more. Systems with too little memory or systems without a video card with Bit-BLT (block transfers) can erase all the gains of graphics buffering. Xcircuit will operate fine without buffering, but the screen will flicker every time there is a refresh; consequently, without buffering the system is designed not to refresh as often, and there will be more "pixel trash" on the screen. It is expected that under these conditions the user will simply use the space bar to refresh the screen as needed.

Embedded Python Interpreter

The one option most likely to be missing from default Linux/UNIX distributions is the library and include files for the Python interpreter.

XCircuit compile, if using Python, requires Python source, not the executable. If you need/want to install or update Python on your system, be sure to download the source, not, for instance, an RPM package with executable only.

Obtaining Python

Python source can be obtained from the Python.org official website. The actual download is on the ftp site Python 2.1 FTP directory. Current download (July 2001) is Python-2.1.tgz.

Shared Python Library

The XCircuit build will be *much* smaller if you have a shared python library. However, the build instructions as of Python-2.1c2 don't include instructions for building a shared library under linux. Here's how you do it:
  1. In the Makefile: set
    
            LDLIBRARY=libpython2.1.so
    	
  2. Also in the Makefile: Add a case for libpython$(VERSION).so which looks exactly like the case statement for unixware:
    
            linux) \
               $(LDSHARED) -o $@ $(LIBRARY_OBJS) \
               ;; \
    	
  3. Make until error ("can't find libpython2.1.so")
  4. Copy or move libpython2.1.so to /usr/local/lib or /usr/lib
  5. Run (as root!)
    
    	ldconfig -v -n /usr/local/lib
    	
    (or use the directory where you just put the shared library) and confirm that it found libpython2.1.so.
  6. Finish
    
    	make
    	
    (should run to normal completion).
On my system, this is the difference between a 4MB xcircuit executable and a 1.5MB executable. That's a big difference! Of course, Python purists would say I should be embedding xcircuit in python, not the other way around, then what need do I have for a shared library, anyway?


Back to the xcircuit home page. . .

email: tim@bach.ece.jhu.edu