Building a FreeBSD/PC-BSD/DesktopBSD Workstation
If you're not a hacker, and would like a system that's easy to set up and mange, I would recommend trying DesktopBSD. DesktopBSD is FreeBSD, with an easy-to-use graphical installer added, and several other nice features that make it easy to manage. Most importantly, it has a graphical interface for managing FreeBSD ports, which are used to install/uninstall/upgrade all MRI tools on FreeBSD.In a nutshell, here's what you need to do:
- Obtain a computer that will run FreeBSD/PC-BSD/DesktopBSD, and is up-to-snuff for the demands of MRI analysis. The minimum specs I would recommend would be 512 megabytes of RAM, a 40 gig disk, and a 500MHz Pentium processor. FreeBSD will actually run on much less than this, but these are very minimal specs for any kind of serious MRI analysis. You can probably get by just fine with several hand-me-down machines like this for visualization of MRI data, and one or two more modern (e.g. AMD64, Mac G5, Mac Core Duo) systems to handle the occasional heavy analysis. ( See Benchmark results and Performance tips )
A gigabyte or more of RAM is advisable, especially for high-resolution scans. Two or more gigabytes may be helpful in many cases, although in most analyses, the data can be split up, analyzed in pieces, and the results combined. AFNI and other MRI analysis suites provide tools made just for this scenario. No matter how much RAM you have, you'll eventually devise an analysis that needs more, so you you'll need to learn how to "divide and conquer" your data anyway. You may as well do so before wasting money on RAM you really don't need. You may want to plan to upgrade your RAM later (by using larger memory chips in order to leave additional slots open). However, if you do so, be sure the new chips are of the same type AND FROM THE SAME MANUFACTURER to avoid ugly compatibility issues.
You'll want a reasonably large disk, although it depends greatly on your particular study. 80 gigabytes is a pretty good size. If your disk is smaller, I recommend upgrading it before spending time installing a new OS and all the fMRI tools. Otherwise, you may find yourself repeating the process when you run out of space. Also, MAKE SURE YOU HAVE A WAY TO BACK UP ALL YOUR DATA, OFF-SITE IN CASE OF A FIRE OR THEFT. External disk drives (I recommend LaCie triple-interface) are cheap, but fragile. Drop one containing two year's worth of work on the floor, and you'll see what I mean. A tape backup system is more expensive, but more durable and hence safer to transport to another location. Using rsync to back up over the network to another computer is an elegant solution, assuming you can house another computer far enough away to protect it from a theft or fire in your lab.
Multiple processors are quite useful for running 3dDeconvolve, which is the most time-consuming of the AFNI processing tools. 3dDeconvolve utilizes multiple processors very effectively, so you'll nearly double the processing speed by using two processors. See the AFNI WEB site or my own benchmark results for more details.
If you plan to run CARET or SUMA, you'll probably want an nVidia GeForce video card, along with the commercial nVidia drivers. ( Easily installed from FreeBSD ports ) Note that the nVidia driver for FreeBSD/Linux is notorious for causing X server and/or kernel instability. However, switching to the right version of the nVidia driver should resolve any stability issues. When installing from the FreeBSD port, this can be accomplished using "make config" and possibly command-line knobs such as "-DWITH_LEGACY_GPU_SUPPORT". ( The latter solved our latest issues by rolling back the driver from v1.0.8762 to v1.0.7174. )
Despite these issues, I'm grateful to nVidia for supporting the open source community. The 3D performance of the GeForce cards with the nVidia driver is quite impressive compared to other available options.
You may also be able to get by using DRI with an appropriate video card, although I'm not aware of any DRI configurations that can match the performance of the nVidia GeForce.
- Install the latest FreeBSD/PC-BSD/DesktopBSD production release. The i386 platform is the most extensively used and tested, but FreeBSD also runs on other platforms, including Sun Sparc, DEC Alpha, AMD64, ia64, etc.
Note that some commercial Linux applications and other closed-source 32-bit binaries, as well as the nVidia driver, may only work on the i386 distribution. Running i386 FreeBSD on your AMD64 system will NOT reduce performance in any measurable way for MRI applications. ( The only advantages of the AMD64 platform are the use of 64-bit integers and 64-bit addressing, neither of which offers an advantage to MRI applications, which are generally floating-point intensive, and use much less than 4 gigabytes of RAM. )
If you're building multiple workstations, you can save some time by building one generic one, and cloning the rest. The master should contain all the software, but none of the host-specifics, like static IP addresses, or configs for hardware that isn't identical on all systems. The Disk-to-Disk Clone port can assist you with the cloning process.
- Familiarize yourself with the FreeBSD Handbook, available on the WEB or in /usr/share/doc/handbook. It's a fabulous resource for learning to manage a FreeBSD system. There are also several good books on the subject, such as "The Complete FreeBSD". It's often nicer to have a printed manual on your lap while you tinker with admin tools on the screen.
- Run sysinstall or use the PC-BSD/DesktopBSD GUI tools to do any post-install configuration. While more advanced FreeBSD users often work outside sysinstall, most should be able to do just about all the essentials from within its menus. If you find the need to do more, check the Handbook.
- Set up your printers using apsfilter or cups. Both can be installed as ports or packages. While cups is far more sophisticated, I still prefer to use apsfilter with the traditional lpd print server - it's simple and very reliable.
- Install the MRI ports or packages you need.
A port is built from the program source code, which is automatically downloaded, patched for FreeBSD if necessary, compiled, and installed.
Example:
cd /usr/ports/science/afni
nice make installIf you prefer to install your port in its own directory, instead of the default /usr/local/bin, you can add a PREFIX to the build command:
cd /usr/ports/science/afni
nice make PREFIX=/usr/local/mri/afni installTo learn more about ports, check the Handbook, or run "man ports".
A package is simply a binary distribution of a port. In fact, packages are built from ports by simply running "make package":
cd /usr/ports/science/afni
nice make install
nice make packageMany packages can be automatically fetched and installed over the Internet using pkg_add:
pkg_add -r firefoxPackages can also be installed from CD-ROM, DVD-ROM or FTP via /stand/sysinstall. Note that packages quickly become outdated, so if you want the latest, always build from an up-to-date ports tree.
- CAUTION ON PORTS: Unlike some operating systems, the FreeBSD ports system does fairly strict version checking for dynamic libraries and other dependencies. This contributes greatly to the stability of all installed ports and packages.
However, if you update your ports tree (e.g. using cvsup - see Handbook), as may be necessary to get the program version you want, you may find it necessary to upgrade a lot of programs you've already installed. The new program you are installing may require a more recent version of a common library than is used by older programs that are already installed. Upgrading the library in some cases will necessitate upgrading many programs that depend on it. My best advice is to update the ports tree BEFORE installing any ports or packages. Upgrading 50 or 100 ports later on can be very time-consuming, especially on a slow machine.
Unix under Windows
People often ask about running Unix software under Windows. Unfortunately, there is no simple, direct way to accomplish this. Microsoft has consistently chosen through the years not to support the POSIX API (Applications Program Interface) in their operating systems and compilers, but instead define their own proprietary APIs. POSIX is the international standard API which allows programs written on one Unix-like platform (e.g. FreeBSD, Linux, Solaris, etc.) to be easily ported to any other. With the advent of OS X, Macs are now POSIX compatible, leaving Windows as the only major non-POSIX platform in use on small computers today.The open source community has made a valiant attempt to bring POSIX compatibility to Windows through the Cygwin system. Cygwin allows many POSIX programs to be compiled under Windows, producing Windows .exe files with (mostly) the same functionality as the corresponding Unix binary. Unfortunately, installing and working with Cygwin is not for the faint-hearted. It requires a sound understanding of Unix, plus the ability to deal with the limitations of Cygwin caused by the major differences between Unix and Windows kernels.
Another alternative is to use a product such as Parallels Workstation to boot up a real Unix system under Windows.
The final option worth mentioning, which has been around for a while, is multi-booting. This entails installing two separate operating systems on the same computer, in separate partitions or on separate disks, and then choosing which one to run when the computer is booted. The obvious limitation is that you can only run one OS at a time, which can be a major inconvenience if you commonly use applications on both platforms. It is useful for some people, such as those who do most of their work on Unix, and need to run real-time applications (e.g. stimulus programs) on Windows occasionally. (Real-time programs cannot be run under Parallels or Win4BSD with satisfactory timing results). FreeBSD and Linux both support multi-booting directly, and if you've installed Windows first, the installation programs for FreeBSD and Linux will assist you in setting up multi-booting. Macs have a similar setup called Bootcamp, which can be added to an existing Intel Mac.
![]()