3 # Silly shorthand, used for source reorganization
4 if [ $
(dirname $0) = "." ]
9 srcbaseabs
="$(cd $(dirname $0)/src/; pwd)"
12 src
="$srcbaseabs/arch/"
18 echo 'Usage: build <target> <version> <options> [charmc-options ...]'
20 echo '<targets>: converse charm++ LIBS AMPI bigemulator msa'
21 echo '<targets>: doc ps-doc pdf-doc html-doc'
25 echo ' charm++ compile Charm++ core only'
26 echo ' AMPI compile Adaptive MPI on top of Charm++'
27 echo ' LIBS compile additional parallel libraries with Charm++ core'
28 echo ' bigemulator build additional BigSim libraries'
29 echo ' msa build Multiphase Shared Arrays(MSA) library'
30 echo ' Tau build the TAU tracing library for generating TAU performance data'
31 echo ' ChaNGa compile Charm++ core and necessary libraries for ChaNGa'
32 echo ' everylb compile EveryLB suite of load balancing strategies'
36 ( cd $src ; ls -1 |
egrep -v '(^shmem$)|(^mpi$)|(^sim$)|(^netlrts?$)|(^multicore$)|(^util$)|(^common$)|(^uth$)|(^conv-mach-fix.sh$)|(^win64$)|(^(gemini_)?gni$)|(^pami(lrts)?$)|(^verbs$)|(^ofi$)|(^template$)|(^cuda$)' |
pr -3 -t )
38 echo '<options>: compiler and platform specific options'
39 echo 'icc iccstatic xlc xlc64 gcc clang pgcc cc mpicxx'
40 echo 'help smp omp tcp bigemulator ooc syncft mlogft causalft papi pthreads'
41 echo '--incdir --libdir --basedir --build-shared --destination --suffix -j'
45 echo 'For platform specific options, use help option:'
46 echo ' help platform specific help, e.g. ./build charm++ netlrts-linux-x86_64 help'
48 echo 'Choose a compiler (only one option is allowed from this section):'
49 echo ' icc, iccstatic Intel compilers (default or static linking)'
50 echo ' xlc, xlc64 IBM XL compilers (with 64-bit option on architectures with 32-bit modes)'
51 echo ' gcc GNU compiler collection (on platforms where the default differs)'
52 echo ' clang Clang C/C++ compiler (including bgclang)'
53 echo ' pgcc Portland Group compilers'
55 echo 'Choose an alternative fortran compiler (only one option is allowed from this section):'
56 echo ' gfortran GNU Fortran compiler'
57 echo ' flang Flang Fortran compiler'
58 echo ' xlf IBM XL Fortran compiler'
59 echo ' ifort Intel Fortran compiler'
60 echo " pgf90 Portland Group Fortran compiler"
62 echo 'Platform specific options (choose multiple if apply):'
63 echo ' smp support for SMP, multithreaded charm on each node'
64 echo ' omp support for the integrated LLVM OpenMP runtime'
65 echo ' ibverbs use Infiniband Verbs for communication (only for netlrts-linux-x86_64; prefer verbs-*)'
66 echo ' tcp use TCP sockets for communication (only for netlrts)'
67 echo ' pthreads compile with pthreads Converse threads'
69 echo 'Advanced options:'
70 echo ' bigemulator compile for BigSim simulator'
71 echo ' ooc compile with out of core support'
72 echo ' syncft compile with Charm++ fault tolerance support'
73 echo ' mlogft compile with Charm++ message logging fault tolerance support'
74 echo ' papi compile with PAPI performance counter support (if any)'
76 echo "Charm++ dynamic libraries:"
77 echo " --no-build-shared don't build Charm++'s shared libraries (default)"
78 echo " --build-shared build Charm++ dynamic libraries (.so) "
82 echo 'Enable/disable features:'
83 configure_ac
="$srcbaseabs/scripts/configure.ac"
84 parameter_regex
='\([-A-Za-z0-9_=/ ]*\)'
85 description_regex
='\([-A-Za-z0-9_=/ ()\\]*\)'
87 # Isolate the sections of configure.ac on which we want to operate. This command uses sed's p command which gives a result similar to grep.
88 # This is because grep cannot operate on multiple lines. GNU grep can do this using "-z", but it is not portable to BSD grep as found on macOS.
89 help_string_source
="$(sed -n "/AS_HELP_STRING
(\
[${parameter_regex}\
],/,/ *\
[${description_regex}\
])/p
" "$configure_ac")"
91 # This regex matches the AS_HELP_STRING entries in configure.ac.
92 # It looks messy at the end due to matching square brackets (which must be escaped), commas, and an unrelated token on the same line (a BSD sed concession).
93 help_item_regex
=" *\[AS_HELP_STRING(\[${parameter_regex}\],\n *\[${description_regex}\]) *\]*[, []*[a-z=_]*\]*[, ]*"
94 # "\1" is the parameter and "\2" is the description; use printf to left-justify the parameter.
95 help_output_print
='printf " %-30s \2\\\\n" "\1"'
96 # The remaining sed syntax allows us to perform a substitution over two successive lines instead of only one.
97 help_items
="$(echo "$help_string_source" | sed -n "1h
; 1!H
; \
${ g; s:${help_item_regex}:${help_output_print}:g p; }")"
98 # With the AS_HELP_STRING entries replaced with printf commands, evaluate the result.
100 printf " %-30s %s\n" "--with-production" "build Charm++ with all optimizations for maximum performance, and disabling all above features"
102 # Test that the above regular expressions are sufficient to capture all help strings.
103 num_help_strings
="$(grep -c AS_HELP_STRING "$configure_ac")"
104 num_help_items
="$(echo "$help_items" | wc -l)"
105 if [ $num_help_strings != $num_help_items ]; then
106 echo '<Warning>: Not all parameters were able to be displayed. Please notify the Charm++ developers at charm@cs.illinois.edu.'
111 echo 'Miscellaneous options:'
112 echo ' --incdir=DIR specify additional include path for compiler'
113 echo ' --libdir=DIR specify additional lib path for compiler'
114 echo ' --basedir=DIR shortcut for the above two - DIR/include and DIR/lib'
115 echo ' -j[N] parallel make, N is the number of paralle make jobs'
116 echo " --with-lbtime-type specify real type for the load balancing timers"
117 echo " --destination=DIR build Charm++ inside DIR, by default the destination is <version>"
118 echo " --suffix=DIR append DIR to the destination directory of the Charm++ build"
119 echo " --tau-makefile=FILE Specify which TAU stub makefile to use"
122 echo '<charmc-options>: normal compiler options e.g. -g -optimize -save -verbose'
127 echo "1. display all supported options for netlrts-linux-x86_64 using 'help':"
128 echo ' ./build charm++ netlrts-linux-x86_64 help'
129 echo '2. compile Charm++ on Linux with all available tuning:'
130 echo ' ./build charm++ netlrts-linux-x86_64 --with-production'
131 echo '3. compile Charm++ for Linux with Intel compiler and optimizations:'
132 echo ' ./build charm++ netlrts-linux-x86_64 icc -optimize'
133 echo '4. compile Charm++ for Windows with VC++:'
134 echo ' ./build charm++ netlrts-win-x86_64 -optimize'
135 echo '5. compile Charm++ with MPI that is installed at /usr/local/mpich:'
136 echo ' ./build charm++ mpi-linux-x86_64 --incdir /usr/local/mpich/include --libdir /usr/local/mpich/lib -optimize'
138 echo ' ./build charm++ mpi-linux-x86_64 --basedir /usr/local/mpich -optimize'
139 echo ' ./build Tau --tau-makefile=/usr/local/packages/TAU/x86_64/lib/Makefile.tau-mpi'
141 echo 'Note: This script:'
142 echo ' 1. Creates directories <destination> and <destination>/tmp'
143 echo ' 2. Copies src/scripts/Makefile into <destination>/tmp'
144 echo ' 3. Does a "make basics" in <destination>/tmp.'
145 echo ' 3. Does a "make -jN <target> <version> OPTS=<charmc-options>" in <destination>/tmp.'
146 echo "That's all build does. The rest is handled by the Makefile."
148 echo 'Thank you for using Charm++, please send questions or comments to '
149 echo 'Parallel Programming Lab at University of Illinois at Urbana-Champaign'
150 echo '(email: charm@cs.illinois.edu).'
154 echo "To get more detailed help, run ./build --help"
159 [ "x$QUIET" = "x--quiet" ] ||
echo $
*
163 for prefix
in cc conv-mach
165 str
="Supported compilers:"
166 [ "$prefix" = "conv-mach" ] && str
="Supported options:"
170 # echo "Checking for $prefix in $dir"
171 files
=`cd $dir; ls $prefix-*.h 2>/dev/null`
172 opts
="$opts "`echo $files | sed 's/'$prefix'-\([^.]*\).h/\1/g'`
175 rm -f $tmp; touch $tmp
180 opts
=`sort $tmp | uniq`
192 echo Error
: cannot
find $d!
201 [ -f $dir/cc-
$1.sh
] && return 1
209 [ -f $dir/conv-mach-
$1.h
] && return 1
212 echo "Error> option: $1 is not supported in this version!";
229 BUILD_SHARED
="" # default no shared lib
230 WITH_ROMIO
="true" # default to building ROMIO on AMPI
234 DESTINATION_SUFFIX
=""
240 [ "$1" = '--help' -o "$1" = '-h' ] && more=1 && syntax |
( less ||
more ) && exit 1
241 [ $# -lt 2 ] && $
(dirname "$0")/smart-build.pl
&& exit 1
245 # find longest prefix of version argument that exists as a directory in $src
253 if [ -z "$testversion" ]; then
256 testversion
="$testversion-$w"
258 if [ -d $src/$testversion ]; then
262 VERSOPTS
="$VERSOPTS $w"
265 if [ $VERSION = $1 ]; then VERSOPTS
=""; fi
267 BASEVERSION
=$VERSION;
268 if test -f $src/$BASEVERSION/vdir_link
270 BASEVERSION
=`cat $src/$BASEVERSION/vdir_link`
272 ARCH
=`echo $BASEVERSION | sed -e 's@-.*@@'`
279 OPT_DIRS
="$src/$BASEVERSION $src/$ARCH $src/common"
281 # process remainder of version argument as options, copied from below
282 for w
in $VERSOPTS; do
283 # This has to be a build-time option (like "smp")
287 # It specifies a compiler:
288 if [ ! -z "$COMPILER" ]
290 echo "Error> Tried to specify two compilers: $COMPILER and $w"
295 # It specifies some other option:
298 [ $w = "bigemulator" ] && BUILD_EMULATOR
=1
299 [ $w = "bigsim" ] && BUILD_EMULATOR
=1
300 [ $w = "cuda" ] && BUILD_CUDA
=1
311 CheckDir
$dir/include
$dir/lib
312 LIBDIR
="$LIBDIR -L$dir/lib";
313 INCDIR
="$INCDIR -I$dir/include"
318 basedir
=`echo $1 | awk -F= '{print $2}'`
321 CheckDir
$dir/include
$dir/lib
322 LIBDIR
="$LIBDIR -L$dir/lib";
323 INCDIR
="$INCDIR -I$dir/include"
331 LIBDIR
="$LIBDIR -L$dir";
336 libdir
=`echo $1 | awk -F= '{print $2}'`
340 LIBDIR
="$LIBDIR -L$dir";
348 INCDIR
="$INCDIR -I$dir";
353 incdir
=`echo $1 | awk -F= '{print $2}'`
357 INCDIR
="$INCDIR -I$dir";
361 --no-build-shared|
--no-shared)
362 #BUILD_SHARED="-no-build-shared";
366 BUILD_SHARED
="-build-shared";
370 WITH_ROMIO
="true"; shift
376 WITH_PRODUCTION
="true"
380 CONFIG_OPTS
="$CONFIG_OPTS $1"
384 CONFIG_OPTS
="$CONFIG_OPTS $1"
393 DESTINATION
="`echo $1 | awk -F= '{print $2}'`"
398 DESTINATION_SUFFIX
="$1"
402 DESTINATION_SUFFIX
="`echo $1 | awk -F= '{print $2}'`"
410 TAU_MAKEFILE
=`echo $1 | awk -F= '{print $2}'`
414 MAKEOPTS
="$MAKEOPTS --quiet"
419 ONLY_CONFIGURE
="true"
422 --enable-tracing|
--enable-tracing=*)
423 CONFIG_OPTS
="$CONFIG_OPTS $1"
428 CONFIG_OPTS
="$CONFIG_OPTS $1"
432 CONFIG_OPTS
="$CONFIG_OPTS $1"
436 PMAKENUM
=`echo $1 | awk -Fj '{print $2}'`
437 MAKEOPTS
="$MAKEOPTS -j $PMAKENUM"
441 MAKEOPTS
="$MAKEOPTS $1"
445 # We hit a real compiler option (like -g, or -Dfoo),
446 # so just copy over all remaining options
449 OPTS
="$OPTS $1"; shift
456 # This has to be a build-time option (like "smp")
460 # It specifies a compiler:
461 if [ ! -z "$COMPILER" ]
463 echo "Error> Tried to specify two compilers: $COMPILER and $1"
468 # It specifies some other option:
471 [ $1 = "bigemulator" ] && BUILD_EMULATOR
=1
472 [ $1 = "bigsim" ] && BUILD_EMULATOR
=1
473 [ $1 = "cuda" ] && BUILD_CUDA
=1
480 if [ $BUILD_CUDA -eq 1 ]; then
482 echo "checking for CUDA toolkit directory"
483 CUDA_PRESET_DIRS
="/usr/local/cuda /usr/lib/nvidia-cuda-toolkit"
484 CUDA_CANDIDATE_DIRS
="$CUDATOOLKIT_HOME $CUDA_PRESET_DIRS"
485 for dir
in $CUDA_CANDIDATE_DIRS; do
486 if test -d "$dir"; then
489 echo "CUDA_DIR=$CUDA_DIR"
493 if [ "$HAVE_CUDA" = "no" ]; then
494 echo "Error> no CUDA toolkit found, searched \$CUDATOOLKIT_HOME $CUDA_PRESET_DIRS"
499 [ "x$VERSION" = "x" ] && syntax
&& exit 1
501 if [ "x_$ARCH" = "x_net" ]; then
502 echo "Error: net-* has been removed, please use netlrts or verbs.";
506 #Check if building verbs on Omni-Path
507 if [ "x_$ARCH" = "x_verbs" ] && type /usr
/sbin
/opafabricinfo
>/dev
/null
2>&1; then
508 echo "WARNING: Detected Omni-Path diagnostic tools.";
509 echo "Verbs on Omni-Path architectures is not well supported: please use an OFI build instead.";
512 if test -n "$WITH_PRODUCTION" -a $BUILD_EMULATOR -eq 1 -a -z "$ENABLE_TRACING"
514 echo "Error: bigemulator requires tracing modules, --with-production must be used with --enable-tracing"
521 MAKE
=`which gmake 2>/dev/null`
522 [ -z "$MAKE" -o ! -x "$MAKE" ] && MAKE
='make'
525 if [ ! -f $src/$BASEVERSION/conv-mach.h
]
527 echo "Error> build can not find arch: $BASEVERSION!"
531 if [ ! -f "$srcbaseabs/scripts/configure" ]
533 if ! command -v autoreconf
>/dev
/null
2>&1 ||
! command -v aclocal
>/dev
/null
2>&1
535 echo "Error> autoconf and automake are not installed."
540 #generate header for uFcontext for the target VERSION
541 UFCONTEXT_HEADER_NAME
=
542 if test `echo "$BASEVERSION" | grep -c "darwin"` -gt 0
544 UFCONTEXT_HEADER_NAME
="macho_gas"
545 elif test `echo "$BASEVERSION" | grep -c "win"` -gt 0
547 UFCONTEXT_HEADER_NAME
="windows"
549 UFCONTEXT_HEADER_NAME
="elf_gas"
552 if test `echo "$BASEVERSION" | grep -c "arm"` -gt 0
554 UFCONTEXT_HEADER_NAME
="arm_aapcs_${UFCONTEXT_HEADER_NAME}"
555 elif test `echo "$BASEVERSION" | grep -c "mips"` -gt 0
557 UFCONTEXT_HEADER_NAME
="mips32_o32_${UFCONTEXT_HEADER_NAME}"
558 elif test `echo "$BASEVERSION" | grep -c "bluegene\|pami\|ppc"` -gt 0
560 UFCONTEXT_HEADER_NAME
="ppc64_sysv_${UFCONTEXT_HEADER_NAME}"
561 elif test `echo "$BASEVERSION" | grep -c "cray\|x86_64\|linux64\|amd64"` -gt 0
563 UFCONTEXT_HEADER_NAME
="x86_64_sysv_${UFCONTEXT_HEADER_NAME}"
565 UFCONTEXT_HEADER_NAME
="i386_sysv_${UFCONTEXT_HEADER_NAME}"
568 #generate VERSION name combining all the build-time options.
569 if [ -n "$BOPTS" -o -n "$COMPILER" ]
571 echo "Selected Compiler: $COMPILER"
573 if test -n "$COMPILER" -a `echo "$BASEVERSION" | grep -c "cray\|gni\|gemini"` -gt 0
575 echo "Inserted explicit compiler options on Cray systems. Use compiler wrappers by loading PrgEnv-*"
576 echo "e.g.) module load PrgEnv-* (e.g. cray for cce, gnu for gcc, intel for icc, and pgi for pgcc)"
577 echo " ./build charm++ $BASEVERSION <other build options>"
578 echo "Charm++ uses the compiler wrapper 'CC' specified by the Cray system. Don't use explicit compiler options on Cray systems."
582 if test `echo "$BOPTS" | grep -c "omp"` -gt 0 -a `echo "$BASEVERSION" | grep -c "darwin"` -gt 0
584 if test -z "$COMPILER" -o "$COMPILER" != "gcc"
586 echo "The integrated OpenMP runtime library is supported on Mac only with the normal gcc"
587 echo "You need to install this normal (non-clang) gcc via MacPorts or Homebrew"
588 echo "Read the instructions on the Charm++ manual."
592 echo "Selected Options: $BOPTS"
593 SORTED
=`echo $BOPTS | awk '{ for (i = 1; i <= NF; ++i) print $i }' | sort`
594 BOPTS_WITHCOMPILER
=`echo $SORTED $COMPILER`
595 for i
in $BOPTS_WITHCOMPILER
601 #echo "|$DESTINATION|$DESTINATION_SUFFIX|"
603 if [ -z "$DESTINATION" ]
605 DESTINATION
="$VERSION"
608 if [ $
(dirname $DESTINATION) != "." ]
610 srcbaseabs
="$(cd $srcbaseabs; pwd)"
612 src
="$srcbaseabs/arch/"
615 if [ -n "$DESTINATION_SUFFIX" ]
617 DESTINATION
="$DESTINATION-$DESTINATION_SUFFIX"
620 [ -d $DESTINATION ] || Echo
"Creating dir: $DESTINATION"
621 [ -d $DESTINATION ] || mkdir
$DESTINATION
622 [ -d $DESTINATION/tmp
] || Echo
"Creating dir: $DESTINATION/tmp"
623 [ -d $DESTINATION/tmp
] || mkdir
$DESTINATION/tmp
625 Echo
"Copying src/scripts/Makefile to $DESTINATION/tmp"
626 rm -f $DESTINATION/tmp
/Makefile
627 rm -f $DESTINATION/tmp
/Make.depends
628 rm -f $DESTINATION/tmp
/Make.cidepends
629 rm -f $DESTINATION/tmp
/Make.lb
630 rm -f $DESTINATION/tmp
/Make.gpu
631 rm -f $DESTINATION/tmp
/Makefile.machine
632 rm -f $DESTINATION/tmp
/Make.extlib
634 echo "TARGET=${UFCONTEXT_HEADER_NAME}" > $DESTINATION/tmp
/uFcontext.mk
636 # Create the bin, lib, include, etc. links:
637 WINNAME
=`echo $VERSION | awk -F- '{print $2}'`
638 if [ "x_$WINNAME" = "x_win64" -o "x_$WINNAME" = "x_win" ]
640 #Win64 version needs special compilers and *copied* (not linked)
642 cp $src/win
/system_ln
$DESTINATION/tmp
643 cp $src/win
/unistd.h
$DESTINATION/tmp
644 echo "Compiling createlink.cpp ..."
645 (cd $src/win
; .
/unix2nt_cc
-c createlink.cpp
-o createlink.o
-D_WIN32_WINNT=0x0500; .
/unix2nt_cc createlink.o
)
647 if test ! -x $src/win
/createlink.exe
649 echo "VC++ is not properly installed!"
652 chmod +x
$DESTINATION/tmp
/system_ln
653 cp $src/win
/gathertree.
local $DESTINATION/tmp
654 cp $src/win
/gatherflat.
local $DESTINATION/tmp
656 cat > $DESTINATION/tmp
/system_ln
<<EOF
660 chmod +x
$DESTINATION/tmp
/system_ln
661 for newdir
in `echo bin lib lib_so include tmp`
663 Echo
"Soft-linking over $newdir"
666 rm -fr $newdir ||
exit 1
668 $DESTINATION/tmp
/system_ln
$DESTINATION/$newdir $newdir
671 $DESTINATION/tmp
/system_ln
$DESTINATION/include
/VERSION VERSION
674 $DESTINATION/tmp
/system_ln
"$srcbase/scripts/Make.depends" $DESTINATION/tmp
/Make.depends
675 $DESTINATION/tmp
/system_ln
"$srcbase/scripts/Make.cidepends" $DESTINATION/tmp
/Make.cidepends
676 if test -f "$srcbaseabs/ck-ldb/Make.lb"
678 $DESTINATION/tmp
/system_ln
"$srcbase/ck-ldb/Make.lb" $DESTINATION/tmp
/Make.lb
680 touch $DESTINATION/tmp
/Make.lb
682 $DESTINATION/tmp
/system_ln
"$srcbase/scripts/Makefile" $DESTINATION/tmp
/Makefile
683 $DESTINATION/tmp
/system_ln
"$srcbase/scripts/Make.tau" $DESTINATION/tmp
/Make.tau
684 $DESTINATION/tmp
/system_ln
"$srcbase/scripts/Make.gpu" $DESTINATION/tmp
/Make.gpu
685 touch $DESTINATION/tmp
/Makefile.machine
686 touch $DESTINATION/tmp
/Make.extlib
688 ConvUsr
="$DESTINATION/tmp/conv-mach-pre.sh"
689 Echo
"Generating $ConvUsr"
693 echo 'USER_OPTS_LD="$USER_OPTS_LD '$LIBDIR'"' >> $ConvUsr
694 echo 'USER_OPTS_LDXX="$USER_OPTS_LDXX '$LIBDIR'"' >> $ConvUsr
698 echo 'USER_OPTS_CC="$USER_OPTS_CC '$INCDIR'"' >> $ConvUsr
699 echo 'USER_OPTS_CXX="$USER_OPTS_CXX '$INCDIR'"' >> $ConvUsr
703 # Create conv-mach-opt headers with special build-time options
704 ConvHeader
="$DESTINATION/tmp/conv-mach-opt.h"
705 ConvSh
="$DESTINATION/tmp/conv-mach-opt.sh"
706 if [ ! -f $ConvSh -o ! -f $ConvHeader ]
708 Echo
"Generating $ConvHeader, conv-mach-opt.sh"
709 echo '/* Build-time options header, automatically generated by charm/build*/'> $ConvHeader
710 echo '# Built-time options header, automatically generated by charm/build'> $ConvSh
711 echo '[ -z "$CHARMINC" ] && CHARMINC="."' >> $ConvSh
713 if test -n "$COMPILER"
716 echo '#include "'cc-
$i.h
'"' >> $ConvHeader
717 echo '. $CHARMINC/'"cc-$i.sh" >> $ConvSh
718 elif test `echo "$BASEVERSION" | grep -c "bluegeneq"` -gt 0
721 bgclang
++11 --version
722 if [ $?
-ne 0 ]; then
723 echo "ERROR: bgclang C/C++ compiler missing. Please load bgclang compilers, i.e. 'soft add +mpiwrapper-bgclang'."
726 echo '#include "'cc-
$i.h
'"' >> $ConvHeader
727 echo '. $CHARMINC/'"cc-$i.sh" >> $ConvSh
731 # pxshm+smp note: When combining the 'smp' and 'pxshm' directives, it is
732 # important that they be included in $ConvHeader in that
733 # exact order. See bug #717.
738 if [ "$i" = "smp" ]; then
740 elif [ "$i" = "pxshm" ]; then
742 elif [ "$i" = "omp" ]; then
749 if [ $HAS_PXSHM -eq 1 ]; then
752 if [ $HAS_SMP -eq 1 ]; then
754 elif [ $BUILD_OMP -eq 1 ]; then
755 BUILD_OMP
=2 #this means omp keyword inserted without smp keyword"
761 echo '#include "'conv-mach-
$i.h
'"' >> $ConvHeader
762 if [ $BUILD_CUDA -eq 1 ]; then
763 echo 'CUDA_DIR="'$CUDA_DIR'"'>>$ConvSh
765 echo '. $CHARMINC/'"conv-mach-$i.sh" >> $ConvSh
769 if test "$BUILD_SHARED" = "-build-shared"
771 echo "CMK_NO_BUILD_SHARED=false" >> $ConvSh
773 echo "CMK_NO_BUILD_SHARED=true" >> $ConvSh
776 if test -n "$WITH_ROMIO"
778 echo "CMK_AMPI_WITH_ROMIO=\"true\"" >> $ConvSh
781 if test -n "$WITH_PRODUCTION"
783 echo '#define CMK_OPTIMIZE 1' >> $ConvHeader
784 # Prepend optimize so that an explicit -no-optimize still works
785 OPTS
="-optimize -production $OPTS"
786 CONFIG_OPTS
="--disable-controlpoint --disable-tracing --disable-tracing-commthread --disable-charmdebug --disable-replay --disable-error-checking --disable-stats $CONFIG_OPTS"
791 if [ "$PROGRAM" = "Tau" ]
793 Echo
"TAU>>>> makefile config option: $TAU_MAKEFILE"
794 if [ -n "$TAU_MAKEFILE" -a -f $TAU_MAKEFILE ]
796 #Setting up TAU trace library:
797 Echo
"TAU>>>> configuring with this TAU makefile: $TAU_MAKEFILE"
801 Echo
"TAU>>>> ERROR could not find Makefile: $TAU_MAKEFILE, ignored"
806 if test $WITH_TAU -eq 1
808 [ -z "$TAU_MAKEFILE" ] && TAU_MAKEFILE
="Make.tau"
809 SED_CHARMC
="s@TAU_MAKEFILE=\(.*\)@TAU_MAKEFILE=$TAU_MAKEFILE@"
811 sed -e $SED_CHARMC $srcbaseabs/scripts
/Makefile
> .Makefile.$$
&& cp .Makefile.$$
$srcbaseabs/scripts
/Makefile
&& rm -f .Makefile.$$
812 sed -e $SED_CHARMC $srcbaseabs/scripts
/charmc
> .charmc.$$
&& cp .charmc.$$
$srcbaseabs/scripts
/charmc
&& rm -f .charmc.$$
814 echo "#define CMK_WITH_TAU 1" >> $ConvHeader
815 echo "#define pthread_create tau_pthread_create" >> $ConvHeader
816 echo "#define pthread_exit tau_pthread_exit" >> $ConvHeader
818 echo "CMK_WITH_TAU=\"true\"" >> $ConvSh
821 if [ "$PROGRAM" = "ChaNGa" ]
823 #Setting lbuserdata when the build is ChaNGa
824 CONFIG_OPTS
="--enable-lbuserdata $CONFIG_OPTS"
827 echo $BASEVERSION > $DESTINATION/tmp
/.
vdir
828 echo $BASEVERSION |
sed -e 's@-.*@@' > $DESTINATION/tmp
/.gdir
830 if test $BUILD_EMULATOR = 1
832 # export BIGSIM so that make targets can depend on it
833 MAKEOPTS
="$MAKEOPTS BIGSIM=bigsim"
834 PROGRAM
="$PROGRAM bigsim"
838 if [ $BUILD_OMP = 2 ]
845 echo "OpenMP support should be built in SMP mode"
853 Echo
"-------------------------------------------------"
854 Echo
"Charm++ NOT BUILT. Either cd into $DESTINATION/tmp and try"
855 Echo
"to resolve the problems yourself, visit"
856 Echo
" http://charm.cs.illinois.edu/"
857 Echo
"for more information. Otherwise, email the developers at charm@cs.illinois.edu"
861 echo 'BUILDOPTS="'$OPTS'"' >> $ConvSh
862 echo "SRCBASE=$srcbase" > $DESTINATION/tmp
/charmpath.mk
864 Echo
"Performing '$MAKE $MAKEOPTS basics OPTS="$OPTS" QUIET="$QUIET" CONFIG_OPTS="$CONFIG_OPTS"' in $DESTINATION/tmp"
866 echo "CONFIG_OPTS=\"$CONFIG_OPTS\"" > config_opts.sh
867 chmod +x config_opts.sh
868 echo "OPTSATBUILDTIME += $OPTS" > buildopts.mk
869 $MAKE $MAKEOPTS basics OPTS
="$OPTS $BUILD_SHARED" QUIET
="$QUIET"
871 [ $MAKEEXIT -ne 0 ] && printError
873 if test -n "$ONLY_CONFIGURE"
878 Echo
"Performing '$MAKE $MAKEOPTS $PROGRAM OPTS="$OPTS" QUIET="$QUIET"' in $DESTINATION/tmp"
879 $MAKE $MAKEOPTS $PROGRAM OPTS
="$OPTS $BUILD_SHARED" QUIET
="$QUIET"
881 if [ $MAKEEXIT -eq 0 ]
883 if [ $BUILD_OMP = 1 ];
885 $MAKE MFLAGS
="$MAKEOPTS" openmp_llvm OPTS
="$OPTS $BUILD_SHARED" QUIET
="$QUIET"
887 Echo
"-------------------------------------------------"
888 Echo
"$PROGRAM built successfully."
889 Echo
"Next, try out a sample program like" \
890 "$DESTINATION/tests/charm++/simplearrayhello"