NMRFAM


Protein Structure Determination with LinuxNMR

Introduction | Programs | Development | Mailing List | Notebook | Contact

Development: Notes on Linux installation and software implementation

This documentation is geared toward those with at least introductory experience with the Linux operating system. Those unfamiliar with the basic steps in compiling software in Unix may find this information to be of limited value.

Redhat Linux 6.0 on a Portable Computer

Choosing a Machine

An important consideration to keep in mind when deciding which portable computer to purchase is that portable computer hardware isn't nearly as standardized as it is for desktops.  Linux may run poorly or not at all on certain portables. Be sure to verify that linux is supported on the portable computer you wish to purchase. We purchased from Dell because of their high quality and standardized hardware. In addition, Dell does officially support Linux on some of their platforms (it's important to let vendors know that Linux support is an important feature). Here are a few useful resources to aid in making your decision:

Linux on Laptops
Linux PCMCIA Information Page

Dell specific web pages:

Linux on a Dell Inspiron 7000 Laptop
Linux On A Dell Inspiron 3500
Lilla's Dell Inspiron 7000 Notes

Those who wish to compile their own kernel need to keep in mind that the pcmcia device drives are not integrated into the kernel source tree (yet). If you wish to recompile the kernel yourself, you need to download the pcmcia drivers as well (from the Linux PCMCIA Information page)  Or, if you're going to upgrade your kernel using the Redhat supplied kernel .rpm files, be sure to install the pcmcia upgrade .rpm package as well. Before purchasing pcmcia cards check the pcmcia card compatibility list first.

Our experience has shown that Linux can run extremely well on laptop computers. Advanced Power Management features also work in Linux (as long as the Advanced Power Management chipset is APM compliant). If you decide to use the KDE desktop environment, the KDE Laptop Control Panel is extremely useful for monitoring your battery status. I'm sure there are other such tools for other desktop environments.


NMR software in Linux

Compiling F77 Code in Linux

When attempting to build scientific software, one inevitably comes across F77 code. The greatest hurdle to be overcome in getting F77 software to work in Linux is finding a stable F77 compiler. We do not consider g77 (even in egcs 1.1.2) to be stable. The f2c/gcc combination seems to be more reliable than g77, but is often times very slow.

For now, the best alternative for compiling F77 code in x86 Linux is purchasing one of the commercially available F77 compilers. There are a few low cost/high quality compilers available for Linux from various companies. Compilers from The Portland Group and Absoft seem to be the most stable and popular commercial F77 compilers. More information on using F77 in Linux is available at The Linux Fortran Information Page.

The Portland Group F77 Compiler

Our group chose to purchase The Portland Group F77 compiler. This is the only F77 compiler for Linux (aside from the freely available ones) that we've had experience with. The very reasonable price tag of $300US is well worth it given the amount of time saved in not having to debug the compiler and performance issues associated with g77/f2c. The Portland Group compiler has a few key features that make it an attractive choice: The tech support at The Portland Group has also been quite responsive to our requests (even after the 60 days of free email had expired).

Compiling Dyana 1.5 with The Portland Group F77 Compiler

As alluded to in the previous sections, we have not been successful in obtaining Dyana binaries with g77/f2c that produce satisfactory output, when compared with the same calculations performed on an SGI (higher target functions and RMSDs from the Linux g77 version). Compiling Dyana with the Portland Group F77 compiler is very straight forward, and in our hands has produced results that are comparable to those on other platforms when tested on a number of different sets of input data. After performing a

./configure

in the top directory of the source tree, modify the make.config so that

PREPARE     = <install directory>/dyana-1.5/scripts/prepare -c -Dsgi
....
FC          = pgf77
FFLAGS      = -r8 -pc 64

The -pc 64 flag is needed in that it forces the compiler to use 64 bit precision instead of the x86 architecture's native 80 bit precision. This is required to run dyana since it has a loop that will fail to exit because it terminates on a real number compare (and the numbers are never equal with the full 80 bit extended precision).

The ability to force 64-bit REAL variables with the -r8 flag is a very important feature of the Portland Group Compiler. The dyana code does not explicitly declare REAL variables as REAL*8, so they are assumed to be single precision floating point numbers by the compiler if the -r8 flag is not used. Therefore, one can unknowingly obtain incorrect results associated due to numerical roundoff errors associated with using single precision floating point numbers. Dyana may run faster using 32-bit floating point variables (especially on Pentium III processors that support SSE instructions), but the difference in speed is not worth the extra effort and embarrassment of publishing a correction to an erronous structure paper.

