Fail to compile Torque 6.1.3 on Rocky 8.9

pbsD_connect.c:149:37: error: ‘PBS_DEFAULT_FILE’ was not declared in this scope; did you mean ‘PBS_DEFAULT_MAIL’?
149 | static const char *pbs_destn_file = PBS_DEFAULT_FILE;
| ^~~~~~~~~~~~~~~~

How to reslove it?

It might be best if you show the commands you used leading up to the error. My guess is that the symbol didn’t get defined at the configure stage.

Torque 6.1.3 package is in EPEL 7 and 9 but is missing from EPEL 8. Try building the latest Fedora package using Mock or use RL 9.3.

That is an error message from compiler. The syntax of the language requires that in

static const char *pbs_destn_file = PBS_DEFAULT_FILE;

the PBS_DEFAULT_FILE is an object that is implicitly convertible to char*. More likely is that PBS_DEFAULT_FILE is name of macro that preprocessor should have replaced with something, probably with a literal string constant. In this case hasn’t and therefore isn’t.

One could use something like grep -r PBS_DEFAULT_FILE on to find the text from files in the source tree and then figure out where the actual error occurs. However,

One should prefer managed packages over source installs. Ideally, the packages would be in trusted repository. EPEL is such. If they have had package for EL7, then it is appropriate to send them a request to build for EL8 (and EL9) too. That would benefit all Torque+EL users.

The second best is to rebuild “nearest” package source for EL8, like @ganphx did suggest.

There is an another approach though. Your error message is from compiler. Why do you compile? Because you want Torque binary? Why do you want Torque binary? You want to submit jobs to compute cluster with Torque commands?

What if you could use Torque commands on compute cluster that does not havce Torque? Would that be “close enough”? One way to do that is SLURM Slurm Workload Manager - Quick Start Administrator Guide
(The EPEL 8 does actually have pre-built SLURM packages, but they are rather old version by now.)

Actually, the OP would probably need to build 21 torque packages for RL 8 using Mock. I would suggest building the main package torque-6.1.3-8.el9.src.rpm first to see if there are any issues.