Added "conv-config.sh", which wraps "conv-mach.sh" and adds default
authorOrion Lawlor <olawlor@acm.org>
Fri, 21 Mar 2003 22:18:10 +0000 (22:18 +0000)
committerOrion Lawlor <olawlor@acm.org>
Fri, 21 Mar 2003 22:18:10 +0000 (22:18 +0000)
values and build-time options.

src/scripts/Makefile
src/scripts/charmc
src/scripts/conv-config.sh [new file with mode: 0644]

index 591f0da9879e6e0794aabb772b634a1749e0cdfe..707753d57f822c3b29e62e74fbf2f5cbb410f81a 100644 (file)
@@ -114,7 +114,7 @@ CVHEADERS=cpthreads.h converse.h conv-trace.h conv-random.h conv-qd.h queueing.h
       trace.h charm-api.h conv-ccs.h ccs-client.c ccs-client.h CcsServer.java\
       ccs-server.h ccs-auth.c ccs-auth.h \
       memory-isomalloc.h debug-conv.h debug-charm.h conv-autoconfig.h \
-      conv-common.h conv-mach.h conv-mach.sh \
+      conv-common.h conv-config.sh conv-config.h conv-mach.h conv-mach.sh \
       CkMarshall.decl.h CkArray.decl.h CkLocation.decl.h CkReduction.decl.h CkArrayReductionMgr.decl.h\
       CkFutures.decl.h LBDatabase.decl.h CentralLB.decl.h NullLB.decl.h CkCheckpoint.decl.h\
       RandCentLB.decl.h RecBisectBfLB.decl.h BaseLB.decl.h \
@@ -208,7 +208,7 @@ dirs+sources:
        chmod +x ../bin/charmc
        rm -f .gdir
        rm -rf ../include ; mkdir ../include
-       -./system_ln  ../tmp/conv-mach*.*h ../include
+       -./system_ln  ../tmp/conv-*.*h ../include
        -./system_ln  ../tmp/cc-*.*h ../include
        if [ ! -f conv-common.h ] ; then ( touch conv-common.h ) ; fi
        touch dirs+sources
@@ -261,7 +261,7 @@ fmain-ok: fmain.f90
        -@touch fmain-ok
 
 QuickThreads/libqt.a:
-       . ./conv-mach.sh;. ./conv-mach-opt.sh; cd QuickThreads;./configure $$CMK_QT
+       cd QuickThreads;./configure
        rm -f QuickThreads/libqt.a
        cd QuickThreads ; make qt  OPTS='$(OPTS)'
        cp QuickThreads/libqt.a ../lib/libckqt.a
index 16118a2d3470442b900d2c98211d7340f3e94d8b..eaf91d2a9edd67fa62b858b97f31d7214f3da3f3 100755 (executable)
@@ -572,35 +572,14 @@ Debugf "----------- Module dependency search complete ------------"
 #
 ##############################################################################
 
-# Load machine-specific defaults:
-CMK_C_OPTIMIZE="-O"
-CMK_CXX_OPTIMIZE="-O"
-CMK_F90_OPTIMIZE="-O"
-CMK_C_DEBUG="-g"
-CMK_CXX_DEBUG="-g"
-CMK_F90_DEBUG="-g"
-
-CMK_CF90_FIXED="none"
-
-if [ -r $CHARMINC/conv-mach-pre.sh ]
-then
-. $CHARMINC/conv-mach-pre.sh
-fi
-
-if [ ! -r $CHARMINC/conv-mach.sh ]
-then
-       Abort "Can't find conv-mach.sh in $CHARMINC directory."
-fi
 
 Debug "About to read machine config script"
-. $CHARMINC/conv-mach.sh
+Debug "Read config script, setting defaults..."
 
-if [ -r $CHARMINC/conv-mach-opt.sh ]
-then
-. $CHARMINC/conv-mach-opt.sh
-fi
+[ ! -r $CHARMINC/conv-config.sh ] && Abort "Cannot find conv-config.sh in $CHARMINC"
+. $CHARMINC/conv-config.sh $CHARMINC
 
-Debug "Read config script, setting vars..."
+Debug "Setting vars..."
 
 if [ -n "$USE_RELIABLE_CC" ]
 then
@@ -612,11 +591,6 @@ then
     CMK_CC="$CMK_CC_FASTEST"
 fi
 