Use the -Dsgi flag in order to select precompiler options that incorporate the correct timing functions in Dyana. When compiled using the -Dunkown flag, Dyana fails to properly track the time required for each structure calculation (typically reported in the output from a 'calc_all' command).

Level 1 and 2 optimization (-O1 or -O2) with PGF77 gave Dyana binaries that in some cases ran much faster (-O1), but in all cases produced output which was unsatisfactory (target functions 3-5 times higher than with no optimization -O0).

Compiling xeasy

To compile xeasy, one needs the Motif libraries or a reasonable facsimile. Unfortunately, lesstif (the open source implementation of Motif) doesn't appear to be a reasonable facsimile of Motif (yet). Therefore, one requires the Redhat Motif toolkit to compile xeasy. In addition to that, xeasy requires 8 bit pseudocolor. Thus, you must be running your X server in 8 bit mode to use xeasy. It is rumored that a version of xeasy exists that uses Truecolor (allowing one to run in 24 bit mode), but it doesn't seem to be widely available. We are currently working on modifying the currently distributed version of xeasy to run in Truecolor.

nmrPipe

nmrPipe is currently only available in binary form. Despite the fact that it was compiled in an old distribution of Linux, it still seems to work well.

We have encountered situations where nmrPipe would not process 3D and 4D data sets in core memory due to a lack of virtual memory address space. We have found that nmrPipe does not seem to use all the memory it requires, it just needs to know it's there "just in case". This situation can be most easily remedied by adding space to the swap memory with the addition of a swap file. Instructions for how to do this are given below.

spscan

spscan is currently being distributed only as a x86 Linux binary. It is rumored that the source will be available in the near future.

garant

garant source code can be obtained from the garant web site. We have found garant 2.0 somewhat difficult to compile since it contains some code that follows an old C++ specification and can cause problems on newer ANSI compliant compilers. We were able to modify garant 2.0 in order to compile with egcs.

molmol

A x86 Linux binary version of is available from the Molmol web site. Compiling Molmol in RedHat Linux is relatively straightforward since most of the libraries required by Molmol are available in the RedHat distribution (except for Motif). Unfortunately, we have been unsuccessful in getting our own in-house compiled version to run properly. Fortunately, the binaries distributed on the Molmol site work fine (despite the fact that it was built on an old distribution of Linux). We hope to get it recompiled properly in conjunction with our evaluation of various options for 3D graphics hardware acceleration.

modelfree

The x86 Linux executable for ModelFree 4.01 available from the Palmer lab was compiled with Portland Group F77 with very little difficulty. An attempt at to compile the same way with g77 failed and was not investigated further. Source code for ModelFree is available on request from Art Palmer, and he should be able to provide a complete archive of the source and Makefile used to build the binary currently in distribution.
 

Other Useful Tips for RedHat on a Portable (or Desktop) Computer

Network Configuration: DHCP

The DHCP host network configuration protocol is ideally suited to machines that will be operating in multiple subnets (such as portable computers). The DHCP client and server packages can be installed and configured in a matter of minutes by following the instructions listed on the DHCP mini-HOWTO page.

Network Configuration: Ethernet and PPP

A common scenario encountered by portable computer users is one in which the user needs to connect to an "at work" local area network (LAN), and connect to an "at home" PPP service provider. This can be easily negotiated using a few simple command line programs.  The first step in getting things going is to configure your network devices. Next, configure your ethernet device (eth0) so that it is not activated at boot. In addition, it is also important to configure your PPP device (ppp0) and your ethernet device (eth0) so that they can be activated and deactivated by any user (which is a simple switch in the RedHat linuxconf utility). Now that the network devices have been created (and hopefully set up properly), they can be easily activated and deactivated using the ifup/ifdown shell scripts. For example, to bring the ethernet device up (once the laptop is plugged into your LAN), type:

ifup eth0

to deactivate your ethernet device, type:

ifdown eth0

The PPP device can be activated and deactivated in the same way by substituting ppp0 for eth0. It is important to keep in mind that if you have not configured you network devices such that any user can activate/deactivate them, then only root will be able to execute ifup and ifdown.

To check on your current network configuration, type:

ifconfig

This will give a list of all the active network interfaces and their respective configurations. To check on routing information, type:

route -ne

(the -ne is added to suppress a hostname lookup). This command will show a list of network devices and which gateway they are bound to. This is especially important when there are several network devices activated simultaneously.

Advanced Power Management

