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 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 Embarcadero (originally Borland, then Codegear) Delphi 2007 (32 bit version) and XE10 (64 bit version), though it should compile with any version after 2006, possibly with minor modifications. The mkpgopher.bat file in the pgopher directory will compile it from the command line. Alternatively install the utils/PutilsU.dpk and wutils/PcontrolsU.dpk packages into the IDE (utils/Putils.dpk and wutils/Pcontrols.dpk for Delphi 2007 or earlier), after which the pgopher/PgopherU.dpr (pgopher/Pgopher.dpr for Delphi 2007 or earlier) project can be loaded and compiled in the IDE. Note that various open source graphics libraries are required for a complete build for 32 bit versions; these are included in the GraphicEx directory. The files with "orig" in the name are the files as distributed with the library. The pgopher/pgoU.dpr (pgopher/pgo.dpr) are for the command line version.

Compilation using the open source Free Pascal (http://www.freepascal.org) and Lazarus (http://www.lazarus.freepascal.org) packages is also possible under Windows. 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, the instructions are as for Linux below.

Linux

The current version is compiled the using the open source Free Pascal compiler (http://www.freepascal.org) and Lazarus (http://www.lazarus.freepascal.org) packages. The development versions may be required for correct compilation and operation; the current version requires at least version 3.0.0 of the compiler, with 3.0.2 for all features. Similarly version 1.8 of Lazarus is recommended, though it is possible to compile with version 1.6 with some minor adjustments. 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. If you have a recent compiler and Lazarus  installed, then the the Lazarus IDE can be used to compile PGOPHER and pgo:
  1. Start the IDE; from the command line use startlazarus.
  2. Install the Pcontrols package by:
    1. Go to "Package", "Open Package File" and open the Putils.lpk file in the utils directory.
    2. Similarly, open the gutils.lpk and then Pcontrols.lpk packages in the wutils directory
    3. Click "Use, Install" on the Pcontrols package window. This will generate several prompts, including a warning about package misconfiguration, which are expected. Accept them all, and Lazarus will be rebuilt. A "Pgopher" entry should then be visible in the tabs at the top right of the Lazarus IDE, though you may have to scroll the tabs to see it.
  3. The FPSpreadsheet package (http://wiki.freepascal.org/FPSpreadsheet) is recommended, but not essential. Either download the current version from the package website, or download the development version with:
    svn co https://svn.code.sf.net/p/lazarus-ccr/svn/components/fpspreadsheet fpspreadsheet
    
    and open fpspreadsheet/laz_fpspreadsheet.lpk in the IDE. (Install is not required.). If you omit this step, some minor editing of the lutils package will be required; remove the dependency on fpspreadsheet and delete XLSLoader.pas.
  4. "Open Package File" for the lutils.lpk package in the lutils directory and the lforms.lpk package in the lforms directory. Install is not required.
  5. Use "Project", "Open Project" to load pgopher.lpi in the pgopher directory. You will see the message "Unable to find the component class "TSettingsForm"" - select "Ignore, use TForm as ancestor". (You may also see this message for other forms.)
  6. Compile and run with "Run", "Run". On first compilation, you will be prompted to create the output directory
Steps 2 - 4 are only required on initial installation of Lazarus. For the command line version open the project file pgo.lpi instead at step 5. When the IDE is set up as above the program can be built from the command line with:
lazbuild pgopher.lpi
or, for the command line version:
lazbuild pgo.lpi
If you don't have a recent Lazarus install, then try the makesvn script which will download and compile the current development version of the compiler and IDE, and then set up the IDE to compile PGOPHER, and use it to compile PGOPHER. It requires a bootstrap version of the compiler to start with, and the pgopher_source zip file, both in your home directory. The simplest way of obtaining this bootstrap compiler is probably to install the version of Lazarus using your distribution's package system, copy the core compiler (ppc386 or ppcx64) to your home directory and then uninstall Lazarus (to avoid confusion between versions). Alternatively, extract the file from a download for your system from http://www.freepascal.org. Given this, run the makesvn script.

Modifications and subsequent compilations can be made through the Lazarus IDE; use startlazarus to launch it. On first starting it you may receive a message about upgrading configurations on starting the IDE - just accept the upgrade.

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. Compiling PGOPHER is then as for Linux.

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.