-if [ "$CMK_CF90_FIXED" = "none" ]
-then
-   CMK_CF90_FIXED="$CMK_CF90"
-fi
-
 if [ -n "$CMK_F90_MODINC" ]
 then
     CMK_CF90_MODINC="$CMK_F90_MODINC"
@@ -634,16 +608,10 @@ then
     CMK_CC="$CMK_SEQ_CC -DCMK_SEQUENTIAL=1 "
     CMK_LD="$CMK_SEQ_LD"
     CMK_CXX="$CMK_SEQ_CXX -DCMK_SEQUENTIAL=1 " 
-    CMK_CF90="$CMK_SEQ_F90 -DCMK_SEQUENTIAL=1 
+    CMK_CF90="$CMK_SEQ_F90 " 
     CMK_LDXX="$CMK_SEQ_LDXX" 
-    if [ -n "$CMK_SEQ_AR" ]
-    then
-      CMK_AR="$CMK_SEQ_AR"
-    fi
-    if [ -n "$CMK_SEQ_RANLIB" ]
-    then
-      CMK_RANLIB="$CMK_SEQ_RANLIB"
-    fi
+    CMK_AR="$CMK_SEQ_AR"
+    CMK_RANLIB="$CMK_SEQ_RANLIB"
 fi
 
 if [ -n "$OVERRIDE_CC" ]
@@ -917,16 +885,62 @@ case "$OBJECT" in
        Copyobj
        ;;
 esac
-# If the above case returns, we're not creating a .o or .a file--
-# check if we're linking a sequential object
+# If the above case returns, we're not creating a .o or .a file,
+# so linking is needed.
+
+############ Determine the language and libraries ##########
+
+# Parse out the real languages
+case "$LANGUAGE" in
+"charm++f")
+       LANGUAGE="charm++"
+       USE_F90_LIBRARIES="1"
+       ;;
+"f90charm")
+        PRE_LIBRARIES="$PRE_LIBRARIES -lf90charm "
+        POST_LIBRARIES="$POST_LIBRARIES $CMK_F90LIBS"
+       ;;
+"bluegene")
+        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene"
+       ;;
+"ckbluegene")
+        POST_LIBRARIES="$POST_LIBRARIES -lbluegene"
+       ;;
+"bgcharm++")
+        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene"
+       ;;
+esac
+[ -r $CHARMLIB/libconv-utilf.a ] || USE_F90_LIBRARIES="0"
+
+if [ $USE_F90_LIBRARIES = "1" ]
+then
+       POST_LIBRARIES="$POST_LIBRARIES -lconv-utilf $CMK_F90LIBS"
+        if [ -z "$SEQUENTIAL" -a ! -z "$CMK_F90OBJS" ] 
+        then
+          for f90obj in $CMK_F90OBJS
+          do
+            OBJECTFILES="$OBJECTFILES $CHARMLIB/$f90obj"
+          done
+        fi
+fi
 
+# Add the modules to the link list
+LINK_MODULES=""
+for module in $MODULES; do
+    LINK_MODULES="$LINK_MODULES -lmodule$module"
+done
+PRE_LIBRARIES="$LINK_MODULES $PRE_LIBRARIES"
+
+# check if we're linking a sequential object
 case "$LANGUAGE" in
 "c"|"C"|"f90"|"f77")
-       Do $CMK_SEQ_LD $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
+       Do $CMK_SEQ_LD $OPTS_LD -o $OBJECT $OBJECTFILES \
+               -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
        Copyobj
        ;;
 "c++"|"C++")
-       Do $CMK_SEQ_LDXX $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
+       Do $CMK_SEQ_LDXX $OPTS_LD -o $OBJECT $OBJECTFILES \
+               -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
        Copyobj
        ;;
 esac
@@ -997,49 +1011,6 @@ MEM_OBJ="$CHARMLIB/libmemory-$MEMORY.o"
 
 [ ! -r $MEM_OBJ ] && Abort "charmc : No such memory mode $MEMORY"
 