As stated above, Linux is capable of dealing with the Advanced Power Management (APM) chipsets on most portable computers. To enable the APM features in Linux, you must have APM support compiled into your kernel (which I believe is the default in the kernels that RedHat distributes) and you must install apmd (APM daemon) which comes in .rpm format in the RedHat distribution (so it's easy to install).

Once the necessary APM resources have been installed, battery status can be monitor by the apmd console/log messages or by installing various GUI APM monitoring programs such as the KDE Laptop Control Panel (of course you must have KDE installed in order to use this program).

Using Windows Software With Linux

The most common way to access traditional Windows software is to configure your machine to dual boot either Windows and Linux. A simple and more elegant way to access Windows software is through the use of emulation software running inside Linux. This can be done by purchasing VMware for Linux (about $100US for an academic license). Briefly, VMware creates a virtual machine in which you can install a parasite operating system (such as Windows or even another copy of Linux). In this way, your parasite operating system is able to run at near full speed since it is still running (almost) natively. VMware also makes redundant the need for a Windows partition (except for a suspend to disk file).

Adding Swap Space Without Repartitioning Your Disk(s)

In most cases, the swap space that is required is about equal to the amount of physical RAM installed in your computer. However, some software requires a large amount of virtual address space (such as nmrPipe) and swap space may need to be added. This can easily be done with the addition of a swap file. The method for doing this is discussed in the man page for mkswap. In addition, a summary is provided below: To see your swap configuration, view /proc/swaps. It will look something like this:

Filename                        Type            Size    Used    Priority
/dev/hda7                       partition       98244   17168   -1
/usr/local/lib/swapfile         file            199996  0       -2

Notice that the swap file and swap partition are listed separately. Notice also that the swap partition has some used space while the swap file has none.  This is because the swap partition has a higher priority. Linux will use the swap partition until it is all used up, then it will start using the swap file.

Previous to the 2.2.x kernel series, Linux could only make use of individual swap spaces totalling no more than 128MB. This is no longer the case with the 2.2.x kernel series. Swap partitions of files can now be as large as 2GB.

Obtaining Linux Software

RedHat's .rpm package files are an extremely convenient way to install software packages since they can easily be uninstalled or upgraded quickly and completely. A very nice database of rpm'ized software can be found at the RPM repository. Most general purpose software can be found there.  When looking for a program, it is always best to search there first before attempting to compile the package yourself.

Hardware OpenGL Support in Linux

OpenGL is a proprietary graphics library designed by SGI that has become the defacto standard among 3D graphics APIs (Application Programming Interface). It has been argued that one of the main reasons why OpenGL has enjoyed such popularity versus other 3D graphics APIs (such as Microsoft's Direct3D) is that a free OpenGL "work-alike" called Mesa had been developed in recent years. In a nutshell, Mesa is an open source, re-implementation of the entire OpenGL API. Similar to the way that Linux cannot be called a Unix variant because it contains no AT&T licensed code (I think Novell owns the license now), Mesa cannot be called OpenGL because it contains no code licensed from SGI. The advent of Mesa has given programmers the ability to take their OpenGL based code (such as MOLMOL) and port it to virtually any system with little to no modification. However, Mesa still lacked the specialized graphics hardware acceleration afforded by SGI workstations until recently. Enhancing Mesa to take advantage of commodity 3D graphics rendering hardware first began as a volunteer effort directed towards 3Dfx Voodoo based graphics cards. Due to the popularity of Linux, and the difficulty and cost of implementing OpenGL hardware acceleration, hardware manufacturers have begun using Mesa as a foundation for developing OpenGL drivers for their chipsets on a variety of operating systems.

Currently, XFree86/Mesa based hardware OpenGL Linux drivers are of beta quality. The next generation of drivers from the XFree86 people (version 4.0) are promised to be of much higher quality and performance than the currently available ones (the drivers are due late in the first quarter of 2000). However, for those who can't wait for the release of XFree86 4.0, XFree86 3.3.x based Mesa drivers are available for nVidia (TNT1, TNT2, and GeForce 256 chipsets) and 3Dfx (Voodoo3 chipset) based graphics cards. We recommend TNT1 and TNT2 based cards since we have had positive experiences with both. For those who do not require accelerated 3D graphics, the software based rendering is always available with Mesa.

In addition to the free XFree86 drivers, there are also high-quality commercial OpenGL drivers available for Linux. Xi Graphics and Metro Link offer drivers for a wide array of chipsets.

Coming Soon: VA Linux, SGI, and NVIDIA have just announced a partnership to develop Linux OpenGL 1.2 compliant drivers for NVIDIA based graphics cards. The drivers, to be unveiled at the LinuxWorld conference in Feburary 2000, are promised to be as fast or faster than their Microsoft Windows counterparts.







LinuxNMR | Volkman | Staff | NMRFAM