[torqueusers] maui configure fix

garrick at speculation.org garrick at speculation.org
Mon Jun 19 16:37:37 MDT 2006


Turns out maui isn't working with torque's new buildsystem correctly.  I'm
attaching 2 patches: the first fixes --with-pbs in configure.ac and a
linking order (corrects linking problems with static libs), and the
second patches the generated configure script.

Apply the first patch, and run autoconf.  If you don't have autoconf
installed, install the second patch.  Sorry for the complication of the
second step but it will keep timestamps correct.

I'm waiting for feedback before committing to CVS and requesting a new
patch release.

-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /usr/local/nfs/src/cvs_repository/maui/configure.ac,v
retrieving revision 1.5
diff -u -r1.5 configure.ac
--- configure.ac	23 May 2006 19:53:52 -0000	1.5
+++ configure.ac	19 Jun 2006 22:32:05 -0000
@@ -140,6 +140,14 @@
 		else
 			PBSTARGETDIR='/usr/local';
 		fi
+	elif test -f "$PBSTARGETDIR/bin/pbs-config"; then
+		PBSTARGETDIR=`$PBSTARGETDIR/bin/pbs-config --prefix`
+	elif test -f "$PBSTARGETDIR/pbs-config"; then
+		PBSTARGETDIR=`$PBSTARGETDIR/pbs-config --prefix`
+	elif test -f "$PBSTARGETDIR"; then
+		PBSTARGETDIR=`$PBSTARGETDIR --prefix`
+	else
+		PBSTARGETDIR='/usr/local';
 	fi
 	if test "$RMTYPE" = ''; then
 		RMTYPE=PBS
@@ -149,13 +157,7 @@
 	else
 		AC_MSG_ERROR([Only one Resource Manager can be specified (PBS, $RMTYPE)])
 	fi
-	if test "$OS" = "OSF"; then
-		PBSLIBS="$PBSTARGETDIR/ilib/libnet.a -lpbs"
-	else
-		PBSLIBS="-lnet -lpbs"
-	fi
 	AC_SUBST(PBSTARGETDIR)
-	AC_SUBST(PBSLIBS)
 	AC_SUBST_FILE(pbs_definitions)
 	pbs_definitions=include/Makefile.inc.pbs
 fi
@@ -312,7 +314,9 @@
        else
                PBSTARGETDIR='/usr/local';
        fi
- 
+fi
+
+if test "$RMTYPE" = "PBS" ;then
        if $PBSTARGETDIR/bin/pbs-config --cflags 1>/dev/null 2>&1;then
                PBSCFLAGS=`$PBSTARGETDIR/bin/pbs-config --cflags`
        else
@@ -320,8 +324,14 @@
        fi
        if $PBSTARGETDIR/bin/pbs-config --libs 1>/dev/null 2>&1;then
                PBSLDFLAGS=`$PBSTARGETDIR/bin/pbs-config --libs`
+       elif test -f $PBSTARGETDIR/lib/libpbs.a ;then
+	       if test "$OS" = "OSF"; then
+		       PBSLIBS="$PBSTARGETDIR/ilib/libnet.a -L$PBSTARGETDIR/lib -lpbs"
+	       else
+		       PBSLIBS="-L$PBSTARGETDIR/lib -lnet -lpbs"
+	       fi
        else
