On Fri, 28 May 2010, David Chin wrote:
On Wed, Apr 28, 2010 at 12:11, andy thomas <[email protected]> wrote:
I am trying to build maui-3.2.6p21 on a 64-bit AMD K8 system running
FreeBSD 7.1. After first installing the GNU version of sed in
/usr/local/bin to get around a limitation of FreeBSD sed (see
http://www.clusterresources.com/pipermail/mauiusers/2006-February/002037.html),
I've managed to successfully run the configure script to create the
makefiles although there is one warning message:
configure: WARNING: Unsupported OS: FreeBSD, attempting build with OPSYS=__LINUX
But when I try to build it with gmake, I get the following error:
gmake[1]: Entering directory `/export/home/andy/maui-3.2.6p21/src/server'
gcc -I../../include -I../../include -I/usr/local/include -D__LINUX
-D__MPBS -g -O2 -D__M64 -c Server.c
In file included from Server.c:84:
OServer.c: In function 'ServerDemonize':
OServer.c:182: error: too few arguments to function 'setpgrp'
gmake[1]: *** [Server.o] Error 1
gmake[1]: Leaving directory `/export/home/andy/maui-3.2.6p21/src/server'
gmake: *** [all] Error 2
Should I be forcing OPSYS to __FREEBSD?
Hi Andy,
A bit off-topic, but there is a 64-bit issue with maui-3.2.6p21.
It's fixed in 3.3. You will find the issue if you have more than
a total of 31 PBS node properties (Maui calls them features).
It's because 3.2.6p21 assumes an int on x86_64 is larger than it
really is. A colleague and I discovered this when we found that
requesting a nodes with a particular feature did not work.
Back to your question, setpgrp is different for Linux (SysV'ish)
and FreeBSD.
Linux:
http://linuxmanpages.com/man2/setpgrp.2.php
int setpgrp(void);
FreeBSD:
http://www.freebsd.org/cgi/man.cgi?query=setpgrp&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html
int setpgrp(pid_t pid, pid_t pgrp);
On gcc-3.4.6, /usr/include/unistd has this to say:
Both System V and BSD have `setpgrp' functions, but with different
calling conventions. The BSD function is the same as POSIX.1 `setpgid'
(above). The System V function takes no arguments and puts the calling
process in its on group like `setpgid (0, 0)'.
New programs should always use `setpgid' instead.
The default in GNU is to provide the System V function. The BSD
function is available under -D_BSD_SOURCE.
Anyway, src/server/OServer.c has this:
#if defined(__OSF) || defined(__FREEBSD)
if (setpgrp((pid_t)0,(pid_t)0) == -1)
#else /* __OSF */
if (setpgrp() == -1)
#endif /* __OSF */
i.e. you do want to make OPSYS=__FREEBSD
I would have thought the configure script would handle it, but looking
through it, it doesn't seem to do so. Doing a recursive grep in the source
directory also shows that __FREEBSD is not set anywhere else, though there
are macros in the source which check for __FREEBSD and make appropriate
function calls.
The easy way to fix it is to edit config.stat, and then do "sh config.stat",
then run make. It doesn't look like the "OS" macro is used, but can't hurt
fixing it, too:
s,@OPSYS@,__FREEBSD,;t t
s,@OS@,FreeBSD,;t t
Alternatively, you could fix the configure script to handle FreeBSD so
you won't have to edit config.stat every time you rebuild.
This is what I did in the end with the following three lines inserted
between the OSF1 and Linux o/s type tests:
elif test "$OS" = "FreeBSD"; then
OPSYS="__FREEBSD"
OS="FreeBSD"
After that it compiled & installed with no problems.
cheers, Andy
----------------------------
Andy Thomas,
UNIX/Linux support,
Faculty of Natural Sciences,
Imperial College London.
UK_______________________________________________
mauiusers mailing list
[email protected]
http://www.supercluster.org/mailman/listinfo/mauiusers