# Requirements

The main graphical user interface in Bsoft is written in Tcl/Tk. Bsoft uses the system Tcl/Tk, which is installed on Mac OSX by default but may need to be installed on Linux. If there are multiple versions of Tcl/Tk (as may have been installed as part of other packages),

The installation is the same for all flavors of Unix. The recommended location for Bsoft is in /usr/local. If you want to install Bsoft in a different location, change the environment variable BSOFT to point to the appropriate directory:

setenv BSOFT /usr/local/bsoft

OR

setenv BSOFT $OTHERPATH/bsoft

Copy the distribution file to the desired directory (e.g., /usr/local) and unpack it as follows (it will unpack into a directory named "bsoft"):

gunzip bsoft1_6_0 .tgz

tar -xvf bsoft1_6_0 .tar

OR

tar -xzvf bsoft1_6_0 .tgz

Note for Mac OS X 10.8+: To compile Bsoft, the Apple developer application Xcode must be installed. In addition, the command line tools must also be installed after Xcode:

xcode-select --install

All programs are compiled with the C-shell script "bmake" in the main bsoft directory (the -w option prevents display of warnings):

bmake

### Compiling over a previous installation

When the operating system has changed or a new version of Bsoft has been downloaded over an old one, the old object files need to be clean out before compilation. A clean install is then required:

bmake clean

OR

bmake cleanall

The last option cleans out all the associated libraries (TIFF, JPEG, PNG and FFTW).

### Platform specifics

The bmake script uses platform specifications in the bsoft/platform directory. The file name for the platform is automatically generated from system information. However, a different file may be specified:

bmake file=ia64_Linux.icc

### Tcl/Tk (for Bshow and Brun)

The programs bshow and brun requires the Tcl/Tk libraries, including the header files for compilation. The typical Linux installation omits the developer part of the Tcl/Tk package, but this is required for Bsoft.

If for some reason bshow and brun are not desired, the compilation of the Tcl/Tk interface can be bypassed as follows:

bmake notcltk

In some cases the Tcl/Tk libraries may be installed in an odd location. One option is to specify the directory for the Tcl/Tk header files:

bmake tcltk=/usr/local/include

### Tcl/Tk on Mac OS X

I've packaged the Tcl/Tk applications bshow and brun to be able to launch them from the Finder and the Dock. Run the macinstall script in the bsoft/macosx folder (this requires administrative priveleges). This should install Bshow and Brun in the "/Applications" folder.

### Note on 32 versus 64 bit

Bsoft is 64 bit clean and 64-bit versions should be able to handle large image files (>2Gb). The default on systems capable of both 32 and 64 bit addressing, is 64 bit addressing. To generate 32 bit versions, run the bmake script with the flag "32":

bmake 32

Both 32 and 64 bit versions of Bsoft can coexist by maintaining two separate bsoft directories. When a program is run, the correct version and library for a particular machine will execute, provided that the PATH and LD_LIBRARY_PATH environmental variables are correctly defined. Be sure to distinguish 32 and 64 bit versions of the Bsoft library clearly with the LD_LIBRARYN32_PATH and LD_LIBRARY64_PATH variables under IRIX64.

32-bit only systems: Linux on x86, MacOSX (G4 and pre-Tiger/10.4 on G5, Intel i386), Solaris, VMS, Cygwin_NT (Intel).

64-bit only systems: Linux on Alpha and Itanium, Tru64.

Dual 32- and 64-bit systems: Linux on x86_64, MacOSX Tiger/10.4+ on G5 and Intel, IRIX64.

### Note on Macintosh G5 and Intel

Bsoft compiled on an Intel Mac with Mac OS X before 10.7 generates universal binaries and libraries, each containing four versions: PowerPC 32 and 64 bit, and Intel 32 and 64 bit. Later versions of Mac OS X dropped support for PowerPC processors and only the Intel version are compiled

The Mac OS X versions have a progression of compilers:

- Mac OS X 10.4 (Tiger): Xcode 2.5
- Mac OS X 10.5 (Leopard): Xcode 3
- Mac OS X 10.6 (Snow Leopard): Xcode 3
- Mac OS X 10.7 (Lion): Xcode 4
- Mac OS X 10.8 (Mountain Lion): Xcode 4
- Mac OS X 10.9 (Mavericks): Xcode 5
- Mac OS X 10.10 (Yosemite): Xcode 6
- Mac OS X 10.11 (El Capitan): Xcode 7
- Mac OS X 10.12 (Sierra): Xcode 8

Note: The best supported way of running Bsoft on Macs is on the latest version possible and in 64 bit. Some older Macs can only upgrade to 10.7, and this will still be supported for now.

## Paralellization and FFTW3

Compiling Bsoft with support for parallel processing requires the FFTW3 package. Instructions to configure and compile FFTW3 and Bsoft are provided here.

## Environment

During compilation the script bmake writes two small files called "bsoft.cshrc" and "bsoft.bashrc" with the required environmental variables. The following Bsoft-specific variables are required:

- BSOFT: The main environmental variable pointing to the Bsoft location (usually /usr/local/bsoft)
- BSOFT32: In cases where both 32 and 64 bit versions of Bsoft is required, this variable points to the 32 bit version directory (usually /usr/local/bsoft32)
- BPARAM: This variable points to a directory in the Bsoft tree that includes parameter files for molecular modeling and filter kernels.

The following general environmental variables need to be modified as well:

- PATH: This points to the executable files (usually /usr/local/bsoft/bin)
- LD_LIBRARY_PATH: This points to the directory with the shared libraries (usually /usr/local/bsoft/lib)

Note that there are variants of LD_LIBRARY_PATH, in particular:

- Darwin (Mac OSX): DYLD_LIBRARY_PATH
- IRIX64 (SGI): LD_LIBRARYN32_PATH and LD_LIBRARY64_PATH

For system-wide setting of these environmental variables, the files to modify are:

- Darwin (Mac OSX): csh/tcsh - /etc/csh.cshrc; sh/bash - /etc/profile
- Linux: csh/tcsh - /etc/csh.cshrc; sh/bash - /etc/profile