PGOPHER <Prev Next>

Compiling From Source

PGOPHER is mainly written in Pascal, using the object oriented extensions originally available from the Borland Pascal compiler and now also available in the Free Pascal compiler (not GNU Pascal). The program is distributed as a zip file. Unpack this in a directory on its own, which will create several sub-directories.

Microsoft Windows

The current version is compiled with Borland (now Codegear) Delphi 2006, though it should compile with any recent version (6 or later) with minor modifications. The mkpgopher.bat file in the pgopher directory will compile it from the command line. Alternatively install the utils/Putils.dpk and wutils/Pcontrols.dpk packages into the IDE, after which the pgopher/Pgopher.dpr project can be loaded and compiled in the IDE.

Compilation using the open source Free Pascal (http://www.freepascal.org) and Lazarus (http://www.lazarus.freepascal.org) packages is also possible. Installing the current Lazarus snapshot gives a good starting point though the development version may be required for correct operation, particularly for Lazarus. There is a helpful wiki page on the Lazarus site at http://wiki.lazarus.freepascal.org/index.php/Installing_Lazarus on installing both the compiler and Lazarus. Once the Lazarus IDE and the PGOPHER source are installed:

  1. Start the IDE using the startlazarus shortcut
  2. Install the Pcontrols package by:
    1. Go to "Components", "Open Package File" and open the Putils.lpk file in the utils directory.
    2. Similarly, open the Pcontrols.lpk package in the wutils directory
    3. Click "Install" on the Pcontrols , and accept the rebuild of Lazarus.
  3. Repeat steps 1 and 2 of the the previous step for the lutils.lpk package in the lutils directory and the lforms.lpk package in the lforms directory
  4. Use "Project", "Open Project" to load pgopher.lpi in the pgopher directory.
  5. Compile and run with "Run", "Build All"
  6. Steps 2 and 3 are only required on initial installation of Lazarus

Linux

The current version is compiled the using the open source Free Pascal (http://www.freepascal.org) and Lazarus (http://www.lazarus.freepascal.org) packages. The development versions may be required for correct operation, particularly for Lazarus. There is a helpful wiki page on the Lazarus site at http://wiki.lazarus.freepascal.org/index.php/Installing_Lazarus on installing both the compiler and Lazarus. The standard development (compiler) tools will be required, and possibly some additional libraries not installed by default, but can be installed using the standard package system for your distribution. Given this installation, PGOPHER can be compiled with the mkpgopher script in the pgopher directory (the LAZDIR variable may need setting manually). Alternatively install the utils/Putils.lpk, wutils/Pcontrols.lpk, lutils/lutils.lpk and lforms/lforms.lpk  packages into the IDE, after which the pgopher/Pgopher.lpr project can be loaded and compiled in the IDE

Example compilation on Fedora

The same basic procedure should work on any Linux distribution, though with some possible minor changes to the packages names. The Free Pascal compiler may be available already compiled, which makes the installation process easier.
  1. Install the standard set of development packages (if they are not already installed)
  2. Install the following packages: (Use yum install <packages> as root or use "Add/Remove Software"
  3. If using the development version of Lazarus: (these steps should be done as a normal user)
    1. svn checkout http://svn.freepascal.org/svn/lazarus/trunk/ lazarus (This will download the source for the current development version)
    2. cd lazarus
    3. make
    4. ./startlazarus (This will start the development environment. You need to do this at least once, even if you are using the mkpgopher script.)
  4. To use a released version of Lazarus, download the source tar (or zip) file. Note that you must currently compile Lazarus from source as a normal user if you are going to use the IDE.
    1. tar xzf lazarus-xxx.tar.gz
    2. cd lazarus
    3. make
    4. ./startlazarus (This will start the development environment. You need to do this at least once, even if you are using the mkpgopher script.)
  5. In a separate directory, unzip the PGOPHER source zip file. If a compiled.patch file is available execute:
    1. patch -p1 <compile.patch (in the same directory that you unzipped the source).
  6. If using the mkpgopher compiling script:
    1. cd pgopher (the directory containing the mkpgopher script)
    2. chmod +x mkpgopher (may not be needed on more recent versions)
    3. ./mkpgopher
  7. To use the Lazarus IDE to compile PGOPHER (easier to fix problems):
    1. Start the IDE using startstartlazarus
    2. Install the Pcontrols package by:
      1. Go to "Components", "Open Package File" and open the Putils.lpk file in the utils directory.
      2. Similarly, open the Pcontrols.lpk package in the wutils directory
      3. Click "Install" on the Pcontrols , and accept the rebuild of Lazarus.
    3. Repeat steps 1 and 2 of the the previous step for the lutils.lpk package in the lutils directory and the lforms.lpk package in the lforms directory
    4. Use "Project", "Open Project" to load pgopher.lpi in the pgopher directory.
    5. Compile and run with "Run", "Build All"
    6. Steps 2 and 3 are only required on initial installation of Lazarus

Mac

Compilation on the Mac is similar to the process on Linux. See the "Installing Free Pascal under Mac OS X" section in the Lazarus wiki page at:

http://wiki.lazarus.freepascal.org/Installing_Lazarus_on_MacOS_X

for more details. When the Free Pascal compiler is installed, steps 3 onward of the Fedora Core instructions above should work from a terminal. (Note that you must currently compile Lazarus from source if you are going to use the IDE rather than using a pre-compiled binary.) 

LAPACK (and BLAS)

PGOPHER uses slightly modified versions of selected parts of the LAPACK library to diagonalize matrices. Precompiled versions of these (using g77 or gfortran) are included with the source distribution, as these do not normally need to be recompiled. For systems other than Microsoft Windows this can normally be accomplished using the command:

	make -f GNUmakefile
in the utils/blas and utils/lapack directories. The modifications are mainly so that the fortran run time library is not required.