| Next|| Previous || Top |

Installation and Execution of the Unix Version

The Unix source code is almost identical to the Win32 source code, the only difference being one statement in the file global.h ("#define DOS" is absent). A script to run the program in batch mode and a makefile are included in the Unix distribution. The following steps should be used to transfer, compile, and install the program on a Unix computer. Compiled executables are available at the web sites for SunOS and Linux operating systems, which eliminates the need for the compilation step on these operating systems.

(1) Transfer the compressed tar files to your home computer with a browser or by ftp. Be sure to use "type binary" for transferring the tar file by ftp.

(2) Uncompress the compressed tar file and extract the files with tar. The files will automatically extract into subdirectories named bin , database , doc , src, and examples . Here, "2.x" represents a version number.

% uncompress phreeqc.2.x.tar.Z

% tar -xvof phreeqc.2.x.tar

(3) Versions for Linux and Sun are available with precompiled executables. If the program is to be used on another type of computer, then change directory into src and compile the programs using make. By default the makefile (named src/Makefile ) uses gcc as the compiler. Change the variables "CC" and "CCFLAGS" in the makefile to be consistent with the C compiler on your system if necessary. The following commands will create an executable file named, ../bin/phreeqc .

% cd src

% make

(4) Install the script to run PHREEQC. The makefile edits a template of the script ( bin/phreeqc.orig ) to contain the complete pathname to the installation directory and places the edited script in the installation directory. A symbolic link that points to the script is then placed in a directory specified by the user (frequently /usr/bin ). The directory in which the symbolic link is installed is assumed to be included in your PATH environmental variable, so that the PHREEQC will run regardless of the directory from which it is invoked. The default directory in which the symbolic link is installed is $(HOME)/bin .

The following command installs a symbolic link in $(HOME)/bin :

% make install

The following command installs the script in the specified directory:

% make install BINDIR= /usr/local/bin

(5) The environmental variable PHREEQC_DATABASE can be used to specify the default database. In the shell csh , this variable can be set with the command:

% setenv PHREEQC_DATABASE /home/jdoe/local/project/mydata.dat

In the Bourne or Korn shell, this variable can be set with the command:

% export PHREEQC_DATABASE= /home/jdoe/local/project/mydata.dat

The environmental variable can be set permanently by including the appropriate command in a file that is read when the shell is initiated, frequently $(HOME)/.login or $(HOME)/.profile . If this environmental variable is not set, the default database is set in the script (in the installation directory) to database/phreeqc.dat relative to the installation directory. It is possible to specify a different default database by editing the script.

After PHREEQC is installed, it can be executed from any directory with any of the commands described in the Win32 installation section with the understanding that Unix is case sensitive and that most Unix commands and file names are lower case. The examples from this manual can be run from the subdirectory examples in the installation directory. Note that example 14 requires the database file wateq4f.dat, which is database/wateq4f.dat in the installation directory, and example 15 requires the database file ex15.dat , which is in the examples subdirectory.


| Next|| Previous || Top |