Bug 74 - Building FreeBSD fails
: Building FreeBSD fails
Status: RESOLVED FIXED
Product: TORQUE
pbs_server
: 2.5.x
: Other Other
: P5 enhancement
Assigned To: Glen
:
:
:
  Show dependency treegraph
 
Reported: 2010-07-23 13:03 MDT by Andrew Fitz Gibbon
Modified: 2010-07-23 18:56 MDT (History)
2 users (show)

See Also:


Attachments
Full output of build attempt (322.95 KB, application/octet-stream)
2010-07-23 13:03 MDT, Andrew Fitz Gibbon
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description Andrew Fitz Gibbon 2010-07-23 13:03:22 MDT
Created an attachment (id=44) [details]
Full output of build attempt

Full output of configure/make attached.

Same results with no configure options.

Reproducible with 2.5.0, 2.5.1, and 2.5.2-snap.201007221545

--enable-unixsockets also results in build failure.

$ uname -rsp
FreeBSD 7.0-RELEASE-p5 i386
$ gcc --version
gcc (GCC) 4.2.1 20070719  [FreeBSD]
*snip*
$ ./configure --disable-privports --disable-gcc-warnings && gmake
*snip*
if gcc -DHAVE_CONFIG_H -I. -I. -I../../src/include  -I../../src/include  
-DPBS_SERVER_HOME=\"/var/spool/torque\"
-DPBS_ENVIRON=\"/var/spool/torque/pbs_environment\" -g -O2 -MT node_manager.o
-MD -MP -MF ".deps/node_manager.Tpo" -c -o node_manager.o node_manager.c;  then
mv -f ".deps/node_manager.Tpo" ".deps/node_manager.Po"; else rm -f
".deps/node_manager.Tpo"; exit 1; fi
node_manager.c: In function 'is_request':
node_manager.c:1933: error: 'AF_INET' undeclared (first use in this function)
node_manager.c:1933: error: (Each undeclared identifier is reported only once
node_manager.c:1933: error: for each function it appears in.)
*** Error code 1

Stop in /cluster/home/fitzgan/software/torque-2.5.1/src/server.
*** Error code 1

Stop in /cluster/home/fitzgan/software/torque-2.5.1/src.
gmake: *** [all-recursive] Error 1

$ ./configure --disable-privports --disable-gcc-warnings --enable-unixsockets
&& gmake
*snip*
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../src/include -I../../../src/include
-I../../../src/lib/Libdis -DIFF_PATH=\"/usr/local/sbin/pbs_iff\"
-DPBS_DEFAULT_FILE=\"/var/spool/torque/server_name\" -g -O2 -MT pbsD_connect.lo
-MD -MP -MF .deps/pbsD_connect.Tpo -c ../Libifl/pbsD_connect.c  -fPIC -DPIC -o
.libs/pbsD_connect.o
../Libifl/pbsD_connect.c: In function 'send_unix_creds':
../Libifl/pbsD_connect.c:512: error: invalid application of 'sizeof' to
incomplete type 'struct ucred' 
../Libifl/pbsD_connect.c:527: error: invalid application of 'sizeof' to
incomplete type 'struct ucred' 
../Libifl/pbsD_connect.c:529: error: dereferencing pointer to incomplete type
../Libifl/pbsD_connect.c:530: error: dereferencing pointer to incomplete type
*** Error code 1

Stop in
/cluster/home/fitzgan/software/torque-2.5.2-snap.201007221545/src/lib/Libpbs.
*** Error code 1

Stop in /cluster/home/fitzgan/software/torque-2.5.2-snap.201007221545/src/lib.
*** Error code 1

Stop in /cluster/home/fitzgan/software/torque-2.5.2-snap.201007221545/src.
Comment 1 Garrick Staples 2010-07-23 16:48:34 MDT
I think this will fix the first problem.

$ svn diff src/server/node_manager.c 
Index: src/server/node_manager.c
===================================================================
--- src/server/node_manager.c   (revision 3917)
+++ src/server/node_manager.c   (working copy)
@@ -91,6 +91,7 @@
 #include <netinet/in.h>
 #include <stdarg.h>
 #include <assert.h>
+#include <sys/socket.h>
 #if defined(NTOHL_NEEDS_ARPA_INET_H) && defined(HAVE_ARPA_INET_H)
 #include <arpa/inet.h>
 #endif
@@ -1930,7 +1931,7 @@
     else if (allow_any_mom)                                           
       {                                                               
         {                                                             
-          hp = gethostbyaddr(&ipaddr, sizeof(ipaddr), AF_INET);       
+          hp = gethostbyaddr((void *)&ipaddr, sizeof(ipaddr), AF_INET);       
           if(hp != NULL)                                              
             {                                                         
             strncpy(nodename, hp->h_name, PBS_MAXHOSTNAME);
Comment 2 Garrick Staples 2010-07-23 18:53:13 MDT
Regarding unixsocket support... the default is to be enabled if it seems to be
working. configure had already detected that unixsocket support wasn't going to
work and you attempting to override that. In this case, it doesn't work because
of some specific problem with ucred.h.
Comment 3 Garrick Staples 2010-07-23 18:56:58 MDT
Closing out bug