When you are debugging your development work, you want to build PBS without any optimizations, and with the debug flag.
We have changed the steps in https://github.com/PBSPro/pbspro/blob/master/INSTALL to reflect what a developer needs, because the standard INSTALL instructions are for non-developers. The steps are as follows:
Install Any Dependencies (Only Needed First Time)
1. Install the prerequisite packages for building PBS Pro.
For CentOS systems you should run the following command as root:
yum install -y gcc make rpm-build libtool hwloc-devel \
libX11-devel libXt-devel libedit-devel libical-devel \
ncurses-devel perl postgresql-devel python-devel tcl-devel \
tk-devel swig expat-devel openssl-devel libXext libXft
For openSUSE systems you should run the following command as root:
zypper install gcc make rpm-build libtool hwloc-devel \
libX11-devel libXt-devel libedit-devel libical-devel \
ncurses-devel perl postgresql-devel python-devel tcl-devel \
tk-devel swig libexpat-devel libopenssl-devel libXext-devel \
libXft-devel fontconfig
For Debian systems you should run the following command as root:
sudo apt-get install gcc make libtool libhwloc-dev libX11-dev \
libXt-dev libedit-dev libical-dev ncurses-dev perl \
postgresql-server-dev-all python-dev tcl-dev tk-dev swig \
libexpat-dev libssl-dev libxext-dev libxft-dev
2. Install the prerequisite packages for running PBS Pro. In addition
to the commands below, you should also install a text editor of
your choosing (vim, emacs, gedit, etc.).
For CentOS systems you should run the following command as root:
yum install -y expat libedit postgresql-server python sendmail sudo tcl tk libical
For openSUSE systems you should run the following command as root:
zypper install expat libedit postgresql-server python sendmail sudo tcl tk libical1
For Debian systems you should run the following command as root:
apt-get install expat libedit2 postgresql python sendmail-bin sudo tcl tk libical1a
3. Make sure your Git environment is set up correctly.
Build PBS for Debugging
4. Display the available build parameters.
./configure --help
5a. Do a 'make clean'
5b. Configure the build for your environment. You may utilize the
parameters displayed in the previous step. (See notes 1 and 2
below)
For CentOS systems you should run the following command:
./configure --prefix=/opt/pbs CFLAGS='-g -O0'
For openSUSE systems (see note 4 below) you should run the
following command:
./configure --prefix=/opt/pbs --libexecdir=/opt/pbs/libexec CFLAGS='-g -O0'
For Debian systems you should run the following command:
./configure --prefix=/opt/pbs CFLAGS='-g -O0'
6. Build PBS Pro by running "make". (See note 3 below):
make
7. Configure sudo to allow your user account to run commands as
root. Refer to the online manual pages for sudo, sudoers, and
visudo.
Install and Configure PBS
8. Install PBS Pro. Use sudo to run the command as root.
sudo make install
9. Configure PBS Pro by executing the post-install script.
sudo /opt/pbs/libexec/pbs_postinstall
10. Edit /etc/pbs.conf to configure the PBS Pro services that
should be started. If you are installing PBS Pro on only
one system, you should change the value of PBS_START_MOM
from zero to one. If you use vi as your editor, you would
run:
sudo vi /etc/pbs.conf
11. Some file permissions must be modified to add SUID privilege:
sudo chmod 4755 /opt/pbs/sbin/pbs_iff /opt/pbs/sbin/pbs_rcp
12. Start the PBS Pro services:
sudo /etc/init.d/pbs start
Verify Your Install
13. All configured PBS services should now be running. Update
your PATH and MANPATH variables by sourcing the appropriate
PBS Pro profile or logging out and back in.
For Bourne shell (or similar) run the following:
. /etc/profile.d/pbs.sh
For C shell (or similar) run the following:
source /etc/profile.d/pbs.csh
14. You should now be able to run PBS Pro commands to submit
and query jobs. Some examples follow.
bash$ qstat -B
Server Max Tot Que Run Hld Wat Trn Ext Status
---------------- ----- ----- ----- ----- ----- ----- ----- ----- -----------
host1 0 0 0 0 0 0 0 0 Active
bash$ pbsnodes -a
host1
Mom = host1
ntype = PBS
state = free
pcpus = 2
resources_available.arch = linux
resources_available.host = host1
resources_available.mem = 2049248kb
resources_available.ncpus = 2
resources_available.vnode = host1
resources_assigned.accelerator_memory = 0kb
resources_assigned.mem = 0kb
resources_assigned.naccelerators = 0
resources_assigned.ncpus = 0
resources_assigned.netwins = 0
resources_assigned.vmem = 0kb
resv_enable = True
sharing = default_shared
license = l
bash$ echo "sleep 60" | qsub
0.host1
[mike@host1 PBSPro_13.0.402.161242b]$ qstat -a
host1:
Req'd Req'd Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time
--------------- -------- -------- ---------- ------ --- --- ------ ----- - -----
0.host1 mike workq STDIN 2122 1 1 -- -- R 00:00
bash$
NOTES
- It is advisable to create a simple shell script that calls configure with the appropriate options so that you can save typing on reconfigures. If you have already run configure you can remake all of the Makefiles by running "./config.status". Also, looking at the first few lines of config.status will tell you the options that were set when configure was run.
- If you modify configure.ac or adjust timestamps on any files that are automatically generated, you will need to install the GNU autoconf and automake packages in order for configure to regenerate those files.
- You need to use a POSIX (or nearly POSIX) make. GNU make works quite well in this regard; BSD make does not. If you are having any sort of build problems, your make should be a prime suspect. Tremendous effort has been expended to provide proper dependency generation and makefiles without relying on any non-POSIX features. The build should work fine with a simple call to make, however, complicating things by using various make flags is not guaranteed to work. Don't be surprised if the first thing that make does is call configure again.
- The openSUSE rpm package expands %_libexecdir to /opt/pbs/lib rather than /opt/pbs/libexec which causes problems for the post-install scripts. Providing the --libexecdir value to configure overrides this behavior.