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:
- Start the IDE using the startlazarus
shortcut
- Install the Pcontrols package
by:
- Go to "Components", "Open Package File" and open the Putils.lpk file in the utils directory.
- Similarly, open the Pcontrols.lpk
package in the wutils
directory
- Click "Install" on the Pcontrols , and accept the rebuild of
Lazarus.
- 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
- Use "Project", "Open Project" to load pgopher.lpi in the pgopher directory.
- Compile and run with "Run", "Build All"
- 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.
- Install the standard set of development packages (if they are not
already installed)
- Install the following packages: (Use yum install <packages>
as root or use "Add/Remove Software"
- If using the development version of Lazarus: (these steps should
be done as a normal user)
- svn checkout http://svn.freepascal.org/svn/lazarus/trunk/ lazarus (This will download
the source for the current development version)
- cd lazarus
- make
- ./startlazarus
(This will start the development environment. You need to do this at
least once, even if you are using the mkpgopher script.)
- 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.
- tar xzf
lazarus-xxx.tar.gz
- cd lazarus
- make
- ./startlazarus
(This will start the development environment. You need to do this at
least once, even if you are using the mkpgopher script.)
- In a separate
directory,
unzip the PGOPHER
source zip file. If a compiled.patch
file is available execute:
- patch -p1
<compile.patch (in the same directory that you unzipped the
source).
- If using the mkpgopher compiling script:
- cd pgopher (the
directory containing the mkpgopher
script)
- chmod +x mkpgopher (may
not be needed on more recent versions)
- ./mkpgopher
- To use the Lazarus IDE to compile
PGOPHER
(easier to fix problems):
- Start the IDE using startstartlazarus
- Install the Pcontrols package
by:
- Go to "Components", "Open Package File" and open the Putils.lpk file in the utils directory.
- Similarly, open the Pcontrols.lpk
package in the wutils
directory
- Click "Install" on the Pcontrols , and accept the rebuild of
Lazarus.
- 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
- Use "Project", "Open Project" to load pgopher.lpi in the pgopher directory.
- Compile and run with "Run", "Build All"
- 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:
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.