PRepS Installation

What are the requirements for running PRepS?

PRepS has a fairly short list of requirements:

Optional features will be compiled in if the following items are present and properly installed on your system at ./configure time:

The final requirement is that the versions of libPRepS and the PRepS user interface package (currently, there is only one) are compatible. Generally speaking, if you have the latest version of each, you should be in good shape. If you don't, you should also be in good shape if the major and minor versions (the first and second numbers) match.

Where do I get new versions?

http://www.execpc.com/~stuffle/linux/preps/preps.html

How about some terse INSTALL directions?

Assuming that everything goes correctly, there are only three real steps.

  1. Unpack, configure, make, and install libPRepS (be sure to update /etc/ld.so.conf and run ldconfig)
  2. Unpack, configure, make, and install PRepS
  3. Use create_prepsdb to create at least one PRepS database, or use update_prepsdb to update an existing PRepS database.
The first two steps are really the same as in any software installation. Just be sure to install libPRepS before installing PRepS.

Example 1. Building libPRepS

stuffle@cartman:~/temp > tar xzf libpreps-1.5.2.tar.gz
stuffle@cartman:~/temp > cd libpreps-1.5.2
stuffle@cartman:~/temp/libpreps-1.5.2 > ./configure
creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
...
creating doc/Makefile
creating doc/html/Makefile
creating config.h
stuffle@cartman:~/temp/libpreps-1.5.2 > make
make  all-recursive
make[1]: Entering directory `/home/stuffle/temp/libpreps-1.5.2'
Making all in preps
make[2]: Entering directory `/home/stuffle/temp/libpreps-1.5.2/preps'
...
make[2]: Entering directory `/home/stuffle/temp/libpreps-1.5.2'
make[2]: Leaving directory `/home/stuffle/temp/libpreps-1.5.2'
make[1]: Leaving directory `/home/stuffle/temp/libpreps-1.5.2'
stuffle@cartman:~/temp/libpreps-1.5.2 > su -c 'make install'
Password: 
Making install in preps
make[1]: Entering directory `/home/stuffle/temp/libpreps-1.5.2/preps'
...
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
...
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/stuffle/temp/libpreps-1.5.2'
make[1]: Leaving directory `/home/stuffle/temp/libpreps-1.5.2'
stuffle@cartman:~/temp/libpreps-1.5.2 > su -c 'ldconfig'
Password:
stuffle@cartman:~/temp/libpreps-1.5.2 >
          

Example 2. Building PRepS

stuffle@cartman:~/temp > tar xzf preps-1.5.2.tar.gz
stuffle@cartman:~/temp > cd preps-1.5.2
stuffle@cartman:~/temp/preps-1.5.2 > ./configure
creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
...
creating pixmaps/Makefile
creating doc/Makefile
creating config.h
stuffle@cartman:~/temp/preps-1.5.2 > make
make  all-recursive
make[1]: Entering directory `/home/stuffle/temp/preps-1.5.2'
Making all in src
...
make[2]: Entering directory `/home/stuffle/temp/preps-1.5.2'
make[2]: Leaving directory `/home/stuffle/temp/preps-1.5.2'
make[1]: Leaving directory `/home/stuffle/temp/preps-1.5.2'
stuffle@cartman:~/temp/preps-1.5.2 > su -c 'make install'
Password:
Making install in src
make[1]: Entering directory `/home/stuffle/temp/preps-1.5.2/src'
make[2]: Entering directory `/home/stuffle/temp/preps-1.5.2/src'
...
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/stuffle/temp/preps-1.5.2'
make[1]: Leaving directory `/home/stuffle/temp/preps-1.5.2'
stuffle@cartman:~/temp/preps-1.5.2 >
          

Example 3. Creating a PRepS Database

If this is the first time you have installed PRepS, you will need to create a PRepS database. By default, PRepS will attempt to connect to a database called myprs, so myprs is a good name to use if you are only going to have one database. If you are going to have more than one database, then pick a meaningful name. In this example, I create a database called test.

The create_prepsdb script must be run by the PostgreSQL super user.

stuffle@cartman:~/temp > su - postgres
Password:
postgres@cartman:~ > create_prepsdb
Please enter a name for the database (no spaces, no quotes):  test
Please enter a short description for the database (no quotes):
This is just an example database
Please enter an owner for the database [default: postgres]:
stuffle

About to create a PRepS database as follows

Name:  test
Descr: This is just an example database
Owner: stuffle

Are you sure? y
Creating the database
CREATE DATABASE
Creating the database schema installation file
Installing the database schema
Creating the default data installation file
Installing the default data
Done...

test has been created successfully.
Review the test.log file for details.
postgres@cartman:~ >
          

Example 4. Updating an Existing PRepS Database

If you are upgrading from an older version of PRepS, you will need to update any existing PRepS databases that you want to use with the new PRepS version. In this example, I update my existing myprs database. The update process will make a backup of the database first. However, you may still want to make your own backup of the databsae first, just in case.

The update_prepsdb script must be run by the PostgreSQL super user.

stuffle@cartman:~/temp > su - postgres
Password:
postgres@cartman:~ > update_prepsdb myprs

About to update a PRepS database as follows:
        Database:     myprs
        From Version: 3
        To Version:   4

Are you sure? y
Who should own the recreated database? [default: postgres]:
stuffle
Creating schema file
Creating back of database, file: myprs.backup
Dumping current data
Fixing the data dump file
Dropping current database
DROP DATABASE
Recreating the database
CREATE DATABASE
Loading the schema
Droping sequences
Restoring data
Performing final database cleanup
Done...

mypsr has been updated to the newest schema version and all of the data
has been restored.  No fatal errors have been detected.

Review the myprs.log file, which has been created in the current
working directory, for details.
postgres@cartman:~ >
          

You should now be ready to run PRepS.

I have PostgreSQL installed, but ./configure can't find it. What do I do?

The configure script will only look in a few places for PostgreSQL. Specifically, it is looking for the main libpq header file and for libpq itself. If it cannot find these, you may need to specify a search path. For example, if you have PostgreSQL installed in /opt/app/postgres, you may need to type ./configure --with-pgsqldir=/opt/app/postgres.

If configure still complains about PostgreSQL missing, make sure you have PostgreSQL installed correctlly, including the libpq library.

I installed libPRepS, but when I attempt to configure PRepS, it says the wrong version of libPRepS is installed. Why?

This can happen in two scenarios: multiple PRepS installations, or a messed up shared library system configuration.

For the first scenario, let's say that you have PRepS v1.4.5 installed in /usr/local. You want to upgrade to PRepS v1.6.0, but you want to run some tests first, so you decide to install the newer versions of libPRepS and PRepS in /opt/preps. First, you ./configure --prefix=/opt/preps, make, and install libPRepS. You are carefull to remember to add /opt/preps/lib to your /etc/ld.so.conf, and you run ldconfig. However, when you configure PRepS, you get the message that the libPRepS version is too old. What happened is that the configure script found the older version of libPRepS in /usr/local/lib first. To correct this, you would configure PRepS as follows: ./configure --prefix=/opt/preps --with-libprepsdir=/opt/preps

For the second scenario, this is the first time that you have installed PRepS. You configure, make, and install libPRepS. Then you configure PRepS, and get the message that libPRepS is too old. This makes you scratch you head, as you just installed the latest version of libPRepS. What is probably happening is that you forgot to run ldconfig after installing libPRepS. The configure script will then fail to run the little test program that checks the libPRepS version, resulting in a somewhat misleading error message that I should probably fix some day...