remove vmi
[charm.git] / build
blobbec4b51cd5bce4b572ab80f872163403ecc1c89e
1 #!/bin/sh
3 # Silly shorthand, used for source reorganization
4 src="src/arch"
6 more=0
8 syntax() {
9 echo ''
10 echo 'Usage: build <target> <version> <options> [charmc-options ...]'
11 echo ''
12 echo '<targets>: converse charm++ LIBS AMPI FEM bigemulator pose jade msa'
13 echo '<targets>: doc ps-doc pdf-doc html-doc'
14 if test $more = 1
15 then
16 echo ''
17 echo ' charm++ compile Charm++ core only'
18 echo ' AMPI compile Adaptive MPI on top of Charm++'
19 echo ' FEM compile FEM framework'
20 echo ' LIBS compile additional parallel libraries with Charm++ core'
21 echo ' bigemulator build additional BigSim libraries'
22 echo ' pose build POSE parallel discrete event simulator'
23 echo ' jade build Jade compiler (auto-builds charm++, msa)'
24 echo ' msa build Multiphase Shared Arrays(MSA) library'
25 echo ' Tau build the TAU tracing library for generating TAU performance data'
26 echo ' ChaNGa compile Charm++ core and necessary libraries for ChaNGa'
27 echo ''
29 echo '<versions>: '
30 ( cd $src ; ls -1 | egrep -v '(^CVS)|(^shmem$)|(^mpi$)|(^sim$)|(^net$)|(^multicore$)|(^util$)|(^common$)|(^uth$)|(^conv-mach-fix.sh$)|(^win32$)|(^win64$)|(^paragon$)|(^lapi$)|(^cell$)|(^gemini_gni$)|(^pami$)|(^template$)|(^cuda$)' | pr -3 -t )
31 echo ''
32 echo '<options>: compiler and platform specific options'
33 echo 'cc cc64 cxx kcc pgcc acc icc ecc gcc3 gcc4 mpcc pathscale clang'
34 echo 'help smp gm tcp scyld clustermatic bigemulator ooc syncft mlogft causalft'
35 echo 'papi pthreads lam'
36 echo '--incdir --libdir --basedir --build-shared --destination --suffix -j'
37 if test $more = 1
38 then
39 echo ''
40 echo 'For platform specific options, use help option:'
41 echo ' help platform specific help, e.g. ./build charm++ net-linux-x86_64 help'
42 echo ''
43 echo 'Choose a compiler (only one option is allowed from this section):'
44 echo ' cc, cc64 For Sun WorkShop C++ 32/64 bit compilers'
45 echo ' cxx DIGITAL C++ compiler (DEC Alpha)'
46 echo ' kcc KAI C++ compiler'
47 echo " pgcc Portland Group's C++ compiler"
48 echo ' acc HP aCC compiler'
49 echo ' icc Intel C/C++ compiler for Linux IA32'
50 echo ' ecc Intel C/C++ compiler for Linux IA64'
51 echo ' gcc3 GNU GCC/G++ version 3'
52 echo ' gcc4 GNU GCC/G++ version 4 (only mpi-crayxt3)'
53 echo ' mpcc SUN Solaris C++ compiler for MPI'
54 echo ' pathscale Pathscale compiler suite'
55 echo ' clang Clang C/C++ compuler'
56 echo ''
57 echo 'Choose a fortran compile (only one option is allowed from this section):'
58 echo ' g95 G95 at http://ww.g95.org'
59 echo ' absoft Absoft fortran compiler'
60 echo " pgf90 Portland Group\'s Fortran compiler"
61 echo ' ifc Intel Fortran compiler (older versions)'
62 echo ' ifort Intel Fortran compiler (newer versions)'
63 echo ''
64 echo 'Platform specific options (choose multiple if apply):'
65 echo ' lam Use LAM MPI'
66 echo ' smp support for SMP, multithreaded charm on each node'
67 echo ' mpt use SGI Message Passing Toolkit (only for mpi version)'
68 echo ' gm use Myrinet for communication'
69 echo ' tcp use TCP sockets for communication (only for net version)'
70 echo ' ibverbs use the Infiniband OpenIB layer for communication (only for net-linux-x86_64 currently)'
71 echo ' scyld compile for Scyld Beowulf cluster based on bproc'
72 echo ' clustermatic compile for Clustermatic (support version 3 and 4) '
73 echo ' pthreads compile with pthreads Converse threads'
74 echo ''
75 echo 'Advanced options:'
76 echo ' bigemulator compile for BigSim simulator'
77 echo ' ooc compile with out of core support'
78 echo ' syncft compile with Charm++ fault tolerance support'
79 echo ' mlogft compile with Charm++ message logging fault tolerance support'
80 echo ' papi compile with PAPI performance counter support (if any)'
81 echo ''
82 echo "Charm++ dynamic libraries:"
83 echo " --no-build-shared don't build Charm++'s shared libraries (default)"
84 echo " --build-shared build Charm++ dynamic libraries (.so) "
85 echo ''
86 echo 'Enable/disable features:'
87 src/scripts/configure --help | grep enable-
88 src/scripts/configure --help | grep with-
89 echo " --with-production build Charm++ with all optimizations for maximum performance, and disabling all above features"
90 echo ''
91 echo 'Miscellaneous options:'
92 echo ' --incdir=DIR specify additional include path for compiler'
93 echo ' --libdir=DIR specify additional lib path for compiler'
94 echo ' --basedir=DIR shortcut for the above two - DIR/include and DIR/lib'
95 echo ' -j[N] parallel make, N is the number of paralle make jobs'
96 echo " --with-romio build AMPI with ROMIO library"
97 echo " --with-lbtime-type specify real type for the load balancing timers"
98 echo " --destination=DIR build Charm++ inside DIR, by default the destination is <version>"
99 echo " --suffix=DIR append DIR to the destination directory of the Charm++ build"
100 echo " --tau-makefile=FILE Specify which TAU stub makefile to use"
102 echo ''
103 echo '<charmc-options>: normal compiler options e.g. -g -optimize -save -verbose'
104 if test $more = 1
105 then
106 echo ''
107 echo 'Examples:'
108 echo "1. display all supported options for net-linux-x86_64 using 'help':"
109 echo ' ./build charm++ net-linux-x86_64 help'
110 echo '2. compile Charm++ on Linux with all available tuning:'
111 echo ' ./build charm++ net-linux-x86_64 --with-production'
112 echo '3. compile Charm++ for Linux (32bit) clustermatic Beowulf cluster with Intel compiler and optimizations:'
113 echo ' ./build charm++ net-linux clustermatic icc -optimize'
114 echo '4. compile Charm++ for IA64 Linux cluster with MPICH-GM:'
115 echo ' ./build charm++ mpi-linux-ia64 gm -optimize'
116 echo '5. compile Charm++ for Windows with VC++ (Cygwin required):'
117 echo ' ./build charm++ net-win32 -optimize'
118 echo '6. compile on IBM SP with MPI using parallel gmake, 4 jobs simultaneously:'
119 echo ' MAKE=gmake ./build charm++ mpi-sp -j4 -optimize # sh'
120 echo ' setenv MAKE gmake; ./build charm++ mpi-sp -j4 -optimize # csh'
121 echo '7. compile Charm++ with MPI that is installed at /usr/local/mpich:'
122 echo ' ./build charm++ mpi-linux --incdir /usr/local/mpich/include --libdir /usr/local/mpich/lib -optimize'
123 echo ' or in short,'
124 echo ' ./build charm++ mpi-linux --basedir /usr/local/mpich -optimize'
125 echo ' ./build Tau --tau-makefile=/usr/local/packages/TAU/x86_64/lib/Makefile.tau-mpi'
126 echo ''
127 echo 'Note: This script:'
128 echo ' 1. Creates directories <destination> and <destination>/tmp'
129 echo ' 2. Copies src/scripts/Makefile into <destination>/tmp'
130 echo ' 3. Does a "make basics" in <destination>/tmp.'
131 echo ' 3. Does a "make -jN <target> <version> OPTS=<charmc-options>" in <destination>/tmp.'
132 echo "That's all build does. The rest is handled by the Makefile."
133 echo ''
134 echo 'Thank you for using Charm++, please send questions or comments to '
135 echo 'Parallel Programming Lab at University of Illinois at Urbana-Champaign'
136 echo '(email: charm@cs.illinois.edu).'
138 else
139 echo ''
140 echo "To get more detailed help, run ./build --help"
144 Echo() {
145 [ "x$QUIET" = "x--quiet" ] || echo $*
148 printOption() {
149 for prefix in cc conv-mach
151 str="Supported compilers:"
152 [ "$prefix" = "conv-mach" ] && str="Supported options:"
153 opts=""
154 for dir in $OPT_DIRS
156 # echo "Checking for $prefix in $dir"
157 files=`cd $dir; ls $prefix-*.h 2>/dev/null`
158 opts="$opts "`echo $files | sed 's/'$prefix'-\([^.]*\).h/\1/g'`
159 done
160 tmp=.tmp.$$
161 rm -f $tmp; touch $tmp
162 for o in $opts
164 echo $o >> $tmp
165 done
166 opts=`sort $tmp | uniq`
167 rm -f $tmp
168 echo $str $opts
169 done
170 exit 1
173 CheckDir() {
174 for d in $*
176 if test ! -d $d
177 then
178 echo Error: cannot find $d!
179 exit 1
181 done
184 TestIfCompiler() {
185 for dir in $OPT_DIRS
187 [ -f $dir/cc-$1.sh ] && return 1
188 done
189 return 0
192 TestIfOption() {
193 for dir in $OPT_DIRS
195 [ -f $dir/conv-mach-$1.h ] && return 1
196 done
198 echo "Error> option: $1 is not supported in this version!";
199 printOption
203 # start
205 MAKEOPTS=""
206 OPTS=""
207 BOPTS=""
208 MORE=""
209 COMPILER=""
210 BASEDIR=
211 LIBDIR=
212 INCDIR=
213 ARCH=
214 BUILD_SHARED="" # default no shared lib
215 WITH_ROMIO=
216 WITH_PRODUCTION=
217 BUILD_EMULATOR=0
218 DESTINATION=""
219 DESTINATION_SUFFIX=""
220 TAU_MAKEFILE=""
221 QUIET=""
223 [ "$1" = '--help' -o "$1" = '-h' ] && more=1 && syntax | more && exit 1
224 [ $# -lt 2 ] && ./smart-build.pl && exit 1
225 PROGRAM=$1
226 shift
228 # find longest prefix of version argument that exists as a directory in $src
229 VERSION=$1
230 VERSOPTS=""
231 testversion=""
232 oldifs=$IFS
233 IFS=-
234 for w in $1; do
235 IFS=$oldifs
236 if [ -z "$testversion" ]; then
237 testversion=$w
238 else
239 testversion="$testversion-$w"
241 if [ -d $src/$testversion ]; then
242 VERSION=$testversion
243 VERSOPTS=""
244 else
245 VERSOPTS="$VERSOPTS $w"
247 done
248 if [ $VERSION = $1 ]; then VERSOPTS=""; fi
250 BASEVERSION=$VERSION;
251 if test -f $src/$BASEVERSION/vdir_link
252 then
253 BASEVERSION=`cat $src/$BASEVERSION/vdir_link`
255 ARCH=`echo $BASEVERSION | sed -e 's@-.*@@'`
256 shift
258 #echo $src
259 #echo $BASEVERSION
260 #echo $ARCH
262 OPT_DIRS="$src/$BASEVERSION $src/$ARCH $src/common"
264 # process remainder of version argument as options, copied from below
265 for w in $VERSOPTS; do
266 # This has to be a build-time option (like "smp", "gcc3", or "kcc")
267 TestIfCompiler $w
268 if [ $? -eq 1 ]
269 then
270 # It specifies a compiler:
271 if [ ! -z "$COMPILER" ]
272 then
273 echo "Error> Tried to specify two compilers: $COMPILER and $w"
274 printOption
276 COMPILER=$w
277 else
278 # It specifies some other option:
279 TestIfOption $w
280 BOPTS="$BOPTS $w"
281 [ $w = "bigemulator" ] && BUILD_EMULATOR=1
282 [ $w = "bigsim" ] && BUILD_EMULATOR=1
284 done
286 while [ ! $# -eq 0 ]
288 case "$1" in
289 "--basedir")
290 shift;
291 for dir in $1
293 CheckDir $dir/include $dir/lib
294 LIBDIR="$LIBDIR -L$dir/lib";
295 INCDIR="$INCDIR -I$dir/include"
296 done
297 shift
299 --basedir=*)
300 basedir=`echo $1 | awk -F= '{print $2}'`
301 for dir in $basedir
303 CheckDir $dir/include $dir/lib
304 LIBDIR="$LIBDIR -L$dir/lib";
305 INCDIR="$INCDIR -I$dir/include"
306 done
307 shift
309 "--libdir")
310 shift; CheckDir $1
311 for dir in $1
313 LIBDIR="$LIBDIR -L$dir";
314 done
315 shift
317 --libdir=*)
318 libdir=`echo $1 | awk -F= '{print $2}'`
319 CheckDir $libdir
320 for dir in $libdir
322 LIBDIR="$LIBDIR -L$dir";
323 done
324 shift
326 "--incdir")
327 shift; CheckDir $1
328 for dir in $1
330 INCDIR="$INCDIR -I$dir";
331 done
332 shift
334 --incdir=*)
335 incdir=`echo $1 | awk -F= '{print $2}'`
336 CheckDir $incdir
337 for dir in $incdir
339 INCDIR="$INCDIR -I$dir";
340 done
341 shift
343 --no-build-shared|--no-shared)
344 #BUILD_SHARED="-no-build-shared";
345 shift
347 --build-shared)
348 BUILD_SHARED="-build-shared";
349 shift
351 --with-romio)
352 WITH_ROMIO="true"; shift
354 --with-production)
355 WITH_PRODUCTION="true"
356 shift
358 --with-*)
359 CONFIG_OPTS="$CONFIG_OPTS $1"
360 shift
362 --without-*)
363 CONFIG_OPTS="$CONFIG_OPTS $1"
364 shift
366 --destination)
367 shift
368 DESTINATION="$1"
369 shift
371 --destination=*)
372 DESTINATION="`echo $1 | awk -F= '{print $2}'`"
373 shift
375 --suffix)
376 shift
377 DESTINATION_SUFFIX="$1"
378 shift
380 --suffix=*)
381 DESTINATION_SUFFIX="`echo $1 | awk -F= '{print $2}'`"
382 shift
384 --tau-makefile)
385 TAU_MAKEFILE=$1
386 shift
388 --tau-makefile=*)
389 TAU_MAKEFILE=`echo $1 | awk -F= '{print $2}'`
390 shift
392 --quiet)
393 MAKEOPTS="$MAKEOPTS --quiet"
394 QUIET="--quiet"
395 shift;
397 --enable-tracing|--enable-tracing=*)
398 CONFIG_OPTS="$CONFIG_OPTS $1"
399 ENABLE_TRACING=yes
400 shift
402 --enable-*)
403 CONFIG_OPTS="$CONFIG_OPTS $1"
404 shift
406 --disable-*)
407 CONFIG_OPTS="$CONFIG_OPTS $1"
408 shift
410 -j*)
411 PMAKENUM=`echo $1 | awk -Fj '{print $2}'`
412 MAKEOPTS="$MAKEOPTS -j $PMAKENUM"
413 shift;
415 -*)
416 # We hit a real compiler option (like -g, or -Dfoo),
417 # so just copy over all remaining options
418 while [ ! $# -eq 0 ]
420 OPTS="$OPTS $1"; shift
421 done
423 "help")
424 printOption
427 # This has to be a build-time option (like "smp", "gcc3", or "kcc")
428 TestIfCompiler $1
429 if [ $? -eq 1 ]
430 then
431 # It specifies a compiler:
432 if [ ! -z "$COMPILER" ]
433 then
434 echo "Error> Tried to specify two compilers: $COMPILER and $1"
435 printOption
437 COMPILER=$1
438 else
439 # It specifies some other option:
440 TestIfOption $1
441 BOPTS="$BOPTS $1"
442 [ $1 = "bigemulator" ] && BUILD_EMULATOR=1
443 [ $1 = "bigsim" ] && BUILD_EMULATOR=1
445 shift
447 esac
448 done
450 [ "x$VERSION" = "x" ] && syntax && exit 1
452 if test -n "$WITH_PRODUCTION" -a $BUILD_EMULATOR -eq 1 -a -z "$ENABLE_TRACING"
453 then
454 echo "Error: bigemulator requires tracing modules, --with-production must be used with --enable-tracing"
455 exit 1
458 if [ -z "$MAKE" ]
459 then
460 # prefer gmake
461 MAKE=`which gmake 2>/dev/null`
462 [ -z "$MAKE" -o ! -x "$MAKE" ] && MAKE='make'
465 if [ ! -f $src/$BASEVERSION/conv-mach.h ]
466 then
467 if [ "x_$BASEVERSION" = "x_net-rs6k" ]
468 then
469 echo "Error> build net-aix-ppc instead of net-rs6k!"
470 else
471 echo "Error> build can not find arch: $BASEVERSION!"
473 exit 1
476 #generate VERSION name combining all the build-time options.
477 if [ -n "$BOPTS" -o -n "$COMPILER" ]
478 then
479 echo "Selected Compiler: $COMPILER"
480 echo "Selected Options: $BOPTS"
481 SORTED=`echo $BOPTS | awk '{ for (i = 1; i <= NF; ++i) print $i }' | sort`
482 BOPTS_WITHCOMPILER=`echo $SORTED $COMPILER`
483 for i in $BOPTS_WITHCOMPILER
485 VERSION=$VERSION-$i
486 done
489 #echo "|$DESTINATION|$DESTINATION_SUFFIX|"
491 if [ -z "$DESTINATION" ]
492 then
493 DESTINATION="$VERSION"
496 if [ -n "$DESTINATION_SUFFIX" ]
497 then
498 DESTINATION="$DESTINATION-$DESTINATION_SUFFIX"
501 [ -d $DESTINATION ] || Echo "Creating dir: $DESTINATION"
502 [ -d $DESTINATION ] || mkdir $DESTINATION
503 [ -d $DESTINATION/tmp ] || Echo "Creating dir: $DESTINATION/tmp"
504 [ -d $DESTINATION/tmp ] || mkdir $DESTINATION/tmp
506 Echo "Copying src/scripts/Makefile to $DESTINATION/tmp"
507 rm -f $DESTINATION/tmp/Makefile
508 rm -f $DESTINATION/tmp/Make.depends
509 rm -f $DESTINATION/tmp/Make.cidepends
510 rm -f $DESTINATION/tmp/Make.lb
511 rm -f $DESTINATION/tmp/Make.machine
512 rm -f $DESTINATION/tmp/Make.extlib
515 # Create the bin, lib, include, etc. links:
516 WINNAME=`echo $VERSION | awk -F- '{print $2}'`
517 if [ "x_$WINNAME" = "x_win32" -o "x_$WINNAME" = "x_win64" ]
518 then
519 #Win32/64 version needs special compilers and *copied* (not linked)
520 # source files.
521 echo "Copying compilers for $WINNAME into cygwin /bin directory"
522 cp -f $src/$WINNAME/unix2nt* /bin
523 cp $src/win32/system_ln $DESTINATION/tmp
524 cp $src/win32/unistd.h $DESTINATION/tmp
525 echo "Compiling createlink.cpp ..."
526 (cd $src/win32; unix2nt_cc -c createlink.cpp -o createlink.o -D_WIN32_WINNT=0x0500; unix2nt_cc createlink.o)
527 if test ! -x $src/win32/createlink.exe
528 then
529 echo "VC++ is not properly installed!"
530 exit 1
532 echo "Copying $src/win32/createlink.exe to /bin directory"
533 cp $src/win32/createlink.exe /bin
534 chmod +x $DESTINATION/tmp/system_ln
535 cp $src/win32/gathertree.local $DESTINATION/tmp
536 cp $src/win32/gatherflat.local $DESTINATION/tmp
537 else
538 cat > $DESTINATION/tmp/system_ln <<EOF
539 #!/bin/sh
540 ln -f -s \$@
542 chmod +x $DESTINATION/tmp/system_ln
543 for newdir in `echo bin lib lib_so include tmp`
545 Echo "Soft-linking over $newdir"
546 if [ -r $newdir ]
547 then
548 rm -fr $newdir || exit 1
550 $DESTINATION/tmp/system_ln $DESTINATION/$newdir $newdir
551 done
552 rm -f VERSION
553 $DESTINATION/tmp/system_ln $DESTINATION/include/VERSION VERSION
556 $DESTINATION/tmp/system_ln "../../src/scripts/Make.depends" $DESTINATION/tmp/Make.depends
557 $DESTINATION/tmp/system_ln "../../src/scripts/Make.cidepends" $DESTINATION/tmp/Make.cidepends
558 if test -f src/ck-ldb/Make.lb
559 then
560 $DESTINATION/tmp/system_ln "../../src/ck-ldb/Make.lb" $DESTINATION/tmp/Make.lb
561 else
562 touch $DESTINATION/tmp/Make.lb
564 $DESTINATION/tmp/system_ln "../../src/scripts/Makefile" $DESTINATION/tmp/Makefile
565 $DESTINATION/tmp/system_ln "../../src/scripts/Make.tau" $DESTINATION/tmp/Make.tau
566 touch $DESTINATION/tmp/Makefile.machine
567 touch $DESTINATION/tmp/Make.extlib
569 ConvUsr="$DESTINATION/tmp/conv-mach-pre.sh"
570 Echo "Generating $ConvUsr"
571 echo > $ConvUsr
572 if test -n "$LIBDIR"
573 then
574 echo 'USER_OPTS_LD="$USER_OPTS_LD '$LIBDIR'"' >> $ConvUsr
575 echo 'USER_OPTS_LDXX="$USER_OPTS_LDXX '$LIBDIR'"' >> $ConvUsr
577 if test -n "$INCDIR"
578 then
579 echo 'USER_OPTS_CC="$USER_OPTS_CC '$INCDIR'"' >> $ConvUsr
580 echo 'USER_OPTS_CXX="$USER_OPTS_CXX '$INCDIR'"' >> $ConvUsr
582 chmod +x $ConvUsr
584 # Create conv-mach-opt headers with special build-time options
585 ConvHeader="$DESTINATION/tmp/conv-mach-opt.h"
586 ConvSh="$DESTINATION/tmp/conv-mach-opt.sh"
587 if [ ! -f $ConvSh -o ! -f $ConvHeader ]
588 then
589 Echo "Generating $ConvHeader, conv-mach-opt.sh"
590 echo '/* Build-time options header, automatically generated by charm/build*/'> $ConvHeader
591 echo '# Built-time options header, automatically generated by charm/build'> $ConvSh
592 echo '[ -z "$CHARMINC" ] && CHARMINC="."' >> $ConvSh
594 if test -n "$COMPILER"
595 then
596 i="$COMPILER"
597 echo '#include "'cc-$i.h'"' >> $ConvHeader
598 echo '. $CHARMINC/'"cc-$i.sh" >> $ConvSh
600 if test -n "$BOPTS"
601 then
602 for i in $BOPTS
604 echo '#include "'conv-mach-$i.h'"' >> $ConvHeader
605 echo '. $CHARMINC/'"conv-mach-$i.sh" >> $ConvSh
606 done
609 if test "$BUILD_SHARED" = "-build-shared"
610 then
611 echo "CMK_NO_BUILD_SHARED=false" >> $ConvSh
612 else
613 echo "CMK_NO_BUILD_SHARED=true" >> $ConvSh
616 if test -n "$WITH_ROMIO"
617 then
618 echo "CMK_AMPI_WITH_ROMIO=\"true\"" >> $ConvSh
621 if test -n "$WITH_PRODUCTION"
622 then
623 echo '#define CMK_OPTIMIZE 1' >> $ConvHeader
624 # Prepend optimize so that an explicit -no-optimize still works
625 OPTS="-optimize -production $OPTS"
626 CONFIG_OPTS="--disable-controlpoint --disable-tracing --disable-tracing-commthread --disable-charmdebug --disable-replay --disable-error-checking --disable-stats $CONFIG_OPTS"
629 # build with Tau
630 WITH_TAU=0
631 if [ "$PROGRAM" = "Tau" ]
632 then
633 Echo "TAU>>>> makefile config option: $TAU_MAKEFILE"
634 if [ -n "$TAU_MAKEFILE" -a -f $TAU_MAKEFILE ]
635 then
636 #Setting up TAU trace library:
637 Echo "TAU>>>> configuring with this TAU makefile: $TAU_MAKEFILE"
639 WITH_TAU=1
640 else
641 Echo "TAU>>>> ERROR could not find Makefile: $TAU_MAKEFILE, ignored"
642 TAU_MAKEFILE=""
645 [ -z "$TAU_MAKEFILE" ] && TAU_MAKEFILE="Make.tau"
646 SED_CHARMC="s@TAU_MAKEFILE=\(.*\)@TAU_MAKEFILE=$TAU_MAKEFILE@"
648 sed -e $SED_CHARMC src/scripts/Makefile > .Makefile.$$ && cp .Makefile.$$ src/scripts/Makefile && rm -f .Makefile.$$
649 sed -e $SED_CHARMC src/scripts/charmc > .charmc.$$ && cp .charmc.$$ src/scripts/charmc && rm -f .charmc.$$
651 if test $WITH_TAU -eq 1
652 then
653 echo "#define CMK_WITH_TAU 1" >> $ConvHeader
654 echo "#define pthread_create tau_pthread_create" >> $ConvHeader
655 echo "#define pthread_exit tau_pthread_exit" >> $ConvHeader
657 echo "CMK_WITH_TAU=\"true\"" >> $ConvSh
661 echo $BASEVERSION > $DESTINATION/tmp/.vdir
662 echo $BASEVERSION | sed -e 's@-.*@@' > $DESTINATION/tmp/.gdir
664 if test $BUILD_EMULATOR = 1
665 then
666 PROGRAM="$PROGRAM bigsim"
667 # CONFIG_OPTS="--disable-charmdebug $CONFIG_OPTS"
670 printError()
672 Echo "-------------------------------------------------"
673 Echo "Charm++ NOT BUILT. Either cd into $DESTINATION/tmp and try"
674 Echo "to resolve the problems yourself, visit"
675 Echo " http://charm.cs.illinois.edu/"
676 Echo "for more information. Otherwise, email the developers at charm@cs.illinois.edu"
677 exit $MAKEEXIT
680 echo 'BUILDOPTS="'$OPTS'"' >> $ConvSh
682 Echo "Performing '$MAKE $MAKEOPTS basics OPTS="$OPTS" QUIET="$QUIET" CONFIG_OPTS="$CONFIG_OPTS"' in $DESTINATION/tmp"
683 cd $DESTINATION/tmp
684 echo "CONFIG_OPTS=\"$CONFIG_OPTS\"" > config_opts.sh
685 chmod +x config_opts.sh
686 echo "OPTSATBUILDTIME += $OPTS" > buildopts.mk
687 $MAKE $MAKEOPTS basics OPTS="$OPTS $BUILD_SHARED" QUIET="$QUIET"
688 MAKEEXIT=$?
689 [ $MAKEEXIT -ne 0 ] && printError
691 Echo "Performing '$MAKE $MAKEOPTS $PROGRAM OPTS="$OPTS" QUIET="$QUIET"' in $DESTINATION/tmp"
692 $MAKE $MAKEOPTS $PROGRAM OPTS="$OPTS $BUILD_SHARED" QUIET="$QUIET"
693 MAKEEXIT=$?
694 if [ $MAKEEXIT -eq 0 ]
695 then
696 Echo "-------------------------------------------------"
697 Echo "$PROGRAM built successfully."
698 Echo "Next, try out a sample program like" \
699 "$DESTINATION/tests/charm++/simplearrayhello"
700 else
701 printError