remove elan machine layer
[charm.git] / build
blob6fe0d88fc91a268c834b59432bf77f28c071759e
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$)|(^vmi$)|(^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 vmi 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 " vmi use NCSA's VMI for communication (only for mpi version)"
72 echo ' scyld compile for Scyld Beowulf cluster based on bproc'
73 echo ' clustermatic compile for Clustermatic (support version 3 and 4) '
74 echo ' pthreads compile with pthreads Converse threads'
75 echo ''
76 echo 'Advanced options:'
77 echo ' bigemulator compile for BigSim simulator'
78 echo ' ooc compile with out of core support'
79 echo ' syncft compile with Charm++ fault tolerance support'
80 echo ' mlogft compile with Charm++ message logging fault tolerance support'
81 echo ' papi compile with PAPI performance counter support (if any)'
82 echo ''
83 echo "Charm++ dynamic libraries:"
84 echo " --no-build-shared don't build Charm++'s shared libraries (default)"
85 echo " --build-shared build Charm++ dynamic libraries (.so) "
86 echo ''
87 echo 'Enable/disable features:'
88 src/scripts/configure --help | grep enable-
89 src/scripts/configure --help | grep with-
90 echo " --with-production build Charm++ with all optimizations for maximum performance, and disabling all above features"
91 echo ''
92 echo 'Miscellaneous options:'
93 echo ' --incdir=DIR specify additional include path for compiler'
94 echo ' --libdir=DIR specify additional lib path for compiler'
95 echo ' --basedir=DIR shortcut for the above two - DIR/include and DIR/lib'
96 echo ' -j[N] parallel make, N is the number of paralle make jobs'
97 echo " --with-romio build AMPI with ROMIO library"
98 echo " --with-lbtime-type specify real type for the load balancing timers"
99 echo " --destination=DIR build Charm++ inside DIR, by default the destination is <version>"
100 echo " --suffix=DIR append DIR to the destination directory of the Charm++ build"
101 echo " --tau-makefile=FILE Specify which TAU stub makefile to use"
103 echo ''
104 echo '<charmc-options>: normal compiler options e.g. -g -optimize -save -verbose'
105 if test $more = 1
106 then
107 echo ''
108 echo 'Examples:'
109 echo "1. display all supported options for net-linux-x86_64 using 'help':"
110 echo ' ./build charm++ net-linux-x86_64 help'
111 echo '2. compile Charm++ on Linux with all available tuning:'
112 echo ' ./build charm++ net-linux-x86_64 --with-production'
113 echo '3. compile Charm++ for Linux (32bit) clustermatic Beowulf cluster with Intel compiler and optimizations:'
114 echo ' ./build charm++ net-linux clustermatic icc -optimize'
115 echo '4. compile Charm++ for IA64 Linux cluster with MPICH-GM:'
116 echo ' ./build charm++ mpi-linux-ia64 gm -optimize'
117 echo '5. compile Charm++ for Windows with VC++ (Cygwin required):'
118 echo ' ./build charm++ net-win32 -optimize'
119 echo '6. compile on IBM SP with MPI using parallel gmake, 4 jobs simultaneously:'
120 echo ' MAKE=gmake ./build charm++ mpi-sp -j4 -optimize # sh'
121 echo ' setenv MAKE gmake; ./build charm++ mpi-sp -j4 -optimize # csh'
122 echo '7. compile Charm++ with MPI that is installed at /usr/local/mpich:'
123 echo ' ./build charm++ mpi-linux --incdir /usr/local/mpich/include --libdir /usr/local/mpich/lib -optimize'
124 echo ' or in short,'
125 echo ' ./build charm++ mpi-linux --basedir /usr/local/mpich -optimize'
126 echo ' ./build Tau --tau-makefile=/usr/local/packages/TAU/x86_64/lib/Makefile.tau-mpi'
127 echo ''
128 echo 'Note: This script:'
129 echo ' 1. Creates directories <destination> and <destination>/tmp'
130 echo ' 2. Copies src/scripts/Makefile into <destination>/tmp'
131 echo ' 3. Does a "make basics" in <destination>/tmp.'
132 echo ' 3. Does a "make -jN <target> <version> OPTS=<charmc-options>" in <destination>/tmp.'
133 echo "That's all build does. The rest is handled by the Makefile."
134 echo ''
135 echo 'Thank you for using Charm++, please send questions or comments to '
136 echo 'Parallel Programming Lab at University of Illinois at Urbana-Champaign'
137 echo '(email: charm@cs.illinois.edu).'
139 else
140 echo ''
141 echo "To get more detailed help, run ./build --help"
145 Echo() {
146 [ "x$QUIET" = "x--quiet" ] || echo $*
149 printOption() {
150 for prefix in cc conv-mach
152 str="Supported compilers:"
153 [ "$prefix" = "conv-mach" ] && str="Supported options:"
154 opts=""
155 for dir in $OPT_DIRS
157 # echo "Checking for $prefix in $dir"
158 files=`cd $dir; ls $prefix-*.h 2>/dev/null`
159 opts="$opts "`echo $files | sed 's/'$prefix'-\([^.]*\).h/\1/g'`
160 done
161 tmp=.tmp.$$
162 rm -f $tmp; touch $tmp
163 for o in $opts
165 echo $o >> $tmp
166 done
167 opts=`sort $tmp | uniq`
168 rm -f $tmp
169 echo $str $opts
170 done
171 exit 1
174 CheckDir() {
175 for d in $*
177 if test ! -d $d
178 then
179 echo Error: cannot find $d!
180 exit 1
182 done
185 TestIfCompiler() {
186 for dir in $OPT_DIRS
188 [ -f $dir/cc-$1.sh ] && return 1
189 done
190 return 0
193 TestIfOption() {
194 for dir in $OPT_DIRS
196 [ -f $dir/conv-mach-$1.h ] && return 1
197 done
199 echo "Error> option: $1 is not supported in this version!";
200 printOption
204 # start
206 MAKEOPTS=""
207 OPTS=""
208 BOPTS=""
209 MORE=""
210 COMPILER=""
211 BASEDIR=
212 LIBDIR=
213 INCDIR=
214 ARCH=
215 BUILD_SHARED="" # default no shared lib
216 WITH_ROMIO=
217 WITH_PRODUCTION=
218 BUILD_EMULATOR=0
219 DESTINATION=""
220 DESTINATION_SUFFIX=""
221 TAU_MAKEFILE=""
222 QUIET=""
224 [ "$1" = '--help' -o "$1" = '-h' ] && more=1 && syntax | more && exit 1
225 [ $# -lt 2 ] && ./smart-build.pl && exit 1
226 PROGRAM=$1
227 shift
229 # find longest prefix of version argument that exists as a directory in $src
230 VERSION=$1
231 VERSOPTS=""
232 testversion=""
233 oldifs=$IFS
234 IFS=-
235 for w in $1; do
236 IFS=$oldifs
237 if [ -z "$testversion" ]; then
238 testversion=$w
239 else
240 testversion="$testversion-$w"
242 if [ -d $src/$testversion ]; then
243 VERSION=$testversion
244 VERSOPTS=""
245 else
246 VERSOPTS="$VERSOPTS $w"
248 done
249 if [ $VERSION = $1 ]; then VERSOPTS=""; fi
251 BASEVERSION=$VERSION;
252 if test -f $src/$BASEVERSION/vdir_link
253 then
254 BASEVERSION=`cat $src/$BASEVERSION/vdir_link`
256 ARCH=`echo $BASEVERSION | sed -e 's@-.*@@'`
257 shift
259 #echo $src
260 #echo $BASEVERSION
261 #echo $ARCH
263 OPT_DIRS="$src/$BASEVERSION $src/$ARCH $src/common"
265 # process remainder of version argument as options, copied from below
266 for w in $VERSOPTS; do
267 # This has to be a build-time option (like "smp", "gcc3", or "kcc")
268 TestIfCompiler $w
269 if [ $? -eq 1 ]
270 then
271 # It specifies a compiler:
272 if [ ! -z "$COMPILER" ]
273 then
274 echo "Error> Tried to specify two compilers: $COMPILER and $w"
275 printOption
277 COMPILER=$w
278 else
279 # It specifies some other option:
280 TestIfOption $w
281 BOPTS="$BOPTS $w"
282 [ $w = "bigemulator" ] && BUILD_EMULATOR=1
283 [ $w = "bigsim" ] && BUILD_EMULATOR=1
285 done
287 while [ ! $# -eq 0 ]
289 case "$1" in
290 "--basedir")
291 shift;
292 for dir in $1
294 CheckDir $dir/include $dir/lib
295 LIBDIR="$LIBDIR -L$dir/lib";
296 INCDIR="$INCDIR -I$dir/include"
297 done
298 shift
300 --basedir=*)
301 basedir=`echo $1 | awk -F= '{print $2}'`
302 for dir in $basedir
304 CheckDir $dir/include $dir/lib
305 LIBDIR="$LIBDIR -L$dir/lib";
306 INCDIR="$INCDIR -I$dir/include"
307 done
308 shift
310 "--libdir")
311 shift; CheckDir $1
312 for dir in $1
314 LIBDIR="$LIBDIR -L$dir";
315 done
316 shift
318 --libdir=*)
319 libdir=`echo $1 | awk -F= '{print $2}'`
320 CheckDir $libdir
321 for dir in $libdir
323 LIBDIR="$LIBDIR -L$dir";
324 done
325 shift
327 "--incdir")
328 shift; CheckDir $1
329 for dir in $1
331 INCDIR="$INCDIR -I$dir";
332 done
333 shift
335 --incdir=*)
336 incdir=`echo $1 | awk -F= '{print $2}'`
337 CheckDir $incdir
338 for dir in $incdir
340 INCDIR="$INCDIR -I$dir";
341 done
342 shift
344 --no-build-shared|--no-shared)
345 #BUILD_SHARED="-no-build-shared";
346 shift
348 --build-shared)
349 BUILD_SHARED="-build-shared";
350 shift
352 --with-romio)
353 WITH_ROMIO="true"; shift
355 --with-production)
356 WITH_PRODUCTION="true"
357 shift
359 --with-*)
360 CONFIG_OPTS="$CONFIG_OPTS $1"
361 shift
363 --without-*)
364 CONFIG_OPTS="$CONFIG_OPTS $1"
365 shift
367 --destination)
368 shift
369 DESTINATION="$1"
370 shift
372 --destination=*)
373 DESTINATION="`echo $1 | awk -F= '{print $2}'`"
374 shift
376 --suffix)
377 shift
378 DESTINATION_SUFFIX="$1"
379 shift
381 --suffix=*)
382 DESTINATION_SUFFIX="`echo $1 | awk -F= '{print $2}'`"
383 shift
385 --tau-makefile)
386 TAU_MAKEFILE=$1
387 shift
389 --tau-makefile=*)
390 TAU_MAKEFILE=`echo $1 | awk -F= '{print $2}'`
391 shift
393 --quiet)
394 MAKEOPTS="$MAKEOPTS --quiet"
395 QUIET="--quiet"
396 shift;
398 --enable-tracing|--enable-tracing=*)
399 CONFIG_OPTS="$CONFIG_OPTS $1"
400 ENABLE_TRACING=yes
401 shift
403 --enable-*)
404 CONFIG_OPTS="$CONFIG_OPTS $1"
405 shift
407 --disable-*)
408 CONFIG_OPTS="$CONFIG_OPTS $1"
409 shift
411 -j*)
412 PMAKENUM=`echo $1 | awk -Fj '{print $2}'`
413 MAKEOPTS="$MAKEOPTS -j $PMAKENUM"
414 shift;
416 -*)
417 # We hit a real compiler option (like -g, or -Dfoo),
418 # so just copy over all remaining options
419 while [ ! $# -eq 0 ]
421 OPTS="$OPTS $1"; shift
422 done
424 "help")
425 printOption
428 # This has to be a build-time option (like "smp", "gcc3", or "kcc")
429 TestIfCompiler $1
430 if [ $? -eq 1 ]
431 then
432 # It specifies a compiler:
433 if [ ! -z "$COMPILER" ]
434 then
435 echo "Error> Tried to specify two compilers: $COMPILER and $1"
436 printOption
438 COMPILER=$1
439 else
440 # It specifies some other option:
441 TestIfOption $1
442 BOPTS="$BOPTS $1"
443 [ $1 = "bigemulator" ] && BUILD_EMULATOR=1
444 [ $1 = "bigsim" ] && BUILD_EMULATOR=1
446 shift
448 esac
449 done
451 [ "x$VERSION" = "x" ] && syntax && exit 1
453 if test -n "$WITH_PRODUCTION" -a $BUILD_EMULATOR -eq 1 -a -z "$ENABLE_TRACING"
454 then
455 echo "Error: bigemulator requires tracing modules, --with-production must be used with --enable-tracing"
456 exit 1
459 if [ -z "$MAKE" ]
460 then
461 # prefer gmake
462 MAKE=`which gmake 2>/dev/null`
463 [ -z "$MAKE" -o ! -x "$MAKE" ] && MAKE='make'
466 if [ ! -f $src/$BASEVERSION/conv-mach.h ]
467 then
468 if [ "x_$BASEVERSION" = "x_net-rs6k" ]
469 then
470 echo "Error> build net-aix-ppc instead of net-rs6k!"
471 else
472 echo "Error> build can not find arch: $BASEVERSION!"
474 exit 1
477 #generate VERSION name combining all the build-time options.
478 if [ -n "$BOPTS" -o -n "$COMPILER" ]
479 then
480 echo "Selected Compiler: $COMPILER"
481 echo "Selected Options: $BOPTS"
482 SORTED=`echo $BOPTS | awk '{ for (i = 1; i <= NF; ++i) print $i }' | sort`
483 BOPTS_WITHCOMPILER=`echo $SORTED $COMPILER`
484 for i in $BOPTS_WITHCOMPILER
486 VERSION=$VERSION-$i
487 done
490 #echo "|$DESTINATION|$DESTINATION_SUFFIX|"
492 if [ -z "$DESTINATION" ]
493 then
494 DESTINATION="$VERSION"
497 if [ -n "$DESTINATION_SUFFIX" ]
498 then
499 DESTINATION="$DESTINATION-$DESTINATION_SUFFIX"
502 [ -d $DESTINATION ] || Echo "Creating dir: $DESTINATION"
503 [ -d $DESTINATION ] || mkdir $DESTINATION
504 [ -d $DESTINATION/tmp ] || Echo "Creating dir: $DESTINATION/tmp"
505 [ -d $DESTINATION/tmp ] || mkdir $DESTINATION/tmp
507 Echo "Copying src/scripts/Makefile to $DESTINATION/tmp"
508 rm -f $DESTINATION/tmp/Makefile
509 rm -f $DESTINATION/tmp/Make.depends
510 rm -f $DESTINATION/tmp/Make.cidepends
511 rm -f $DESTINATION/tmp/Make.lb
512 rm -f $DESTINATION/tmp/Make.machine
513 rm -f $DESTINATION/tmp/Make.extlib
516 # Create the bin, lib, include, etc. links:
517 WINNAME=`echo $VERSION | awk -F- '{print $2}'`
518 if [ "x_$WINNAME" = "x_win32" -o "x_$WINNAME" = "x_win64" ]
519 then
520 #Win32/64 version needs special compilers and *copied* (not linked)
521 # source files.
522 echo "Copying compilers for $WINNAME into cygwin /bin directory"
523 cp -f $src/$WINNAME/unix2nt* /bin
524 cp $src/win32/system_ln $DESTINATION/tmp
525 cp $src/win32/unistd.h $DESTINATION/tmp
526 echo "Compiling createlink.cpp ..."
527 (cd $src/win32; unix2nt_cc -c createlink.cpp -o createlink.o -D_WIN32_WINNT=0x0500; unix2nt_cc createlink.o)
528 if test ! -x $src/win32/createlink.exe
529 then
530 echo "VC++ is not properly installed!"
531 exit 1
533 echo "Copying $src/win32/createlink.exe to /bin directory"
534 cp $src/win32/createlink.exe /bin
535 chmod +x $DESTINATION/tmp/system_ln
536 cp $src/win32/gathertree.local $DESTINATION/tmp
537 cp $src/win32/gatherflat.local $DESTINATION/tmp
538 else
539 cat > $DESTINATION/tmp/system_ln <<EOF
540 #!/bin/sh
541 ln -f -s \$@
543 chmod +x $DESTINATION/tmp/system_ln
544 for newdir in `echo bin lib lib_so include tmp`
546 Echo "Soft-linking over $newdir"
547 if [ -r $newdir ]
548 then
549 rm -fr $newdir || exit 1
551 $DESTINATION/tmp/system_ln $DESTINATION/$newdir $newdir
552 done
553 rm -f VERSION
554 $DESTINATION/tmp/system_ln $DESTINATION/include/VERSION VERSION
557 $DESTINATION/tmp/system_ln "../../src/scripts/Make.depends" $DESTINATION/tmp/Make.depends
558 $DESTINATION/tmp/system_ln "../../src/scripts/Make.cidepends" $DESTINATION/tmp/Make.cidepends
559 if test -f src/ck-ldb/Make.lb
560 then
561 $DESTINATION/tmp/system_ln "../../src/ck-ldb/Make.lb" $DESTINATION/tmp/Make.lb
562 else
563 touch $DESTINATION/tmp/Make.lb
565 $DESTINATION/tmp/system_ln "../../src/scripts/Makefile" $DESTINATION/tmp/Makefile
566 $DESTINATION/tmp/system_ln "../../src/scripts/Make.tau" $DESTINATION/tmp/Make.tau
567 touch $DESTINATION/tmp/Makefile.machine
568 touch $DESTINATION/tmp/Make.extlib
570 ConvUsr="$DESTINATION/tmp/conv-mach-pre.sh"
571 Echo "Generating $ConvUsr"
572 echo > $ConvUsr
573 if test -n "$LIBDIR"
574 then
575 echo 'USER_OPTS_LD="$USER_OPTS_LD '$LIBDIR'"' >> $ConvUsr
576 echo 'USER_OPTS_LDXX="$USER_OPTS_LDXX '$LIBDIR'"' >> $ConvUsr
578 if test -n "$INCDIR"
579 then
580 echo 'USER_OPTS_CC="$USER_OPTS_CC '$INCDIR'"' >> $ConvUsr
581 echo 'USER_OPTS_CXX="$USER_OPTS_CXX '$INCDIR'"' >> $ConvUsr
583 chmod +x $ConvUsr
585 # Create conv-mach-opt headers with special build-time options
586 ConvHeader="$DESTINATION/tmp/conv-mach-opt.h"
587 ConvSh="$DESTINATION/tmp/conv-mach-opt.sh"
588 if [ ! -f $ConvSh -o ! -f $ConvHeader ]
589 then
590 Echo "Generating $ConvHeader, conv-mach-opt.sh"
591 echo '/* Build-time options header, automatically generated by charm/build*/'> $ConvHeader
592 echo '# Built-time options header, automatically generated by charm/build'> $ConvSh
593 echo '[ -z "$CHARMINC" ] && CHARMINC="."' >> $ConvSh
595 if test -n "$COMPILER"
596 then
597 i="$COMPILER"
598 echo '#include "'cc-$i.h'"' >> $ConvHeader
599 echo '. $CHARMINC/'"cc-$i.sh" >> $ConvSh
601 if test -n "$BOPTS"
602 then
603 for i in $BOPTS
605 echo '#include "'conv-mach-$i.h'"' >> $ConvHeader
606 echo '. $CHARMINC/'"conv-mach-$i.sh" >> $ConvSh
607 done
610 if test "$BUILD_SHARED" = "-build-shared"
611 then
612 echo "CMK_NO_BUILD_SHARED=false" >> $ConvSh
613 else
614 echo "CMK_NO_BUILD_SHARED=true" >> $ConvSh
617 if test -n "$WITH_ROMIO"
618 then
619 echo "CMK_AMPI_WITH_ROMIO=\"true\"" >> $ConvSh
622 if test -n "$WITH_PRODUCTION"
623 then
624 echo '#define CMK_OPTIMIZE 1' >> $ConvHeader
625 # Prepend optimize so that an explicit -no-optimize still works
626 OPTS="-optimize -production $OPTS"
627 CONFIG_OPTS="--disable-controlpoint --disable-tracing --disable-tracing-commthread --disable-charmdebug --disable-replay --disable-error-checking --disable-stats $CONFIG_OPTS"
630 # build with Tau
631 WITH_TAU=0
632 if [ "$PROGRAM" = "Tau" ]
633 then
634 Echo "TAU>>>> makefile config option: $TAU_MAKEFILE"
635 if [ -n "$TAU_MAKEFILE" -a -f $TAU_MAKEFILE ]
636 then
637 #Setting up TAU trace library:
638 Echo "TAU>>>> configuring with this TAU makefile: $TAU_MAKEFILE"
640 WITH_TAU=1
641 else
642 Echo "TAU>>>> ERROR could not find Makefile: $TAU_MAKEFILE, ignored"
643 TAU_MAKEFILE=""
646 [ -z "$TAU_MAKEFILE" ] && TAU_MAKEFILE="Make.tau"
647 SED_CHARMC="s@TAU_MAKEFILE=\(.*\)@TAU_MAKEFILE=$TAU_MAKEFILE@"
649 sed -e $SED_CHARMC src/scripts/Makefile > .Makefile.$$ && cp .Makefile.$$ src/scripts/Makefile && rm -f .Makefile.$$
650 sed -e $SED_CHARMC src/scripts/charmc > .charmc.$$ && cp .charmc.$$ src/scripts/charmc && rm -f .charmc.$$
652 if test $WITH_TAU -eq 1
653 then
654 echo "#define CMK_WITH_TAU 1" >> $ConvHeader
655 echo "#define pthread_create tau_pthread_create" >> $ConvHeader
656 echo "#define pthread_exit tau_pthread_exit" >> $ConvHeader
658 echo "CMK_WITH_TAU=\"true\"" >> $ConvSh
662 echo $BASEVERSION > $DESTINATION/tmp/.vdir
663 echo $BASEVERSION | sed -e 's@-.*@@' > $DESTINATION/tmp/.gdir
665 if test $BUILD_EMULATOR = 1
666 then
667 PROGRAM="$PROGRAM bigsim"
668 # CONFIG_OPTS="--disable-charmdebug $CONFIG_OPTS"
671 printError()
673 Echo "-------------------------------------------------"
674 Echo "Charm++ NOT BUILT. Either cd into $DESTINATION/tmp and try"
675 Echo "to resolve the problems yourself, visit"
676 Echo " http://charm.cs.illinois.edu/"
677 Echo "for more information. Otherwise, email the developers at charm@cs.illinois.edu"
678 exit $MAKEEXIT
681 echo 'BUILDOPTS="'$OPTS'"' >> $ConvSh
683 Echo "Performing '$MAKE $MAKEOPTS basics OPTS="$OPTS" QUIET="$QUIET" CONFIG_OPTS="$CONFIG_OPTS"' in $DESTINATION/tmp"
684 cd $DESTINATION/tmp
685 echo "CONFIG_OPTS=\"$CONFIG_OPTS\"" > config_opts.sh
686 chmod +x config_opts.sh
687 echo "OPTSATBUILDTIME += $OPTS" > buildopts.mk
688 $MAKE $MAKEOPTS basics OPTS="$OPTS $BUILD_SHARED" QUIET="$QUIET"
689 MAKEEXIT=$?
690 [ $MAKEEXIT -ne 0 ] && printError
692 Echo "Performing '$MAKE $MAKEOPTS $PROGRAM OPTS="$OPTS" QUIET="$QUIET"' in $DESTINATION/tmp"
693 $MAKE $MAKEOPTS $PROGRAM OPTS="$OPTS $BUILD_SHARED" QUIET="$QUIET"
694 MAKEEXIT=$?
695 if [ $MAKEEXIT -eq 0 ]
696 then
697 Echo "-------------------------------------------------"
698 Echo "$PROGRAM built successfully."
699 Echo "Next, try out a sample program like" \
700 "$DESTINATION/tests/charm++/simplearrayhello"
701 else
702 printError