2 ##############################################################################
3 # charmc: Compiler for Converse/Charm/Charm++ programs
5 # Converted to Bourne Shell by Orion Sky Lawlor, 10/21/1999
7 # Initialize the main controlling variables, setup error handler
8 # ALL variables used by this script should be initialized here.
10 ##############################################################################
12 #Prepare aliases for the external commands we use--
13 # Note that adding /bin/ to everything breaks Cygwin32.
40 #Generic options, passed to everything
43 #charm internal flag, only pass to c and cxx, not f90
44 OPTS_CPP_INTERNAL
="-D__CHARMC__=1 "
59 EXPLICIT_COMPILATION
="no"
99 ####################################################################
101 # Utility routines used below
103 ###################################################################
105 # PrintUsage: prints a helpful command-line usage message and quits
106 # Args: any additional messages
110 echo "Usage: charmc [ flags ] <files>"
113 echo " -o <target> -g -O"
114 echo " -D<define> -I<include path> -L<lib path> -l<library> -s"
115 echo " -machine <mach> -seq -host -language <lang> "
116 echo " -balance <mode> -tracemode <mode> -memory <mode>"
117 echo " -modules <comma-separated list of C++ modules>"
118 echo " -verbose -save -purify -cp <dest> -gen-cpm <package>"
119 echo " -use-reliable-cc -use-fastest-cc"
120 echo " -cc <new cc> -c++ <new CC> -ld <new ld> -ld++ <new LD>"
121 echo " -cpp-option <opt> -ldro-option <opt> -cc-option <opt>"
122 echo " -c++-option <opt> -ld-option <opt> -ld++-option <opt>"
123 echo " -fmoddir <f90mod path>"
124 echo " -pg <opt> -build-shared -charm-shared -no-trace-mpi"
126 echo " Cell specific flags:"
127 echo " -spu-cpp -spu-lib <libname>"
129 echo " Charmc compiles C, C++, f77, f90, Converse, Converse++, Charm, "
130 echo "and Charm++ programs. The flags generally match those of cc or f77."
131 echo "Version 5.0, Parallel Programming Lab, UIUC, 1999"
136 # End blows away the temporary files (unless SAVE is true) and exits
141 for FILE
in `echo $FILES`
143 #BASE=`stripExtention $FILE`
144 TMP
=`basename $FILE`".TMP"
145 $RM $TMP.P.C
$TMP.cpp
$TMP.space
$TMP.xlat
$TMP.o
146 $RM $TMP.c
$TMP.c
.0.h
$TMP.c
.1.h
$TMP.c
.2.h
147 $RM $TMP.i
$TMP.
$CMK_CPP_SUFFIX
150 if test -n "$modInitObj"
152 [ -n "$VERBOSE" ] && echo $RM $modInitSrc $modInitObj
153 DoNoErrCheck
$RM $modInitSrc $modInitObj > /dev
/null
2>&1
159 # Write this error message to stderr
160 # ("1>&2" redirects the echo output to stderr).
165 # This procedure prints an error message and exits.
166 # Args: written to stderr
168 Warning
"Fatal Error by charmc in directory "`pwd`
170 Warning
"charmc exiting..."
175 # Instead of an ECHO_CMD variable, I define a procedure Do,
176 # which (possibly) echos, runs, and tests the errors of the given command.
177 # Args: executed as given
179 [ -n "$VERBOSE" ] && echo "charmc: Executing $@" 1>&2
186 # The UNIX result code better be zero, or we die
187 [ $Do_res -eq 0 ] || Abort
"Command $@ returned error code $Do_res"
190 # This procedure removes the extention (the ".c" in "./main.c") from
191 # its first argument, and prints the result. Unlike the builtin command
192 # basename, it keeps the directory path.
193 # Args: <name to strip>
195 se_base
=`basename $1`
196 # se_base=`echo $1 | awk -F/ '{print $NF}'`
197 se_strip
=`echo $se_base | awk -F. '{ORS="";print $1;for (i=2;i<NF;i++) print "."$i}'`
198 se_ret
=`echo $1 | awk -F/ '{ORS="";for (i=1;i<NF;i++) print $i"/"}'`"$se_strip"
202 # GetExtention returns the extention on the given file name
203 # or "" if none. (e.g. "./bob/snack.c" returns ".c")
204 # Args: <name to find extention of>
206 # se_base=`echo $1 | awk -F/ '{print $NF}'`
207 # se_ret=`echo $se_base | awk -F. '{if (NF<=1) print ""; else print "."$NF}'`
209 se_ret
=`echo $1 | sed -e 's/.*\././'`
210 if test "$se_ret" = $1
219 [ -n "$VERBOSE" ] && echo "charmc>" $@
223 if [ -n "$DEBUG_SCRIPT" ]
226 echo "------- Charmc Debugging info: $* -------"
227 echo "CHARMBIN=$CHARMBIN"
228 echo "CHARMINC=$CHARMINC"
229 echo "CHARMLIB=$CHARMLIB"
231 echo "DELETE=$DELETE"
232 echo "OBJECT=$OBJECT"
233 echo "LANGUAGE=$LANGUAGE"
234 # echo "Working directory="`pwd`
238 # Return success if $1 is not in any of the other arguments
244 if [ "$search" = "$1" ]
246 # It's already in there-- fail
251 # It's missing--succeed
255 # Add arguments to our modules list, avoiding duplicates
259 notInList
$M $MODULES && MODULES
="$MODULES $M"
263 # Add this word to this list, avoiding duplicates
268 notInList
$M $ret && ret
="$ret $M"
273 # Append the last word to this list, avoiding duplicates
274 # the difference to previous AddList() is that when duplication happens,
275 # only keep the last one, instead of keeping the first one as in AddList()
276 # this helps to solve the multiple -lfoo in the link command.
283 if notInList
$search $@
294 # TEMP_BASE is appended with this script's process ID (PID),
295 # so multiple charmcs can run in parallel without overwriting
296 # each other's temporary files.
297 TEMP_BASE
="/tmp/charmc_tmp.$$"
299 # Try to find CHARMBIN by looking in directory where charmc is
301 if [ -z "$CHARMBIN" ]
304 CHARMBIN
=`dirname $SCRIPT`
305 # CHARMBIN=`cd $CHARMBIN; pwd`
306 # NOTE: this script no longer tries to follow soft links
307 # to find the "original" charmc-- if this is bad,
308 # translate these lines to Bourne shell from C shell:
309 # -------------------- Begin C Shell ------------------------->
310 # if ($SCRIPT:h != $SCRIPT:t) then
312 # set SCRIPT=$SCRIPT:t
314 # foreach dir ($path)
315 # if (-x $dir/$SCRIPT && ! -d $dir/$SCRIPT) then
321 # while (x`find $SCRIPT -type l -print` == x$SCRIPT)
322 # set SCRIPT=`ls -al ./$SCRIPT:t | sed -e "s@.*-> @@"`
323 # if ($SCRIPT:h != $SCRIPT:t) then
325 # set SCRIPT=$SCRIPT:t
329 # <------------------ End C Shell -----------------------------
336 version
=`cat $CHARMBIN/../include/VERSION`
337 echo Charm
++ Version
$version
341 ##############################################################################
343 # The following section identifies CHARMBIN, the charm binary-directory.
345 ##############################################################################
349 # Try to find CHARMBIN by looking in directory where charmc is
354 FIRST_THREE
=`uname -s | awk '{print substr($1,1,3)}' `
355 if [ "$FIRST_THREE" = "CYG" -o "$UNAME" = "Interix" ]
357 # Running on a windows system-- append .exe to file names
361 CHARMLIB
="$CHARMBIN/../lib"
362 CHARMINC
="$CHARMBIN/../include"
364 if test -d "$CHARMBIN/../lib_so"
366 CHARMLIBSO
=`cd $CHARMBIN/../lib_so 2>/dev/null && pwd`
367 #getting absolute path is harder than thought because of symbolic links and ..
368 #ksh needs cd -P to resolve werid symbolic links, however -P is not portable
369 #csh is ok too if it exists
370 test -z "$CHARMLIBSO" && CHARMLIBSO
=`cd -P $CHARMBIN/../lib_so 2>/dev/null && pwd`
371 test -z "$CHARMLIBSO" && CHARMLIBSO
=`csh -c "cd $CHARMBIN/../lib_so >& /dev/null && pwd"`
372 test -z "$CHARMLIBSO" && echo "$CHARMBIN/../lib_so: not found" && exit 1
375 ##############################################################################
377 # Parse the arguments
379 # Don't do any analysis in here, just the parsing.
381 ##############################################################################
383 [ $# -eq 0 ] && printUsage
"Error: No arguments given."
411 # Parse out some fake languages (that are actually modules)
413 "ampi") AddModules tcharmmain ampi
;;
414 "ampif") AddModules tcharmmain ampif
; USE_F90_LIBRARIES
="1" ;;
415 "armci") AddModules tcharmmain armci
;;
416 "armcif") AddModules tcharmmain armci
; USE_F90_LIBRARIES
="1" ;;
417 "fem") AddModules tcharmmain fem
; AMPIMAIN
="femmain";;
418 "femf") AddModules tcharmmain fem
; AMPIMAIN
="femmain"; USE_F90_LIBRARIES
="1" ;;
419 "ParFUM_TOPS") AddModules tcharmmain ParFUM ParFUM_TOPS
; AMPIMAIN
="ParFUMmain";;
420 "ParFUM") AddModules tcharmmain ParFUM
; AMPIMAIN
="ParFUMmain";;
421 "ParFUMf") AddModules tcharmmain ParFUM
; AMPIMAIN
="ParFUMmain"; USE_F90_LIBRARIES
="1" ;;
422 "mblock") AddModules tcharmmain mblock
;;
423 "mblockf") AddModules tcharmmain mblock
; USE_F90_LIBRARIES
="1" ;;
433 # Requested support from charmdebug: add some modules and libraries
438 "-module"|
"-modules")
439 AddModules
`echo $1 | sed -e 's/,/ /g'`
444 # test -n "$BALANCER" && Abort "More than one -balancer specified!"
445 BALANCER
="$BALANCER $1"
446 mod
=`echo $1| sed -e 's/:/ /' -e 's/,/ /g'`
457 Warning
"Warning: -queue currently being ignored."
472 TRACEMODE_NEW
=`AddList $TRACEMODE $1`
473 if [ "$TRACEMODE_NEW" = "$TRACEMODE" ]
475 Warning
"Warning: Duplicate tracemode $1 ignored"
477 TRACEMODE
=$TRACEMODE_NEW
485 "-swapglobal"|
"-swapglobals")
490 "-copyglobal"|
"-copyglobals")
495 "-tlsglobal"|
"-tlsglobals")
497 OPTS_CC
="$OPTS_CC -mno-tls-direct-seg-refs"
498 OPTS_CXX
="$OPTS_CXX -mno-tls-direct-seg-refs"
499 OPTS_F90
="$OPTS_F90 -mno-tls-direct-seg-refs"
500 OPTS_LD
="$OPTS_LD -static -Wl,--allow-multiple-definition"
501 OPTS_LDXX
="$OPTS_LDXX -static -Wl,--allow-multiple-definition"
505 echo "Verbose mode set"
514 SPU_EXTRA_LIBS
="$SPU_EXTRA_LIBS -l$1"
523 echo "Will give excessive charmc debugging output..."
569 OPTS_CPP
="$OPTS_CPP $1"
574 OPTS_LDRO
="$OPTS_LDRO $1"
579 OPTS_CC
="$OPTS_CC $1"
584 OPTS_CXX
="$OPTS_CXX $1"
589 OPTS_F90
="$OPTS_F90 $1"
594 OPTS_LD
="$OPTS_LD $1"
599 OPTS_LDXX
="$OPTS_LDXX $1"
604 OPTS_LDXX
="$OPTS_LDXX -rpath $1"
608 "-fortran"|
"-flib"|
"-flibs")
609 USE_F90_LIBRARIES
="1"
614 "-fortran77"|
"-f77lib"|
"-f77libs")
615 USE_F77_LIBRARIES
="1"
618 # Run preprocessor only
624 # Run preprocessor as an extra step, continue after preprocessing
628 # Run preprocessor/assembler only
638 if [ "$EXPLICIT_OBJECT $EXPLICIT_COMPILATION" = "no no" ]
644 if [ "$EXPLICIT_OBJECT" = "no" ]
648 EXPLICIT_COMPILATION
="yes"
652 EXPLICIT_OBJECT
="yes"
663 MODCOPIES
="$1 $MODCOPIES"
673 OPTS_CPP
="$OPTS_CPP -I$1"
678 if echo "$arg" |
grep ' ' > /dev
/null
2>/dev
/null
680 OPTS_CPP
="$OPTS_CPP "\"$arg\"
682 OPTS_CPP
="$OPTS_CPP $arg"
687 Warning
"passing unrecognized option $arg to all compilers and linkers"
694 OPTS_LD
="$OPTS_LD $arg"
700 # used internally when building Charm++ to create lib_so
704 # used internally not to build Charm++ lib_so
719 PRODUCTION_MODE
=false
727 F90_MODDIR
="$F90_MODDIR $1"
732 if [ -n "$POST_LANGUAGE" ]
734 POST_LIBRARIES
=`AppendList $POST_LIBRARIES $arg`
736 PRE_LIBRARIES
=`AppendList $PRE_LIBRARIES $arg`
741 OPTS_LD
="$OPTS_LD $arg"
759 # Warning "passing unrecognized option $arg to all compilers and linkers"
763 [ -n "$VERBOSE" ] && echo "Adding file $arg..."
768 # printUsage "Error: Unrecognized argument $arg"
769 # Warning "passing unrecognized option $arg to all compilers and linkers"
778 # Process original command-line arguments
779 eval processArgs
"$@"
782 ##############################################################################
784 # Load module dependencies.
786 ##############################################################################
788 Debug
"About to read machine config script"
789 Debug
"Read config script, setting defaults..."
791 [ ! -r $CHARMINC/conv-config.sh
] && Abort
"Cannot find conv-config.sh in $CHARMINC"
792 .
$CHARMINC/conv-config.sh
$CHARMINC
794 Debug
"Setting vars..."
796 if [ "$USE_BUILD_OPTIONS" = "1" ]
798 [ -n "$VERBOSE" ] && echo "Charmc applying build time options: $BUILDOPTS"
799 OPTS
="$OPTS $BUILDOPTS"
802 # If we are debugging, add "-g -O0" to the C/C++ flags
803 if [ -n "$CHARMDEBUG" ]; then
804 if [ -n "$CMK_BUILD_PYTHON" ]; then
805 AddModules PythonCCS charmdebug_python
806 POST_LIBRARIES
=`AddList $POST_LIBRARIES -lpython${CMK_BUILD_PYTHON}`
808 OPTS_CPP
="$OPTS_CPP -O0 -g"
813 # Look up and add the dependencies for module $1
816 notInList
$M $PROCESSED_MODULES ||
return
817 PROCESSED_MODULES
="$PROCESSED_MODULES $M"
818 PRE_LIBRARIES
=`AddList $PRE_LIBRARIES -lmodule$M`
819 # HACK: add modules to both ends of library list, to avoid
820 # undefined symbol CkRegisterMainModule when it's in a module file.
821 POST_LIBRARIES
=`AddList $POST_LIBRARIES -lmodule$M`
822 if [ "$M" = "PythonCCS" ]
828 # fixme: should search everything in the -L library paths:
829 for dir
in `echo . $CHARMLIB`
831 d
="$dir/libmodule$M.dep"
832 [ -r "$d" ] && dep
=$d
836 # Add the module dependencies in this file
837 # Debugf "Adding module" $M "dependencies from" $dep
839 Debugf
"Module" $M "adds dependencies:" $deps
844 # Repeat the module-dependency search until we find no
847 while [ "$START_MODULES" != "$MODULES" ]
849 Debugf
"----------- Module dependency search ------------"
850 START_MODULES
="$MODULES"
857 Debugf
"----------- Module dependency search complete ------------"
861 ##############################################################################
863 # Load machine-specific configuration data, then handle overrides to it.
865 ##############################################################################
868 if [ x
"$CMK_NO_BUILD_SHARED" = "xfalse" ]
873 if [ "$BUILD_SHARE" = "1" ]
875 if [ x
"$CMK_NO_BUILD_SHARED" = "xtrue" -o -z "$CHARMLIBSO" ]
884 if [ "$USE_PIC" = "1" ]
886 OPTS_CC
="$OPTS_CC $OPTS_PIC"
887 OPTS_CXX
="$OPTS_CXX $OPTS_PIC"
888 OPTS_F90
="$OPTS_F90 $OPTS_PIC"
889 OPTS_LD
="$OPTS_LD $OPTS_PIC"
892 if [ "$BUILD_SHARE" = "1" ]
894 # ignore BUILD_SHARE if the target is not .a or .so
896 *.a|
*.so|
*.so.
*|
*.sl|
*.dylib
)
897 OPTS_LD
="$OPTS_LD $CMK_LD_SHARED $OPTS_LDRO -L$CHARMLIBSO"
905 if [ -n "$OVERRIDE_CC" ]
907 CMK_CC
="$OVERRIDE_CC"
910 if [ -n "$OVERRIDE_CXX" ]
912 CMK_CXX
="$OVERRIDE_CXX"
915 if [ -n "$OVERRIDE_F90" ]
917 CMK_CF90
="$OVERRIDE_F90"
920 if [ -n "$OVERRIDE_LD" ]
922 CMK_LD
="$OVERRIDE_LD"
925 if [ -n "$OVERRIDE_LDXX" ]
927 CMK_LDXX
="$OVERRIDE_LDXX"
930 if [ -n "$USE_RELIABLE_CC" ]
932 CMK_CC
="$CMK_CC_RELIABLE"
935 if [ -n "$USE_FASTEST_CC" ]
937 CMK_CC
="$CMK_CC_FASTEST"
943 CMK_CF90_FIXED
=$CMK_CF77
944 CMK_F90LIBS
=$CMK_F77LIBS
947 if [ -n "$CMK_F90_MODINC" ]
949 CMK_CF90_MODINC
="$CMK_F90_MODINC"
954 if [ -n "$F90_MODDIR" ]
956 for dir
in $F90_MODDIR
958 OPTS_F90
="$OPTS_F90 $CMK_CF90_MODINC $dir"
962 if [ -n "$CMK_F90_USE_MODDIR" ]
964 CMK_CF90
="$CMK_CF90 $CMK_CF90_MODINC$CHARMINC "
967 if [ -n "$SEQUENTIAL" ]
969 CMK_CC
="$CMK_SEQ_CC -DCMK_SEQUENTIAL=1 "
971 CMK_CXX
="$CMK_SEQ_CXX -DCMK_SEQUENTIAL=1 "
972 CMK_CF90
="$CMK_SEQ_F90 "
973 CMK_LDXX
="$CMK_SEQ_LDXX"
975 CMK_RANLIB
="$CMK_SEQ_RANLIB"
980 CMK_CC
="$CMK_NATIVE_CC "
981 CMK_LD
="$CMK_NATIVE_LD"
982 CMK_CXX
="$CMK_NATIVE_CXX "
983 CMK_LDXX
="$CMK_NATIVE_LDXX"
986 if [ -n "$PREPROCESS" ]
993 CMK_LD
="purify $CMK_LD"
994 CMK_LDXX
="purify $CMK_LDXX"
998 if [ "$OPTIMIZE_MODE" = "true" ]
1000 OPTS_CC
="$CMK_C_OPTIMIZE $OPTS_CC"
1001 OPTS_CXX
="$CMK_CXX_OPTIMIZE $OPTS_CXX"
1002 OPTS_F90
="$CMK_F90_OPTIMIZE $OPTS_F90"
1003 OPTS_LD
="$CMK_C_OPTIMIZE $OPTS_LD"
1004 OPTS_LDXX
="$CMK_CXX_OPTIMIZE $OPTS_LDXX"
1007 # Pick up per-architecture production mode settings
1008 if [ "$PRODUCTION_MODE" = "true" ]
1010 OPTS_CC
="$CMK_PRODUCTION $CMK_C_PRODUCTION $OPTS_CC"
1011 OPTS_CXX
="$CMK_PRODUCTION $CMK_CXX_PRODUCTION $OPTS_CXX"
1012 OPTS_F90
="$CMK_PRODUCTION $CMK_F90_PRODUCTION $OPTS_F90"
1013 OPTS_LD
="$CMK_PRODUCTION $CMK_C_PRODUCTION $OPTS_LD"
1014 OPTS_LDXX
="$CMK_PRODUCTION $CMK_CXX_PRODUCTION $OPTS_LDXX"
1017 if [ -n "$XI_INTERNAL" ]
1019 CMK_XIOPTS
="$CMK_XIOPTS -intrinsic"
1022 if [ "$GENDEPENDS" = "yes" ]
1024 CMK_XIOPTS
="$CMK_XIOPTS -M"
1027 if test "$CMK_WITH_TAU" = "true"
1029 echo "include $TAU_MAKEFILE" > _make.tau.tmp
1030 echo "print-%:; @echo \$(\$*)" >> _make.tau.tmp
1031 TAU_LIBS
=`make --no-print-directory -f _make.tau.tmp print-TAU_LIBS`
1032 TAU_MPI_LIBS
=`make --no-print-directory -f _make.tau.tmp print-TAU_MPI_LIBS`
1033 TAU_MPI_FLIBS
=`make --no-print-directory -f _make.tau.tmp print-TAU_MPI_FLIBS`
1034 TAU_DEFS
=`make --no-print-directory -f _make.tau.tmp print-TAU_DEFS`
1035 TAU_INCLUDE
=`make --no-print-directory -f _make.tau.tmp print-TAU_INCLUDE`
1040 #Add generic options to the compiler- and linker-options
1041 OPTS_CC
="$OPTS $TAU_DEFS $TAU_INCLUDE $OPTS_CC"
1042 OPTS_CXX
="$OPTS $TAU_DEFS $TAU_INCLUDE $OPTS_CXX"
1043 OPTS_F90
="$OPTS $OPTS_F90"
1044 OPTS_LD
="$OPTS $OPTS_LD"
1045 # OPTS_LDXX gets OPTS from OPTS_LD
1047 if [ -n "$F90_MAIN" ]
1049 # for_main needs to be placed at beginning
1050 CMK_LD
="$CMK_LD $CMK_F90MAINLIBS"
1051 CMK_LDXX
="$CMK_LDXX $CMK_F90MAINLIBS"
1054 # There's really no analog for this in the Bourne shell:
1055 # -------- C Shell ------> onintr failure
1056 # Luckily, it's irrelevant as long as nobody sends us a ^Z.
1058 ##############################################################################
1060 # Check for valid choice of LANGUAGE
1062 ##############################################################################
1063 Debug
"Checking language..."
1065 if [ -z "$LANGUAGE" ]
1068 [ -n "$SEQUENTIAL" ] && LANGUAGE
=c
1072 "c"|
"C"|
"c++"|
"C++")
1073 [ -z "$SEQUENTIAL" -a -z "$NATIVE" ] && Abort
"Language $LANGUAGE is for sequential programs"
1077 # update charm to bgcharm
1078 if [ "$LANGUAGE" = "charm++" -a -n "$CMK_BIGSIM" ]
1080 LANGUAGE
="bgcharm++"
1082 if [ "$LANGUAGE" = "converse++" -a -n "$CMK_BIGSIM" ]
1084 LANGUAGE
="bgconverse++"
1086 if [ "$LANGUAGE" = "bgcharm++" ]
1088 TRACEMODE
=`AddList $TRACEMODE bluegene`
1091 ########################################################################
1093 # We've parsed and verified the command-line parameters.
1094 # Now we prepare routines to clean up and exit.
1095 # None of these routines ever returns-- they all just exit.
1097 ########################################################################
1101 if [ "a$COPYTO" != "a" -a "a$COPYTO" != "a$OBJECT" ]
1103 [ -d $COPYTO ] && COPYTO
="$COPYTO/"
1104 if [ "a$PROG_EXT" != "a" -a -r "$OBJECT$PROG_EXT" ] ; then
1105 Warning
"Appending $PROG_EXT to object file name"
1106 OBJECT
="$OBJECT$PROG_EXT"
1108 [ ! -d $COPYTO ] && DoNoErrCheck
$RM $COPYTO
1109 Do
$CP $OBJECT $COPYTO
1111 test -n "$COPY_EXIT" && Success
1115 for COPY
in `echo $MODCOPIES`
1117 if [ "a$COPY" != "a$OBJECT" ]
1119 [ -d $COPY ] && COPY
="$COPY/"
1120 if [ -n "$CMK_MOD_NAME_ALLCAPS" ] ; then
1121 OBJECT
=`echo $OBJECT | tr "a-z" "A-Z"`
1123 if [ -r "$OBJECT.$CMK_MOD_EXT" ] ; then
1124 Warning
"Appending .$CMK_MOD_EXT to object file name"
1125 OBJECT
="$OBJECT.$CMK_MOD_EXT"
1127 [ ! -d $COPY ] && DoNoErrCheck
$RM $COPY
1128 Do
$CP $OBJECT $COPY
1139 ##############################################################################
1141 # Preprocess the GEN-CPM files
1143 ##############################################################################
1145 Debug
"Preprocessing GEN-CPM files"
1147 for FILE
in `echo $GENCPM`
1149 # This used to be "$FILE:r", which strips the extention
1150 BASE
=`stripExtention $FILE`
1151 TMP
=`basename $FILE`".TMP"
1152 DELETE
="$DELETE $TMP.c $TMP.i"
1153 DoNoErrCheck
$RM $BASE.cpm.h
$TMP.c
1154 Do
touch $BASE.cpm.h
1155 Do
$LN -f -s $FILE $TMP.c
1156 Do
$CMK_CPP_C -I$CHARMINC $OPTS_CC $OPTS_CPP $TMP.c
> $TMP.i
1157 Do
$CHARMBIN/conv-cpm
$TMP.i
$BASE.cpm.h
1160 ##############################################################################
1162 # Compile all specified files
1164 # All temporary files named *.TMP.* for easy cleanup.
1166 ##############################################################################
1168 Debug
"About to compile..."
1170 numFiles
=`echo $FILES | wc -w`
1171 for FILE
in `echo $FILES`
1173 BASE
=`stripExtention \`basename $FILE\
``
1174 TMP
=`basename $FILE`".TMP"
1175 FILE_EXT
=`getExtention $FILE`
1179 # in case of: charmc -o object.o -c foo.c,
1180 # avoid foo.c => remove foo.o => foo.o => object.o,
1181 # instead generate object.o directly.
1182 # remove and generate foo.o may be dangerous in parallel make
1183 # for example in the case of compiling several objs from one
1184 # same c file such as memory.c.
1185 if [ $numFiles = 1 -a -n "$OBJECT" ]
1187 OBJ_EXT
=`getExtention $OBJECT`
1188 if [ "$OBJ_EXT" = '.o' -o "$OBJ_EXT" = '.co' ]
1195 # if [ "$FILE_EXT" != ".o" -a "$FILE_EXT" != ".co" -a "$FILE_EXT" != ".M" -a "$FILE_EXT" != ".ci" ]
1198 .c|.s|.C|.cc|.cxx|.cpp|.c
++|.cu|.f|.F|.f90|.F90
)
1199 [ $VERBOSE ] && echo "Compiling $FILE"
1200 DoNoErrCheck
$RM $BASEO $BASE.f.o
1203 if [ ! -z "$SKIPLINK" ]
1211 test "$LANGUAGE" = "f90charm" && XIOPTS
="$XIOPTS -f90"
1212 if [ -n "$PREPROCESS" ]
1214 Do
$CMK_CPP_CHARM $OPTS_CPP $FILE | Do
$CHARMBIN/charmxi
$XIOPTS
1216 Do
$CHARMBIN/charmxi
$XIOPTS $FILE
1220 Do
$CMK_CC -I$CHARMINC $OPTS_CPP_INTERNAL $OPTS_CPP $OPTS_CC -c $FILE $DESTO
1224 Do
$CMK_GCXX -I$CHARMINC $OPTS_CPP_INTERNAL $OPTS_CPP $OPTS_CXX -c $FILE $DESTO
1227 *.C|
*.cc|
*.cxx|
*.cpp|
*.c
++|
*.cu
)
1228 Do
$CMK_CXX -I$CHARMINC $OPTS_CPP_INTERNAL $OPTS_CPP $OPTS_CXX -c $FILE $DESTO
1232 test -z "$CMK_CF90_FIXED" && Abort
"No F90 compiler (CMK_CF90_FIXED) defined"
1233 Do
$CMK_CF90_FIXED -I$CHARMINC $OPTS_CPP $OPTS_F90 -c $FILE $DESTO
1237 test -z "$CMK_CF90" && Abort
"No F90 compiler (CMK_CF90) defined"
1238 test -z "$PREPROCESS" && OPTS_F90
="$OPTS_F90 -c"
1239 Do
$CMK_CF90 -I$CHARMINC $OPTS_CPP $OPTS_F90 $FILE $DESTO
1243 Abort
"I'm not yet smart enough to compile $FILE"
1245 *.o|
*.so|
*.so.
*|
*.sl|
*.a|
*.dylib|
*.co
)
1246 [ ! -s $FILE ] && Abort
"$FILE: file not recognized: File truncated"
1247 OBJECTFILES
="$OBJECTFILES $FILE"
1255 Abort
"file with unrecognized extension $FILE"
1257 # Handle new object files
1258 if [ -n "$NU_OBJ" -a -n "$OBJECT" ]
1260 if [ "$OBJECT" != "$BASEO" ]
1262 DELETE
="$DELETE $NU_OBJ"
1264 OBJECTFILES
="$OBJECTFILES $NU_OBJ"
1268 ##############################################################################
1270 # POSSIBLY, SKIP LINK-STEP
1272 # 1. No $OBJECT may be specified at all --- its just a compilation.
1273 # 2. If $OBJECT is a ".a" file, a library is created from $OBJECTFILES.
1274 # 3. If $OBJECT is a ".o" file, then an "LDRO" is created from $OBJECTFILES.
1275 # 4. Language may be sequential. Do a quick and easy linkage.
1277 # in any of these cases, the full link step is skipped.
1279 ##############################################################################
1282 Debugf
"Running ldro..."
1283 DoNoErrCheck
$RM $OBJECT
1284 # convert to absolute path if required
1285 if test -n "$CMK_LD_SHARED_ABSOLUTE_PATH"
1287 dir
=`dirname $OBJECT`
1288 fname
=`basename $OBJECT`
1292 Warning
"Warning: creating $OBJECT "
1293 if test "$MAKE_LDXX" = "1"
1295 soCmd
="$CMK_LDXX -o $OBJECT $OPTS_LD $OPTS_LDRO $OBJECTFILES $PRE_LIBRARIES $POST_LIBRARIES $CMK_LD_SHARED_LIBS"
1297 soCmd
="$CMK_LD -o $OBJECT $OPTS_LD $OPTS_LDRO $OBJECTFILES $PRE_LIBRARIES $POST_LIBRARIES $CMK_LD_SHARED_LIBS"
1301 if [ $Do_res -ne 0 ]
1303 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
1304 echo "!! Failed to compile Charm++ shared library. You can disable shared !!"
1305 echo "!! lib compilation by providing --no-build-shared build option like: !!"
1306 echo "!! ./build charm++ net-linux --no-build-shared -O !!"
1307 echo "!! or reexecute this charmc command with --no-build-shared compile option !!"
1308 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
1309 Abort
"Command $soCmd returned error code $Do_res"
1314 if [ -z "$OBJECT" -o ! -z "$SKIPLINK" ]
1316 # We have no target object, or are playing preprocessor tricks-- just end
1317 Debugf
"No target object-- finished"
1321 Debug
"About to link..."
1325 Debugf
"Converting $FILES to $OBJECTFILES"
1326 nFiles
=`echo $FILES | wc -w`
1327 nObj
=`echo $OBJECTFILES | wc -w`
1328 # One source file, one .o: just move the .o
1329 if [ $OBJECT != $OBJECTFILES ]
1331 Debugf
"Moving .o to destination"
1332 DoNoErrCheck
$RM $OBJECT
1333 Do
$MV $OBJECTFILES $OBJECT
1337 *.so|
*.so.
*|
*.sl|
*.dylib
)
1338 # Make shared library
1339 # if no build share is set, exit normally.
1340 if [ "$BUILD_SHARE" = 0 ]
1342 echo "Warning: building shared library is skipped, possibly due to not supported, check configuration files."
1344 elif [ "$CHARM_SHARED" = "0" ]
1350 # Make regular (.a, non-shared) library
1351 # in case building charm so, build .so under lib_so as well # Gengbin
1352 if [ "$BUILD_SHARE" = "1" ]
1359 DESTDIR
=`echo $OBJECT | sed -e 's@lib/[^/]*\.a$@lib_so@'`
1360 OBJECT
=`echo $OBJECT | sed -e 's@lib/\([^/]*\)\.a$@lib_so/\1.a@'`
1362 COPYTO
=`echo $COPYTO | sed -e 's@lib[/]*$@lib_so@'`
1365 OBJECT
=`echo $OBJECT | sed -e 's/\.a$/.'"$CMK_SHARED_SUF"'/'`
1366 [ -f $DESTDIR/.charmso
] && MakeSO
1372 DoNoErrCheck
$RM $OBJECT
1373 Do
$CMK_AR $OBJECT $OBJECTFILES
1374 Do
$CMK_RANLIB $OBJECT
1378 # If the above case returns, we're not creating a .o or .a file,
1379 # so linking is needed.
1381 ############ Determine the language and libraries ##########
1383 # Parse out the real languages
1387 USE_F90_LIBRARIES
="1"
1390 PRE_LIBRARIES
="$PRE_LIBRARIES -lf90charm -lckf"
1391 POST_LIBRARIES
="$POST_LIBRARIES $CMK_F90LIBS"
1393 "bluegene"|
"bigsim")
1394 PRE_LIBRARIES
="$PRE_LIBRARIES -lconv-bigsim -lconv-bigsim-logs"
1397 POST_LIBRARIES
="$POST_LIBRARIES -lbluegene"
1400 PRE_LIBRARIES
="$PRE_LIBRARIES -lconv-bigsim -lconv-bigsim-logs -lconv-bluegene-stub"
1403 MIDDLE_LIBS
="$MIDDLE_LIBS -lconv-bigsim -lconv-bigsim-logs"
1407 # DMK - ACCEL SUPPORT - If this is a cell build, add the spe code object to POST_LIBRARIES
1408 if [ $CMK_CELL -eq 1 ]
1411 if [ "$LANGUAGE" == "converse++" ]
1413 # Include a "do nothing" register_accel_spe_funcs() function
1414 POST_LIBRARIES
="$POST_LIBRARIES -lnoAccelStub"
1417 if [ "$LANGUAGE" == "charm++" ]
1420 if [ $SPU_USE_CPP -eq 1 ]
1422 SPU_COMPILER
=$CMK_SPU_CXX
1423 SPU_LINKER
=$CMK_SPU_LDXX
1425 SPU_COMPILER
=$CMK_SPU_CC
1426 SPU_LINKER
=$CMK_SPU_LD
1429 # Make the spe object file to be included
1430 Do
$SPU_COMPILER -c -I$CHARMINC -o main__funcLookup__.genSPECode.o main__funcLookup__.genSPECode.c
-DCMK_CELL_SPE=1
1431 Do
$SPU_LINKER -L$CHARMLIB -o main__funcLookup__.genSPECode main__funcLookup__.genSPECode.o
$CMK_SPERT_LIBS $SPU_EXTRA_LIBS
1432 Do
$CMK_PPU_EMBEDSPU spert_main main__funcLookup__.genSPECode main__funcLookup__.genSPECode.ppe.o
1434 # Include the spe object file for linking into main executable
1435 POST_LIBRARIES
="$POST_LIBRARIES main__funcLookup__.genSPECode.ppe.o"
1440 if [ "$AMPIMAIN" != "" ]
1442 OBJECTFILES
="$CHARMLIB/lib$AMPIMAIN.o $OBJECTFILES"
1445 if [ "$SWAPGLOBALS" = "1" ]
1447 swapo
="$CHARMLIB/libglobal-swap.o"
1448 if [ ! -r "$swapo" -o ! -s "$swapo" ]
1450 echo "Global-swapping library $swapo missing--"
1451 echo " Is -swapglobals supported on this machine?"
1454 OBJECTFILES
="$swapo $OBJECTFILES"
1457 if [ "$SWAPGLOBALS" = "2" ]
1459 swapo
="$CHARMLIB/libglobal-copy.o"
1460 if [ ! -r "$swapo" -o ! -s "$swapo" ]
1462 echo "Global-copying library $swapo missing--"
1463 echo " Is -copyglobals supported on this machine?"
1466 OBJECTFILES
="$swapo $OBJECTFILES $CHARMLIB/loadsym.o"
1470 if [ $USE_F77_LIBRARIES = "1" ]
1472 POST_LIBRARIES
="$POST_LIBRARIES $CMK_F77LIBS"
1475 if [ $USE_F90_LIBRARIES = "1" ]
1477 if [ ! -r $CHARMLIB/libconv-utilf.a
]
1479 echo "Fortran support library $CHARMLIB/libconv-utilf.a missing"
1480 echo "Is your Fortran compiler working?"
1484 POST_LIBRARIES
="$POST_LIBRARIES -lconv-utilf $CMK_F90LIBS"
1485 if [ -z "$SEQUENTIAL" -a ! -z "$CMK_F90OBJS" ]
1487 for f90obj
in $CMK_F90OBJS
1489 OBJECTFILES
="$OBJECTFILES $CHARMLIB/$f90obj"
1494 # check if we're linking a sequential object
1496 "c"|
"C"|
"f90"|
"f77")
1499 Do
$CMK_NATIVE_LD $OPTS_LD -o $OBJECT $OBJECTFILES \
1500 -L$CHARMLIB $PRE_LIBRARIES $CMK_NATIVE_LIBS $POST_LIBRARIES
1502 Do
$CMK_SEQ_LD $OPTS_LD -o $OBJECT $OBJECTFILES \
1503 -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
1510 Do
$CMK_NATIVE_LDXX $OPTS_LD -o $OBJECT $OBJECTFILES \
1511 -L$CHARMLIB $PRE_LIBRARIES $CMK_NATIVE_LIBS $POST_LIBRARIES
1513 Do
$CMK_SEQ_LDXX $OPTS_LD -o $OBJECT $OBJECTFILES \
1514 -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
1520 ##############################################################################
1522 # Some quick consistency checks prior to full link-step
1524 # Check for valid choice of TRACEMODE
1525 # Check for valid choice of BALANCE
1526 # Check for compatibility among BALANCE and TRACEMODE
1528 ##############################################################################
1530 Debug
"About to check TRACEMODE=$TRACEMODE and BALANCE=$BALANCE..."
1532 # Check for valid choice of TRACEMODE
1534 # [ -r $CHARMLIB/libtrace-projections.a ] || Abort "trace libraries not installed. Is Charm++ built properly?"
1536 if [ x
"$TRACEMODE" != x
]
1538 for trace
in $TRACEMODE; do
1539 [ ! -r "$CHARMLIB/libtrace-$trace.a" ] && Abort
"charmc : No such tracemode $trace"
1540 TRACE_OBJ
="$TRACE_OBJ -ltrace-$trace"
1542 TRACE_OBJ
="$TRACE_OBJ $CMK_LIBZ"
1545 if test x
$LANGUAGE = x
"bgcharm++"
1550 BAL_EXT
=`getExtention $BALANCE`
1551 if [ -z "$BAL_EXT" ]
1553 # Balance has no extention-- is a library reference
1554 BAL_OBJ
="$CHARMLIB/libldb-$BALANCE.o"
1556 # Balance has some extention-- must be a .o or .a file
1560 Debug
"Finished with BAL_OBJ=$BAL_OBJ, TRACEMODE=$TRACEMODE..."
1562 if [ ! -r "$BAL_OBJ" ]
1564 if [ "$BALANCE" = "$BAL_OBJ" ]
1566 Abort
"Could not find load balancer object $BAL_OBJ"
1568 (cd $CHARMLIB ; ls -al libldb-
*)
1569 Abort
"Unknown load balancer $BALANCE / $BAL_OBJ"
1574 # Check for valid choice of MEMORY
1576 MEM_OBJ
="$CHARMLIB/libmemory-$MEMORY.o"
1578 if [ ! -r $MEM_OBJ -o ! -s $MEM_OBJ ]
1580 (cd $CHARMLIB ; list
=`ls libmemory-* 2>/dev/null`; test -n "$list" && for i
in $list; do [ -s $i ] && ls -l $i; done )
1581 Abort
"charmc : No such memory mode $MEMORY"
1584 # For memory wrapping around the OS allocator, need to add also the wrapper object
1587 MEM_OBJ
=$MEM_OBJ" $CHARMLIB/libmemory-os-wrapper.o"
1591 # Check for valid choice of THREAD
1593 if [ "$CHARM_SHARED" = "1" -a -n "$CMK_LD_SHARED_THREAD" -a "$THREAD" = "default" ]
1595 THREAD
=$CMK_LD_SHARED_THREAD
1597 if [ "$TLSGLOBALS" = "1" ]
1599 # make sure we don't add an extra -tls
1600 if ! echo $THREAD |
grep '\-tls$' > /dev
/null
2> /dev
/null
1602 THREAD
=${THREAD}-tls
1605 THREAD_OBJ
="$CHARMLIB/libthreads-$THREAD.o"
1607 if [ ! -r $THREAD_OBJ -o ! -s $THREAD_OBJ ]
1609 (cd $CHARMLIB ; list
=`ls libthreads-* 2>/dev/null`; test -n "$list" && for i
in $list; do [ -s $i ] && ls -l $i; done )
1610 Abort
"charmc : No such thread mode $THREAD"
1613 ################# Build the module initialization function ##################
1614 modInitName
="moduleinit$$"
1615 modInitSrc
="$modInitName.C"
1616 modInitObj
="$modInitName.o"
1617 DoNoErrCheck
$RM $modInitSrc $modInitObj > /dev
/null
2>&1
1619 for module
in $MODULES; do
1620 echo "extern void _register$module(void);" >> $modInitSrc
1622 for trace
in $TRACEMODE; do
1623 if test $trace = "summary"
1625 echo " extern void _registerTraceSummary();" >> $modInitSrc
1626 elif test $trace = "projections"
1628 echo " extern void _registerTraceProjections();" >> $modInitSrc
1629 elif test $trace = "simple"
1631 echo " extern void _registerTraceSimple();" >> $modInitSrc
1632 elif test $trace = "Tau"
1634 echo " extern void _registerTraceTau();" >> $modInitSrc
1635 elif test $trace = "utilization"
1637 echo " extern void _registerTraceUtilization();" >> $modInitSrc
1638 elif test $trace = "controlPoints"
1640 echo " extern void _registerTraceControlPoints();" >> $modInitSrc
1641 elif test $trace = "all"
1643 echo " extern void _registerTraceProjections();" >> $modInitSrc
1644 echo " extern void _registerTraceSummary();" >> $modInitSrc
1647 if test -n "$BALANCER"
1649 echo "extern void LBDefaultCreate(const char *);" >> $modInitSrc
1651 echo "void _registerExternalModules(char **argv) {" >> $modInitSrc
1652 for module
in $MODULES; do
1653 [ -n "$VERBOSE" ] && echo "Adding registration for module $module"
1654 echo " _register$module();" >> $modInitSrc
1656 for trace
in $TRACEMODE; do
1657 if test $trace = "summary"
1659 echo " _registerTraceSummary();" >> $modInitSrc
1660 elif test $trace = "projections"
1662 echo " _registerTraceProjections();" >> $modInitSrc
1663 elif test $trace = "Tau"
1666 echo " _registerTraceTau();" >> $modInitSrc
1667 elif test $trace = "simple"
1669 echo " _registerTraceSimple();" >> $modInitSrc
1670 elif test $trace = "utilization"
1672 echo " _registerTraceUtilization();" >> $modInitSrc
1673 elif test $trace = "controlPoints"
1675 echo " _registerTraceControlPoints();" >> $modInitSrc
1676 elif test $trace = "all"
1678 echo " _registerTraceProjections();" >> $modInitSrc
1679 echo " _registerTraceSummary();" >> $modInitSrc
1682 if test -n "$BALANCER"
1684 [ -n "$VERBOSE" ] && echo "Adding load balancer for $BALANCER"
1685 for deflb
in $BALANCER
1687 echo " LBDefaultCreate(\"$deflb\");" >> $modInitSrc
1690 echo "}" >> $modInitSrc
1692 # creating projections
1693 echo "void _createTraces(char **argv) {" >> $modInitSrc
1694 for trace
in $TRACEMODE; do
1695 [ -n "$VERBOSE" ] && echo "Adding registration for trace $trace"
1696 echo "extern void _createTrace$trace(char **argv);" >> $modInitSrc
1697 echo "_createTrace$trace(argv);" >> $modInitSrc
1699 echo "}" >> $modInitSrc
1701 Do
$CMK_CXX $OPTS_CPP_INTERNAL $OPTS_CPP $OPTS_CXX -c $modInitSrc -o $modInitObj
1703 ###############################################################################
1707 ###############################################################################
1709 Debug
"About to perform final link..."
1714 CORE_LIBS
="-lconv-core -lconv-util $TRACE_OBJ "
1716 # get TAU stub makefile variables
1717 if test "$CMK_WITH_TAU" = "true"
1719 echo "include $TAU_MAKEFILE" > _make.tau.tmp
1720 echo "print-%:; @echo \$(\$*)" >> _make.tau.tmp
1721 TAU_LIBS
=`make --no-print-directory -f _make.tau.tmp print-TAU_LIBS`
1722 TAU_MPI_LIBS
=`make --no-print-directory -f _make.tau.tmp print-TAU_MPI_LIBS`
1723 TAU_MPI_FLIBS
=`make --no-print-directory -f _make.tau.tmp print-TAU_MPI_FLIBS`
1724 TAU_DEFS
=`make --no-print-directory -f _make.tau.tmp print-TAU_DEFS`
1725 TAU_INCLUDE
=`make --no-print-directory -f _make.tau.tmp print-TAU_INCLUDE`
1729 # done getting TAU variables
1734 MIDDLE_LIBS
="-lck -lconv-cplus-y $CORE_LIBS "
1735 CMK_SYSLIBS
="$CMK_SYSLIBS -lm"
1736 if [ "$TAU_TRACE_MPI" = "1" ]
1738 TAU_LIBS
="$TAU_MPI_FLIBS $TAU_LIBS"
1740 TAU_LIBS
="$TAU_LIBS"
1743 "charm"|
"charm++"|
"f90charm"|
"ckbluegene"|
"bgcharm++")
1745 MIDDLE_LIBS
="-lck -lconv-cplus-y $CORE_LIBS "
1746 CMK_SYSLIBS
="$CMK_SYSLIBS -lm"
1747 if [ "$TAU_TRACE_MPI" = "1" ]
1749 TAU_LIBS
="$TAU_MPI_LIBS $TAU_LIBS"
1751 TAU_LIBS
="$TAU_LIBS"
1756 MIDDLE_LIBS
="-lconv-cplus-n $CORE_LIBS -ltrace-converse "
1757 CMK_SYSLIBS
="$CMK_SYSLIBS -lm"
1759 "converse++"|
"bluegene"|
"bigsim"|
"bgconverse++")
1761 MIDDLE_LIBS
="$MIDDLE_LIBS -lconv-cplus-y $CORE_LIBS -ltrace-converse "
1762 CMK_SYSLIBS
="$CMK_SYSLIBS -lm"
1765 Abort
"Unrecognized choice of language $LANGUAGE"
1769 if [ "$BUILD_SHARE" = "0" ]
1771 MIDDLE_LIBS
="$MEM_OBJ $THREAD_OBJ $MIDDLE_LIBS"
1774 if [ "$CHARM_SHARED" = "1" ]
1776 [ -z "$CHARMLIBSO" ] && Abort
"Charm++ lib_so directory not found!"
1777 # build user executable/shared lib linking with charm .so
1778 OPTS_LD
="$OPTS_LD $CMK_LD_LIBRARY_PATH"
1779 if [ "$BUILD_SHARE" = "1" ]
1781 LANG_LIBS
="-L$CHARMLIBSO $OBJECTFILES $PRE_LIBRARIES"
1783 LANG_LIBS
="-L$CHARMLIBSO $BAL_OBJ $OBJECTFILES $modInitObj $PRE_LIBRARIES"
1786 LANG_LIBS
="-L$CHARMLIB -I$CHARMINC $BAL_OBJ $OBJECTFILES $modInitObj $PRE_LIBRARIES"
1788 if [ "$TRACE_WITH_TAU" = 1 ]
1790 echo "Linking with the TAU libraries: $TAU_LIBS"
1791 ALL_LIBS
="$LANG_LIBS $MIDDLE_LIBS $CMK_LIBS $POST_LIBRARIES $CMK_SYSLIBS $TAU_LIBS"
1793 ALL_LIBS
="$LANG_LIBS $MIDDLE_LIBS $CMK_LIBS $POST_LIBRARIES $CMK_SYSLIBS"
1795 Debugf
"All libraries are: $ALL_LIBS"
1797 if [ "$BUILD_SHARE" = "1" -a "$CHARM_SHARED" = "1" ]
1799 # build an applicaiton .so linking with charm .so
1800 OPTS_LD
="$OPTS_LD $CMK_LD_SHARED $OPTS_LDRO -L$CHARMLIBSO"
1801 Debugf
"Running ldro..."
1802 DoNoErrCheck
$RM $OBJECT
1803 [ "$MAKE_LDXX" = "1" ] && Do
$CMK_LDXX $OPTS_LD $OPTS_LDXX -o $OBJECT $ALL_LIBS
1804 [ "$MAKE_LD" = "1" ] && Do
$CMK_LD $OPTS_LD -o $OBJECT $ALL_LIBS
1807 # Make a regular executable: call the appropriate linker
1808 [ "$MAKE_LDXX" = "1" ] && Do
$CMK_LDXX $OPTS_LD $OPTS_LDXX -o $OBJECT $ALL_LIBS
1809 [ "$MAKE_LD" = "1" ] && Do
$CMK_LD $OPTS_LD -o $OBJECT $ALL_LIBS
1812 ########################################################################
1814 # Copy conv-host to user directory if it is present in installation.
1816 ########################################################################
1818 if test "$COPY_CHARMRUN" = "true"
1820 targ
=charmrun
$CMK_POST_EXE
1821 [ ! -x $CHARMBIN/$targ -a -n "$CMK_POST_EXE" ] && targ
=charmrun
1822 convhost
=conv-host
$CMK_POST_EXE
1824 if [ -x $CHARMBIN/$targ ]
1826 DoNoErrCheck
$RM $targ
1827 Do
$CP $CHARMBIN/$targ $targ
1831 [ -z "$SAVE" ] && DoNoErrCheck
$RM $modInitSrc $modInitObj > /dev
/null
2>&1