Slaton Lipscomb
Slaton's Tips:
Compiling And Using 8-bit Web With A 24-Bit X Server
Last updated March 31, 2006
Comments/corrections welcome.
Web is a graphical user interface for displaying and interacting with SPIDER images developed at the Resource for the Visualization of Biological complexity (RVBC) located in the Wadsworth Laboratories, Albany, New York. Web is written in C and runs under the X/Motif system.
On some platforms, the 8-bit color version of Web is more stable and robust than the 24-bit version. However, with certain video cards (such as nVidia) you cannot use a pseudocolor mode to run 8-bit applications from a 24-bit desktop. This document describes how to compile the 8-bit color version of Web and configure your 24-bit color X11 system to use it, from a separate virtual 8-bit desktop.
First, you need to add an additional 8-bit screen definition to your X11 server configuration file. Depending on whether your computer uses the XFree86 or X.org implementation of X11, this file is either /etc/X11/xorg.conf or /etc/X11/XF86Config.
For example:
Section "Screen"
Identifier "Screen0_8bit"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 8
SubSection "Display"
Viewport 0 0
Depth 8
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection
Be sure to modify the Modes values as is appropriate for your monitor's capabilities
and/or native resolution.
You will need to edit your login manager configuration to add a second X11 server, running in 8-bit color. Most modern Linux distributions use GDM (GNU Display Manager), which uses the configuration file /etc/X11/gdm/gdm.conf. The following example should also work for XDM (X Display Manager) however.
First, add the following to the end of your gdm.conf file:
[server-8bit] name=8-bit Desktop command=/usr/X11R6/bin/X -depth 8 vt8 flexible=true
Then, find the beginning of the [servers] section, and edit it to look like the following:
[servers] # These are the standard servers. You can add as many you want here # and they will always be started. Each line must start with a unique # number and that will be the display number of that server. Usually just # the 0 server is used. 0=8bit 1=Standard
Using your compiler of choice (e.g. gcc, pgcc, etc), compile an 8-bit Web binary, using the appropriate Makefile for your compiler. SPIDER includes Makefiles for GNU and Portland C compilers.
$ \rm *.o *.a *.mod $ make -f Makefile_linux_le
The compile takes about 3-7 minutes. When it is finished, reboot the system.
From the GDM or XDM login screen, you should now be able to use CTRL-ALT-F7 and CTRL-ALT-F8 to switch between 8-bit and 24-bit desktops.