-               PBSLDFLAGS="-L$PBSTARGETDIR/lib -lnet -lpbs"
+               AC_MSG_ERROR([can't find pbs-config or libnet.a])
        fi
        AC_SUBST(PBSCFLAGS)
        AC_SUBST(PBSLDFLAGS)
Index: src/server/Makefile
===================================================================
RCS file: /usr/local/nfs/src/cvs_repository/maui/src/server/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- src/server/Makefile	23 May 2006 19:39:40 -0000	1.5
+++ src/server/Makefile	19 Jun 2006 22:32:05 -0000
@@ -88,11 +88,11 @@
 	$(CC) $(IP) $(DEFS) $(CFLAGS) $(SOURCE) -c $<
 
 $(SERVER): $(SOBJECTS)
-	$(LD) $(SOBJECTS) -o $(BIN)/$@ $(LP) $(LIBS) $(OSLDFLAGS) 
+	$(LD) $(SOBJECTS) -o $(BIN)/$@ $(LIBS) $(OSLDFLAGS) $(LP)
 	chmod 711 $(BIN)/$@ || true
 
 mclient: mclient.o
-	$(LD) mclient.o -o $(BIN)/$@ $(OSLDFLAGS) $(LP) $(LIBS)     
+	$(LD) mclient.o -o $(BIN)/$@ $(OSLDFLAGS) $(LIBS)    $(LP) 
 	chmod 751 $(BIN)/$@
 	for i in $(MCLIENTS); do \
 	  ln -f $(BIN)/$@ $(BIN)/$$i; \
@@ -100,7 +100,7 @@
 	done
 
 mprof:  $(POBJECTS)
-	$(LD) $(POBJECTS) -o $(BIN)/$@ $(OSLDFLAGS) $(LP) $(LIBS)     
+	$(LD) $(POBJECTS) -o $(BIN)/$@ $(OSLDFLAGS) $(LIBS)     $(LP)
 	chmod 751 $(BIN)/$@
 
 clean:
-------------- next part --------------
Index: configure
===================================================================
RCS file: /usr/local/nfs/src/cvs_repository/maui/configure,v
retrieving revision 1.6
diff -u -r1.6 configure
--- configure	23 May 2006 19:53:52 -0000	1.6
+++ configure	19 Jun 2006 22:30:45 -0000
@@ -311,7 +311,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LN_S SPOOLDIR MACHINE SEED OPSYS OS HOSTNAME USER BUILDDATE BUILDDIR RMTYPE LLDIR LLDEF PBSTARGETDIR PBSLIBS SGEBUILDDIR SGEOSDIR LSFDIR LSFLIBS LSFDEFS PBSCFLAGS PBSLDFLAGS RMPORT RMHOST RMSOCKETPROTOCOL RMWIREPROTOCOL RMVERSION RMNMPORT RMNMSERVER AMTYPE AMHOST AMPORT AMSOCKETPROTOCOL AMWIREPROTOCOL AMOTHER PCREDIR CPP EGREP LIBOBJS POW_LIB LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LN_S SPOOLDIR MACHINE SEED OPSYS OS HOSTNAME USER BUILDDATE BUILDDIR RMTYPE LLDIR LLDEF PBSTARGETDIR SGEBUILDDIR SGEOSDIR LSFDIR LSFLIBS LSFDEFS PBSCFLAGS PBSLDFLAGS RMPORT RMHOST RMSOCKETPROTOCOL RMWIREPROTOCOL RMVERSION RMNMPORT RMNMSERVER AMTYPE AMHOST AMPORT AMSOCKETPROTOCOL AMWIREPROTOCOL AMOTHER PCREDIR CPP EGREP LIBOBJS POW_LIB LTLIBOBJS'
 ac_subst_files='rm_config ll_definitions sdr_definitions pbs_definitions sge_definitions lsf_definitions mx_definitions pcre_definitions'
 
 # Initialize some variables set by options.
@@ -2340,6 +2340,14 @@
 		else
 			PBSTARGETDIR='/usr/local';
 		fi
+	elif test -f "$PBSTARGETDIR/bin/pbs-config"; then
+		PBSTARGETDIR=`$PBSTARGETDIR/bin/pbs-config --prefix`
+	elif test -f "$PBSTARGETDIR/pbs-config"; then
+		PBSTARGETDIR=`$PBSTARGETDIR/pbs-config --prefix`
+	elif test -f "$PBSTARGETDIR"; then
+		PBSTARGETDIR=`$PBSTARGETDIR --prefix`
+	else
+		PBSTARGETDIR='/usr/local';
 	fi
 	if test "$RMTYPE" = ''; then
 		RMTYPE=PBS
@@ -2351,12 +2359,6 @@
 echo "$as_me: error: Only one Resource Manager can be specified (PBS, $RMTYPE)" >&2;}
    { (exit 1); exit 1; }; }
 	fi
-	if test "$OS" = "OSF"; then
-		PBSLIBS="$PBSTARGETDIR/ilib/libnet.a -lpbs"
-	else
-		PBSLIBS="-lnet -lpbs"
-	fi
-
 
 
 	pbs_definitions=include/Makefile.inc.pbs
@@ -2551,7 +2553,9 @@
        else
                PBSTARGETDIR='/usr/local';
        fi
+fi
 
+if test "$RMTYPE" = "PBS" ;then
        if $PBSTARGETDIR/bin/pbs-config --cflags 1>/dev/null 2>&1;then
                PBSCFLAGS=`$PBSTARGETDIR/bin/pbs-config --cflags`
        else
@@ -2559,8 +2563,16 @@
        fi
        if $PBSTARGETDIR/bin/pbs-config --libs 1>/dev/null 2>&1;then
                PBSLDFLAGS=`$PBSTARGETDIR/bin/pbs-config --libs`
+       elif test -f $PBSTARGETDIR/lib/libpbs.a ;then
+	       if test "$OS" = "OSF"; then
+		       PBSLIBS="$PBSTARGETDIR/ilib/libnet.a -L$PBSTARGETDIR/lib -lpbs"
+	       else
+		       PBSLIBS="-L$PBSTARGETDIR/lib -lnet -lpbs"
+	       fi
        else
-               PBSLDFLAGS="-L$PBSTARGETDIR/lib -lnet -lpbs"
+               { { echo "$as_me:$LINENO: error: can't find pbs-config or libnet.a" >&5
+echo "$as_me: error: can't find pbs-config or libnet.a" >&2;}
+   { (exit 1); exit 1; }; }
        fi
 
 
@@ -7194,7 +7206,6 @@
 s, at LLDIR@,$LLDIR,;t t
 s, at LLDEF@,$LLDEF,;t t
 s, at PBSTARGETDIR@,$PBSTARGETDIR,;t t
-s, at PBSLIBS@,$PBSLIBS,;t t
 s, at SGEBUILDDIR@,$SGEBUILDDIR,;t t
 s, at SGEOSDIR@,$SGEOSDIR,;t t
 s, at LSFDIR@,$LSFDIR,;t t


More information about the torqueusers mailing list