-############ Determine the language and libraries ##########
-
-# Parse out the real languages
-case "$LANGUAGE" in
-"charm++f")
-       LANGUAGE="charm++"
-       USE_F90_LIBRARIES="1"
-       ;;
-"f90charm")
-        PRE_LIBRARIES="$PRE_LIBRARIES -lf90charm "
-        POST_LIBRARIES="$POST_LIBRARIES $CMK_F90LIBS"
-       ;;
-"bluegene")
-        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene"
-       ;;
-"ckbluegene")
-        POST_LIBRARIES="$POST_LIBRARIES -lbluegene"
-       ;;
-"bgcharm++")
-        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene"
-       ;;
-esac
-[ -r $CHARMLIB/libconv-utilf.a ] || USE_F90_LIBRARIES="0"
-
-if [ $USE_F90_LIBRARIES = "1" ]
-then
-       POST_LIBRARIES="$POST_LIBRARIES -lconv-utilf $CMK_F90LIBS"
-        if [ ! -z "$CMK_F90OBJS" ] 
-        then
-          for f90obj in $CMK_F90OBJS
-          do
-            OBJECTFILES="$OBJECTFILES $CHARMLIB/$f90obj"
-          done
-        fi
-fi
-
-# Add the modules to the link list
-LINK_MODULES=""
-for module in $MODULES; do
-    LINK_MODULES="$LINK_MODULES -lmodule$module"
-done
-PRE_LIBRARIES="$LINK_MODULES $PRE_LIBRARIES"
-
 ################# Build the module initialization function ##################
 modInitName="moduleinit"
 modInitSrc="$modInitName.C"
diff --git a/src/scripts/conv-config.sh b/src/scripts/conv-config.sh
new file mode 100644 (file)
index 0000000..b1f47e1
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# Generic converse configuration script:
+#   Reads various configuration scripts and sets defaults.
+
+if [ -z "$CHARMINC" ]
+then
+       echo "conv-config.sh: CHARMINC must point to the charm include dir"
+       exit 1
+fi
+
+if [ -r $CHARMINC/conv-mach-pre.sh ]
+then
+. $CHARMINC/conv-mach-pre.sh
+fi
+
+if [ ! -r $CHARMINC/conv-mach.sh ]
+then
+       echo "Can't find conv-mach.sh in $CHARMINC directory."
+       exit 1
+fi
+
+. $CHARMINC/conv-mach.sh
+
+[ -z "$CMK_C_OPTIMIZE" ] && CMK_C_OPTIMIZE="-O"
+[ -z "$CMK_C_DEBUG" ] && CMK_C_DEBUG="-g"
+[ -z "$CMK_CXX_OPTIMIZE" ] && CMK_CXX_OPTIMIZE="$CMK_C_OPTIMIZE"
+[ -z "$CMK_CXX_DEBUG" ] && CMK_CXX_DEBUG="$CMK_C_DEBUG"
+[ -z "$CMK_F90_OPTIMIZE" ] && CMK_F90_OPTIMIZE="-O"
+[ -z "$CMK_F90_DEBUG" ] && CMK_F90_DEBUG="-O"
+
+[ -z "$CMK_CC" ] && CMK_CC='cc '
+[ -z "$CMK_CXX" ] && CMK_CXX='c++ '
+[ -z "$CMK_SUF" ] && CMK_SUF='o'
+[ -z "$CMK_AR" ] && CMK_AR='ar q'
+[ -z "$CMK_QT" ] && CMK_QT='generic'
+[ -z "$CMK_LD" ] && CMK_LD="$CMK_CC"
+[ -z "$CMK_LDXX" ] && CMK_LDXX="$CMK_CXX"
+
+[ -z "$CMK_CF90_FIXED" ] && CMK_CF90_FIXED="$CMK_CF90"
+[ -z "$CMK_CC_RELIABLE" ] && CMK_CC_RELIABLE="$CMK_CC"
+[ -z "$CMK_CC_FASTEST" ] && CMK_CC_FASTEST="$CMK_CC"
+[ -z "$CMK_CC_RELIABLE" ] && CMK_CC_RELIABLE="$CMK_CC"
+[ -z "$CMK_SEQ_CC" ] && CMK_SEQ_CC="$CMK_CC"
+[ -z "$CMK_SEQ_CXX" ] && CMK_SEQ_CXX="$CMK_CXX"
+[ -z "$CMK_SEQ_LD" ] && CMK_SEQ_LD="$CMK_LD"
+[ -z "$CMK_SEQ_LDXX" ] && CMK_SEQ_LDXX="$CMK_LDXX"
+[ -z "$CMK_SEQ_F90" ] && CMK_SEQ_F90="$CMK_CF90"
+[ -z "$CMK_SEQ_AR" ] && CMK_SEQ_AR="$CMK_AR"
+[ -z "$CMK_SEQ_RANLIB" ] && CMK_SEQ_RANLIB="$CMK_RANLIB"
+
+if [ -r $CHARMINC/conv-mach-opt.sh ]
+then
+. $CHARMINC/conv-mach-opt.sh
+fi
+