head	1.136;
access;
symbols
	charm6_1:1.136
	charm_6_0_1:1.136
	charm6_0_1:1.135
	charm6_0:1.117
	ChaNGa_1-0:1.112
	charm5_9:1.100
	charm_5-4-2:1.24
	charm_5-4-1:1.6;
locks; strict;
comment	@# @;


1.136
date	2009.02.14.14.43.44;	author gzheng;	state Exp;
branches;
next	1.135;
commitid	HZ5m4YnZ6HrwApCt;

1.135
date	2009.02.10.16.25.30;	author gzheng;	state Exp;
branches;
next	1.134;
commitid	9NsZGsfAOODrhUBt;

1.134
date	2009.02.09.16.47.23;	author gzheng;	state Exp;
branches;
next	1.133;
commitid	XwtOkfysXxwYqMBt;

1.133
date	2009.01.31.05.46.59;	author gzheng;	state Exp;
branches;
next	1.132;
commitid	ZUkgVMnV4Z1l4zAt;

1.132
date	2009.01.29.22.28.08;	author gzheng;	state Exp;
branches;
next	1.131;
commitid	2bmFZLPCVnuNFoAt;

1.131
date	2009.01.22.16.08.04;	author gzheng;	state Exp;
branches;
next	1.130;
commitid	HGY318NUbsalNszt;

1.130
date	2008.11.24.19.47.14;	author gzheng;	state Exp;
branches;
next	1.129;
commitid	Toy0xsS4r1S6UTrt;

1.129
date	2008.11.24.18.00.35;	author gzheng;	state Exp;
branches;
next	1.128;
commitid	FdlTILi8Sd9tjTrt;

1.128
date	2008.11.24.17.45.27;	author gzheng;	state Exp;
branches;
next	1.127;
commitid	eXL5hpB2nkujeTrt;

1.127
date	2008.11.22.03.58.25;	author cheelee;	state Exp;
branches;
next	1.126;
commitid	FSz2ZeuEX9fxIyrt;

1.126
date	2008.10.05.00.35.03;	author phil;	state Exp;
branches;
next	1.125;
commitid	plc2QD3yBlyx8nlt;

1.125
date	2008.09.18.23.53.22;	author gioachin;	state Exp;
branches;
next	1.124;
commitid	Xa1tfDhwCpb6qjjt;

1.124
date	2008.07.09.05.05.57;	author gzheng;	state Exp;
branches;
next	1.123;
commitid	U1LGkc8wh4xEs5at;

1.123
date	2008.07.07.02.00.18;	author gzheng;	state Exp;
branches;
next	1.122;
commitid	avrr1hrGI0w1vO9t;

1.122
date	2008.07.06.05.40.18;	author gzheng;	state Exp;
branches;
next	1.121;
commitid	YlVF8YgYpcyzKH9t;

1.121
date	2008.06.26.05.17.13;	author gzheng;	state Exp;
branches;
next	1.120;
commitid	lE8QJ7CVBLbAWp8t;

1.120
date	2008.06.17.01.09.14;	author gioachin;	state Exp;
branches;
next	1.119;
commitid	SkSFaQJXd7muRe7t;

1.119
date	2008.05.19.23.57.00;	author gioachin;	state Exp;
branches;
next	1.118;
commitid	W60e1NYqwK4umD3t;

1.118
date	2008.05.15.21.33.40;	author gzheng;	state Exp;
branches;
next	1.117;
commitid	IaCZWCnCblqcH63t;

1.117
date	2007.12.10.23.55.18;	author idooley2;	state Exp;
branches;
next	1.116;
commitid	204c475dd1cb4567;

1.116
date	2007.07.05.19.25.00;	author gzheng;	state Exp;
branches;
next	1.115;
commitid	3802468d45884567;

1.115
date	2007.06.06.21.31.05;	author gzheng;	state Exp;
branches;
next	1.114;
commitid	101e466727904567;

1.114
date	2007.06.06.20.12.00;	author schak;	state Exp;
branches;
next	1.113;
commitid	6a0c466714f64567;

1.113
date	2007.06.06.20.11.00;	author schak;	state Exp;
branches;
next	1.112;
commitid	69bf466714c44567;

1.112
date	2006.12.01.10.19.12;	author gzheng;	state Exp;
branches;
next	1.111;
commitid	52b24570018c4567;

1.111
date	2006.08.01.20.07.43;	author cheelee;	state Exp;
branches;
next	1.110;

1.110
date	2006.07.11.04.22.12;	author gzheng;	state Exp;
branches;
next	1.109;

1.109
date	2006.04.17.16.58.32;	author skymusic;	state Exp;
branches;
next	1.108;

1.108
date	2006.03.17.21.42.27;	author kunzman;	state Exp;
branches;
next	1.107;

1.107
date	2006.02.26.05.45.44;	author gzheng;	state Exp;
branches;
next	1.106;

1.106
date	2006.02.10.19.08.28;	author gzheng;	state Exp;
branches;
next	1.105;

1.105
date	2006.02.04.17.05.47;	author gzheng;	state Exp;
branches;
next	1.104;

1.104
date	2005.11.20.21.16.39;	author gzheng;	state Exp;
branches;
next	1.103;

1.103
date	2005.09.05.04.19.37;	author gzheng;	state Exp;
branches;
next	1.102;

1.102
date	2005.08.31.16.38.35;	author gzheng;	state Exp;
branches;
next	1.101;

1.101
date	2005.08.23.15.56.07;	author gzheng;	state Exp;
branches;
next	1.100;

1.100
date	2005.04.01.00.42.49;	author gzheng;	state Exp;
branches;
next	1.99;

1.99
date	2005.03.31.20.40.49;	author gzheng;	state Exp;
branches;
next	1.98;

1.98
date	2005.03.06.17.49.27;	author gzheng;	state Exp;
branches;
next	1.97;

1.97
date	2005.01.21.08.29.15;	author gzheng;	state Exp;
branches;
next	1.96;

1.96
date	2005.01.17.04.03.44;	author gzheng;	state Exp;
branches;
next	1.95;

1.95
date	2005.01.16.06.35.23;	author gzheng;	state Exp;
branches;
next	1.94;

1.94
date	2005.01.16.05.17.59;	author gzheng;	state Exp;
branches;
next	1.93;

1.93
date	2004.12.25.06.31.33;	author gzheng;	state Exp;
branches;
next	1.92;

1.92
date	2004.10.22.19.31.45;	author gzheng;	state Exp;
branches;
next	1.91;

1.91
date	2004.08.24.19.40.57;	author gzheng;	state Exp;
branches;
next	1.90;

1.90
date	2004.08.02.17.10.02;	author olawlor;	state Exp;
branches;
next	1.89;

1.89
date	2004.07.22.03.32.16;	author gzheng;	state Exp;
branches;
next	1.88;

1.88
date	2004.07.19.21.41.41;	author gzheng;	state Exp;
branches;
next	1.87;

1.87
date	2004.07.02.15.25.46;	author jdesouza;	state Exp;
branches;
next	1.86;

1.86
date	2004.06.21.20.00.05;	author chao;	state Exp;
branches;
next	1.85;

1.85
date	2004.05.25.21.24.25;	author gzheng;	state Exp;
branches;
next	1.84;

1.84
date	2004.03.31.03.11.24;	author gzheng;	state Exp;
branches;
next	1.83;

1.83
date	2004.03.12.02.18.13;	author cheelee;	state Exp;
branches;
next	1.82;

1.82
date	2004.01.11.20.34.43;	author gzheng;	state Exp;
branches;
next	1.81;

1.81
date	2004.01.11.19.34.06;	author gzheng;	state Exp;
branches;
next	1.80;

1.80
date	2003.12.25.23.27.11;	author gzheng;	state Exp;
branches;
next	1.79;

1.79
date	2003.12.25.23.02.33;	author gzheng;	state Exp;
branches;
next	1.78;

1.78
date	2003.12.19.19.28.54;	author gzheng;	state Exp;
branches;
next	1.77;

1.77
date	2003.12.19.04.11.07;	author gzheng;	state Exp;
branches;
next	1.76;

1.76
date	2003.12.19.04.05.23;	author gzheng;	state Exp;
branches;
next	1.75;

1.75
date	2003.10.24.15.29.00;	author gzheng;	state Exp;
branches;
next	1.74;

1.74
date	2003.10.24.06.59.19;	author gzheng;	state Exp;
branches;
next	1.73;

1.73
date	2003.10.23.01.58.43;	author gzheng;	state Exp;
branches;
next	1.72;

1.72
date	2003.09.29.21.00.21;	author gzheng;	state Exp;
branches;
next	1.71;

1.71
date	2003.09.27.20.02.27;	author gzheng;	state Exp;
branches;
next	1.70;

1.70
date	2003.09.27.17.35.48;	author gzheng;	state Exp;
branches;
next	1.69;

1.69
date	2003.09.27.16.44.44;	author gzheng;	state Exp;
branches;
next	1.68;

1.68
date	2003.09.26.18.37.07;	author gzheng;	state Exp;
branches;
next	1.67;

1.67
date	2003.09.26.18.35.04;	author gzheng;	state Exp;
branches;
next	1.66;

1.66
date	2003.09.26.17.57.17;	author gzheng;	state Exp;
branches;
next	1.65;

1.65
date	2003.09.26.15.20.42;	author gzheng;	state Exp;
branches;
next	1.64;

1.64
date	2003.08.14.03.22.13;	author gzheng;	state Exp;
branches;
next	1.63;

1.63
date	2003.08.10.18.09.08;	author gzheng;	state Exp;
branches;
next	1.62;

1.62
date	2003.08.03.16.25.31;	author gzheng;	state Exp;
branches;
next	1.61;

1.61
date	2003.08.03.06.26.15;	author gzheng;	state Exp;
branches;
next	1.60;

1.60
date	2003.07.22.18.00.32;	author gzheng;	state Exp;
branches;
next	1.59;

1.59
date	2003.06.09.16.13.06;	author gzheng;	state Exp;
branches;
next	1.58;

1.58
date	2003.06.06.15.39.45;	author gzheng;	state Exp;
branches;
next	1.57;

1.57
date	2003.06.05.07.26.54;	author gzheng;	state Exp;
branches;
next	1.56;

1.56
date	2003.05.25.18.44.09;	author gzheng;	state Exp;
branches;
next	1.55;

1.55
date	2003.05.25.18.26.33;	author gzheng;	state Exp;
branches;
next	1.54;

1.54
date	2002.07.19.22.39.51;	author olawlor;	state Exp;
branches;
next	1.53;

1.53
date	2002.05.28.04.22.41;	author gzheng;	state Exp;
branches;
next	1.52;

1.52
date	2002.05.17.15.02.04;	author olawlor;	state Exp;
branches;
next	1.51;

1.51
date	2002.05.16.23.13.58;	author olawlor;	state Exp;
branches;
next	1.50;

1.50
date	2002.05.15.22.41.52;	author olawlor;	state Exp;
branches;
next	1.49;

1.49
date	2002.04.25.22.47.16;	author gzheng;	state Exp;
branches;
next	1.48;

1.48
date	2002.04.13.13.58.44;	author olawlor;	state Exp;
branches;
next	1.47;

1.47
date	2002.04.12.18.55.44;	author milind;	state Exp;
branches;
next	1.46;

1.46
date	2002.04.12.18.53.15;	author milind;	state Exp;
branches;
next	1.45;

1.45
date	2002.04.09.21.44.56;	author gzheng;	state Exp;
branches;
next	1.44;

1.44
date	2002.04.04.21.52.18;	author olawlor;	state Exp;
branches;
next	1.43;

1.43
date	2002.02.16.23.52.07;	author gzheng;	state Exp;
branches;
next	1.42;

1.42
date	2002.02.16.23.45.40;	author gzheng;	state Exp;
branches;
next	1.41;

1.41
date	2002.01.29.23.47.29;	author gzheng;	state Exp;
branches;
next	1.40;

1.40
date	2002.01.14.02.49.14;	author gzheng;	state Exp;
branches;
next	1.39;

1.39
date	2002.01.06.23.42.48;	author gzheng;	state Exp;
branches;
next	1.38;

1.38
date	2002.01.06.21.58.27;	author gzheng;	state Exp;
branches;
next	1.37;

1.37
date	2002.01.01.22.23.30;	author gzheng;	state Exp;
branches;
next	1.36;

1.36
date	2001.12.30.00.06.28;	author gzheng;	state Exp;
branches;
next	1.35;

1.35
date	2001.12.22.00.29.21;	author gzheng;	state Exp;
branches;
next	1.34;

1.34
date	2001.12.20.17.59.07;	author gzheng;	state Exp;
branches;
next	1.33;

1.33
date	2001.12.18.21.57.29;	author gzheng;	state Exp;
branches;
next	1.32;

1.32
date	2001.12.15.05.39.33;	author gzheng;	state Exp;
branches;
next	1.31;

1.31
date	2001.12.12.16.02.01;	author olawlor;	state Exp;
branches;
next	1.30;

1.30
date	2001.12.11.20.52.10;	author olawlor;	state Exp;
branches;
next	1.29;

1.29
date	2001.08.23.19.10.45;	author milind;	state Exp;
branches;
next	1.28;

1.28
date	2001.07.06.18.11.54;	author olawlor;	state Exp;
branches;
next	1.27;

1.27
date	2001.05.12.18.56.45;	author gzheng;	state Exp;
branches;
next	1.26;

1.26
date	2001.05.12.18.27.34;	author gzheng;	state Exp;
branches;
next	1.25;

1.25
date	2001.05.11.05.17.30;	author gzheng;	state Exp;
branches;
next	1.24;

1.24
date	2001.05.05.19.40.48;	author gzheng;	state Exp;
branches;
next	1.23;

1.23
date	2001.05.05.06.14.19;	author gzheng;	state Exp;
branches;
next	1.22;

1.22
date	2001.05.04.21.30.24;	author gzheng;	state Exp;
branches;
next	1.21;

1.21
date	2001.05.04.21.14.39;	author gzheng;	state Exp;
branches;
next	1.20;

1.20
date	2001.05.04.19.50.51;	author gzheng;	state Exp;
branches;
next	1.19;

1.19
date	2001.05.04.03.51.40;	author gzheng;	state Exp;
branches;
next	1.18;

1.18
date	2001.05.04.03.46.50;	author gzheng;	state Exp;
branches;
next	1.17;

1.17
date	2001.05.04.03.37.32;	author gzheng;	state Exp;
branches;
next	1.16;

1.16
date	2001.05.04.01.36.17;	author gzheng;	state Exp;
branches;
next	1.15;

1.15
date	2001.05.04.01.34.23;	author gzheng;	state Exp;
branches;
next	1.14;

1.14
date	2001.05.04.00.14.48;	author gzheng;	state Exp;
branches;
next	1.13;

1.13
date	2001.05.03.14.31.27;	author gzheng;	state Exp;
branches;
next	1.12;

1.12
date	2001.05.02.03.49.13;	author gzheng;	state Exp;
branches;
next	1.11;

1.11
date	2001.05.02.03.27.58;	author gzheng;	state Exp;
branches;
next	1.10;

1.10
date	2001.05.01.03.49.03;	author gzheng;	state Exp;
branches;
next	1.9;

1.9
date	2001.04.19.03.24.44;	author gzheng;	state Exp;
branches;
next	1.8;

1.8
date	2001.04.08.00.54.49;	author olawlor;	state Exp;
branches;
next	1.7;

1.7
date	2001.03.27.21.51.39;	author gzheng;	state Exp;
branches;
next	1.6;

1.6
date	2001.03.02.21.44.52;	author gzheng;	state Exp;
branches;
next	1.5;

1.5
date	2001.03.02.04.27.01;	author gzheng;	state Exp;
branches;
next	1.4;

1.4
date	2001.02.06.17.40.50;	author gzheng;	state Exp;
branches;
next	1.3;

1.3
date	2001.01.29.21.29.41;	author olawlor;	state Exp;
branches;
next	1.2;

1.2
date	2000.12.21.06.15.58;	author milind;	state Exp;
branches;
next	1.1;

1.1
date	2000.12.21.06.14.33;	author milind;	state Exp;
branches;
next	;


desc
@@


1.136
log
@a warning for the arch name change: net-rs6k => net-aix-ppc
@
text
@#!/bin/sh

# Silly shorthand, used for source reorganization
src="src/arch"

more=0

syntax() {
  echo ''
  echo 'Usage: build <target> <version> <options> [charmc-options ...]'
  echo ''
  echo '<targets>: converse charm++ LIBS AMPI FEM bigemulator pose jade msa'
  echo '<targets>: doc ps-doc pdf-doc html-doc'
  if test $more = 1
  then
  echo ''
  echo '  charm++         compile Charm++ core only'
  echo '  AMPI            compile Adaptive MPI on top of Charm++'
  echo '  FEM             compile FEM framework'
  echo '  LIBS            compile additional parallel libraries with Charm++ core'
  echo '  bigemulator     build additional BigSim libraries'
  echo '  pose            build POSE parallel discrete event simulator'
  echo '  jade            build Jade compiler (auto-builds charm++, msa)'
  echo '  msa             build Multiphase Shared Arrays(MSA) library'
  echo '  Tau             build the TAU tracing library for generating TAU performance data' 
  echo '  ChaNGa          compile Charm++ core and necessary libraries for ChaNGa'
  echo ''
  fi
  echo '<versions>: ' 
  ( cd $src ; ls -1 | egrep -v '(^CVS)|(^shmem$)|(^mpi$)|(^sim$)|(^net$)|(^multicore$)|(^elan$)|(^util$)|(^common$)|(^uth$)|(^conv-mach-fix.sh$)|(^win32$)|(^win64$)|(^paragon$)|(^vmi$)|(^lapi$)|(^cell$)|(^template$)' | pr -3 -t )
  echo ''
  echo '<options>: compiler and platform specific options'
  echo 'cc cc64 cxx kcc pgcc acc icc ecc gcc3 gcc4 mpcc pathscale'
  echo 'help smp gm tcp vmi scyld clustermatic bigemulator ooc syncft papi'
  echo 'pthreads lam'
  echo '--incdir --libdir --basedir --no-build-shared --destination --suffix -j'
  if test $more = 1
  then
  echo ''
  echo 'For platform specific options, use help option:'
  echo '  help		  platform specific help, e.g. ./build charm++ net-linux help'
  echo ''
  echo 'Choose a compiler (only one option is allowed from this section):'
  echo '  cc, cc64        For Sun WorkShop C++ 32/64 bit compilers'
  echo '  cxx             DIGITAL C++ compiler (DEC Alpha)'
  echo '  kcc             KAI C++ compiler'
  echo "  pgcc            Portland Group's C++ compiler"
  echo '  acc             HP aCC compiler'
  echo '  icc             Intel C/C++ compiler for Linux IA32'
  echo '  ecc             Intel C/C++ compiler for Linux IA64'
  echo '  gcc3            use gcc3 - GNU GCC/G++ version 3'
  echo '  gcc4            use gcc4 - GNU GCC/G++ version 4 (only mpi-crayxt3)'
  echo '  mpcc            SUN Solaris C++ compiler for MPI'
  echo '  pathscale       use pathscale compiler suite'
  echo ''
  echo 'Choose a fortran compile (only one option is allowed from this section):'
  echo '  g95             G95 at http://ww.g95.org'
  echo '  absoft          Absoft fortran compiler'
  echo "  pgf90           Portland Group\'s Fortran compiler"
  echo '  ifc             Intel Fortran compiler (older versions)'
  echo '  ifort           Intel Fortran compiler (newer versions)'
  echo ''
  echo 'Platform specific options (choose multiple if apply):'
  echo '  lam             Use LAM MPI'
  echo '  smp             support for SMP, multithreaded charm on each node'
  echo '  mpt             use SGI Message Passing Toolkit (only for mpi version)'
  echo '  gm              use Myrinet for communication'
  echo '  tcp             use TCP sockets for communication (only for net version)'
  echo '  ibverbs         use the Infiniband OpenIB layer for communication (only for net-linux-amd64 currently)'
  echo "  vmi             use NCSA's VMI for communication (only for mpi version)"
  echo '  scyld           compile for Scyld Beowulf cluster based on bproc'
  echo '  clustermatic    compile for Clustermatic (support version 3 and 4) '
  echo '  pthreads        compile with pthreads Converse threads'
  echo ''
  echo 'Advanced options:'
  echo '  bigemulator	  compile for BigSim simulator'
  echo '  ooc		  compile with out of core support'
  echo '  syncft	  compile with Charm++ fault tolerance support'
  echo '  papi            compile with PAPI performance counter support (if any)'
  echo ''
  echo "Charm++ dynamic libraries:"
  echo "  --build-shared     build Charm++ dynamic libraries (.so) (default)"
  echo "  --no-build-shared  don't build Charm++'s shared libraries"
  echo ''
  echo 'Miscellaneous options:'
  echo '  --incdir=DIR       specify additional include path for compiler'
  echo '  --libdir=DIR	     specify additional lib path for compiler'
  echo '  --basedir=DIR	     shortcut for the above two - DIR/include and DIR/lib'
  echo '  -j[N]              parallel make, N is the number of paralle make jobs'
  echo "  --with-romio       build AMPI with ROMIO library"
  echo "  --destination=DIR  build Charm++ inside DIR, by default the destination is <version>"
  echo "  --suffix=DIR       append DIR to the destination directory of the Charm++ build"
  echo "  --tau-makefile=FILE Specify which TAU stub makefile to use"
  fi
  echo ''
  echo '<charmc-options>: normal compiler options e.g. -g -O -save -verbose'
  if test $more = 1
  then
  echo ''
  echo 'Examples:'
  echo "1. display all supported options for net-linux using 'help':"
  echo '  ./build charm++ net-linux help'
  echo '2. compile Charm++ on Linux with optimizations:'
  echo '  ./build charm++ net-linux -O -DCMK_OPTIMIZE'
  echo '3. compile Charm++ for Linux clustermatic Beowulf cluster with Intel compiler:'
  echo '  ./build charm++ net-linux clustermatic icc -O'
  echo '4. compile Charm++ for IA64 Linux cluster with MPICH-GM:'
  echo '  ./build charm++ mpi-linux-ia64 gm -O'
  echo '5. compile Charm++ for Windows with VC++ (Cygwin required):'
  echo '  ./build charm++ net-win32 -O'
  echo '6. compile on IBM SP with MPI using parallel gmake, 4 jobs simultaneously:'
  echo '  MAKE=gmake  ./build charm++ mpi-sp -j4 -O            # sh'
  echo '  setenv MAKE gmake;  ./build charm++ mpi-sp -j4 -O    # csh'
  echo '7. compile Charm++ with MPI that is installed at /usr/local/mpich:'
  echo '  ./build charm++ mpi-linux --incdir /usr/local/mpich/include --libdir /usr/local/mpich/lib -O'
  echo '   or in short,'
  echo '  ./build charm++ mpi-linux --basedir /usr/local/mpich -O'
  echo '  ./build Tau --tau-makefile=/usr/local/packages/TAU/x86_64/lib/Makefile.tau-mpi'
  echo ''
  echo 'Note: This script:'
  echo ' 1. Creates directories <destination> and <destination>/tmp';
  echo ' 2. Copies src/scripts/Makefile into <destination>/tmp';
  echo ' 3. Does a "make <target> <version> OPTS=<charmc-options>" in <destination>/tmp.'
  echo "That's all build does.  The rest is handled by the Makefile."
  echo ''
  echo 'Thank you for using Charm++, please send questions or comments to '
  echo 'Parallel Programming Lab at University of Illinois at Urbana-Champaign'
  echo '(email: ppl@@cs.uiuc.edu).'

  else
  echo ''
  echo "To get more detailed help, run ./build --help"
  fi
}

printOption() {
  for prefix in cc conv-mach
  do
    str="Supported compilers:"
    [ "$prefix" = "conv-mach" ] && str="Supported options:"
    opts=""
    for dir in $OPT_DIRS
    do
#         echo "Checking for $prefix in $dir"
          files=`cd $dir; ls $prefix-*.h 2>/dev/null`
          opts="$opts "`echo $files | sed 's/'$prefix'-\([^.]*\).h/\1/g'`
    done 
    tmp=.tmp.$$
    rm -f $tmp; touch $tmp
    for o in $opts
    do
      echo $o >> $tmp
    done
    opts=`sort $tmp | uniq`
    rm -f $tmp
    echo $str $opts
  done
  exit 1
}

CheckDir() {
  for d in $*
  do
    if test ! -d $d
    then
      echo Error: cannot find $d!
      exit 1
    fi
  done
}

TestIfCompiler() {
  for dir in $OPT_DIRS
  do
    [ -f $dir/cc-$1.sh ] && return 1
  done  
  return 0
}

TestIfOption() {
  for dir in $OPT_DIRS
  do
    [ -f $dir/conv-mach-$1.h ] && return 1 
  done
  
  echo "Error> option: $1 is not supported in this version!"; 
  printOption
}


# start

MAKEOPTS=""
OPTS=""
BOPTS=""
MORE=""
COMPILER=""
BASEDIR=
LIBDIR=
INCDIR=
ARCH=
BUILD_SHARED=
WITH_ROMIO=
BUILD_EMULATOR=0
DESTINATION=""
DESTINATION_SUFFIX=""
TAU_MAKEFILE=""

[ "$1" = '--help' -o "$1" = '-h' ] && more=1 && syntax | more && exit 1
[ $# -lt 2 ] && ./smart-build.pl && exit 1
PROGRAM=$1
shift
VERSION=$1; BASEVERSION=$1; 
if test -f $src/$BASEVERSION/vdir_link
then
  BASEVERSION=`cat $src/$BASEVERSION/vdir_link`
fi
ARCH=`echo $1 | sed -e 's@@-.*@@@@'`
shift

#echo $src
#echo $BASEVERSION
#echo $ARCH

OPT_DIRS="$src/$BASEVERSION $src/$ARCH $src/common"

while [ ! $# -eq 0 ]
do
  case "$1" in
    "--basedir")
          	shift; 
  		for dir in $1
  		do
		  CheckDir $dir/include $dir/lib
          	  LIBDIR="$LIBDIR -L$dir/lib";
          	  INCDIR="$INCDIR -I$dir/include"
		done
          	shift
 	  	;;
    --basedir=*)
                basedir=`echo $1 | awk -F= '{print $2}'`
  		for dir in $basedir
  		do
		  CheckDir $dir/include $dir/lib
          	  LIBDIR="$LIBDIR -L$dir/lib";
          	  INCDIR="$INCDIR -I$dir/include"
		done
          	shift
 	  	;;
    "--libdir")
          	shift; CheckDir $1
  		for dir in $1
  		do
          	  LIBDIR="$LIBDIR -L$dir"; 
		done
                shift
 	  	;;
    --libdir=*)
                libdir=`echo $1 | awk -F= '{print $2}'`
		CheckDir $libdir
  		for dir in $libdir
  		do
          	  LIBDIR="$LIBDIR -L$dir"; 
		done
          	shift
 	  	;;
    "--incdir")
          	shift; CheckDir $1
  		for dir in $1
  		do
          	  INCDIR="$INCDIR -I$dir"; 
		done
          	shift
 	  	;;
    --incdir=*)
                incdir=`echo $1 | awk -F= '{print $2}'`
		CheckDir $incdir
  		for dir in $incdir
  		do
          	  INCDIR="$INCDIR -I$dir"; 
		done
          	shift
 	  	;;
    --no-build-shared|-nobs|--no-shared)
		BUILD_SHARED="-nobs"; shift
		;;
    --with-romio)
		WITH_ROMIO="true"; shift
		;;
    --build-shared|-bs)
		# obsolete, do nothing
		shift
		;;
    --destination)
		shift
		DESTINATION="$1"
		shift
		;;
    --destination=*)
		DESTINATION="`echo $1 | awk -F= '{print $2}'`"
		shift
		;;
    --suffix)
		shift
		DESTINATION_SUFFIX="$1"
		shift
		;;
    --suffix=*)
		DESTINATION_SUFFIX="`echo $1 | awk -F= '{print $2}'`"
		shift
		;;
    --tau-makefile)
		TAU_MAKEFILE=$1
		shift
		;;
    --tau-makefile=*)
		TAU_MAKEFILE=`echo $1 | awk -F= '{print $2}'`
		shift
		;;
    -j*)
                PMAKENUM=`echo $1 | awk -Fj '{print $2}'`
		MAKEOPTS="$MAKEOPTS -j $PMAKENUM"
		shift;
		;;
    -*) 
# We hit a real compiler option (like -g, or -Dfoo),
# so just copy over all remaining options
          while [ ! $# -eq 0 ]
          do
            OPTS="$OPTS $1"; shift
          done
	  ;;
    "help")
	printOption
	;;
    *)
# This has to be a build-time option (like "smp", "gcc3", or "kcc")
        TestIfCompiler $1
        if [ $? -eq 1 ] 
        then
# It specifies a compiler:
          if [ ! -z "$COMPILER" ] 
          then
              echo "Error> Tried to specify two compilers: $COMPILER and $1"
              printOption
          fi
          COMPILER=$1
        else
# It specifies some other option:
          TestIfOption $1
          BOPTS="$BOPTS $1"
          [ $1 =  "bigemulator" ] && BUILD_EMULATOR=1
        fi
        shift
	;;
  esac
done

[ "x$VERSION" = "x" ] && syntax && exit 1

if [ -z "$MAKE" ] 
then
  # prefer gmake
  MAKE=`which gmake 2>/dev/null`
  [ -z "$MAKE" -o ! -x "$MAKE" ] && MAKE='make'
fi

if [ ! -f $src/$BASEVERSION/conv-mach.h ] 
then
  if [ "x_$BASEVERSION" = "x_net-rs6k" ]
  then
    echo "Error> build net-aix-ppc instead of net-rs6k!" 
  else
    echo "Error> build can not find arch: $BASEVERSION!" 
  fi
  exit 1
fi

#generate VERSION name combining all the build-time options.
if [ -n "$BOPTS" -o -n "$COMPILER" ]
then
  echo "Selected Compiler: $COMPILER"
  echo "Selected Options: $BOPTS"
  SORTED=`echo $BOPTS | awk  '{ for (i = 1; i <= NF; ++i) print $i }' | sort`
  BOPTS_WITHCOMPILER=`echo $SORTED $COMPILER`
  for i in $BOPTS_WITHCOMPILER
  do
    VERSION=$VERSION-$i
  done
fi

#echo "|$DESTINATION|$DESTINATION_SUFFIX|"

if [ -z "$DESTINATION" ]
then
  DESTINATION="$VERSION"
fi

if [ -n "$DESTINATION_SUFFIX" ]
then
  DESTINATION="$DESTINATION-$DESTINATION_SUFFIX"
fi

[ -d $DESTINATION ] || echo "Creating dir: $DESTINATION" 
[ -d $DESTINATION ] || mkdir $DESTINATION
[ -d $DESTINATION/tmp ] || echo "Creating dir: $DESTINATION/tmp" 
[ -d $DESTINATION/tmp ] || mkdir $DESTINATION/tmp

echo "Copying src/scripts/Makefile to $DESTINATION/tmp"
rm -f $DESTINATION/tmp/Makefile
rm -f $DESTINATION/tmp/Make.depends
rm -f $DESTINATION/tmp/Make.lb
rm -f $DESTINATION/tmp/Make.machine


# Create the bin, lib, include, etc. links:
WINNAME=`echo $VERSION | awk -F- '{print $2}'`
if [ "x_$WINNAME" = "x_win32" -o "x_$WINNAME" = "x_win64" ]
then
#Win32/64 version needs special compilers and *copied* (not linked)
# source files.
	echo "Copying compilers for $WINNAME into cygwin /bin directory"
	cp -f $src/$WINNAME/unix2nt* /bin
	cp $src/win32/system_ln $DESTINATION/tmp
	cp $src/win32/unistd.h $DESTINATION/tmp
	echo "Compiling createlink.cpp ..."
        (cd $src/win32; unix2nt_cc  -c createlink.cpp -o createlink.o -D_WIN32_WINNT=0x0500; unix2nt_cc createlink.o)
	if test ! -x $src/win32/createlink.exe
	then
		echo "VC++ is not properly installed!"
		exit 1
	fi
	echo "Copying $src/win32/createlink.exe to /bin directory"
	cp $src/win32/createlink.exe /bin
        chmod +x $DESTINATION/tmp/system_ln
else
	cat > $DESTINATION/tmp/system_ln <<EOF
#!/bin/sh
ln -f -s \$@@
EOF
  chmod +x $DESTINATION/tmp/system_ln
  for newdir in `echo bin lib lib_so include tmp`
  do
    echo "Soft-linking over $newdir"
    if [ -r $newdir ]
    then
      rm -fr $newdir || exit 1
    fi
    $DESTINATION/tmp/system_ln $DESTINATION/$newdir $newdir
  done
  rm -f VERSION
  $DESTINATION/tmp/system_ln $DESTINATION/include/VERSION VERSION
fi

$DESTINATION/tmp/system_ln "../../src/scripts/Make.depends" $DESTINATION/tmp/Make.depends
$DESTINATION/tmp/system_ln "../../src/ck-ldb/Make.lb" $DESTINATION/tmp/Make.lb
$DESTINATION/tmp/system_ln "../../src/scripts/Makefile" $DESTINATION/tmp/Makefile
$DESTINATION/tmp/system_ln "../../src/scripts/Make.tau" $DESTINATION/tmp/Make.tau
touch $DESTINATION/tmp/Makefile.machine

ConvUsr="$DESTINATION/tmp/conv-mach-pre.sh"
echo "Generating $ConvUsr"
echo > $ConvUsr
if test -n "$LIBDIR" 
then
  echo 'USER_OPTS_LD="$USER_OPTS_LD '$LIBDIR'"' >> $ConvUsr
  echo 'USER_OPTS_LDXX="$USER_OPTS_LDXX '$LIBDIR'"' >> $ConvUsr
fi
if test -n "$INCDIR" 
then
  echo 'USER_OPTS_CC="$USER_OPTS_CC '$INCDIR'"' >> $ConvUsr
  echo 'USER_OPTS_CXX="$USER_OPTS_CXX '$INCDIR'"' >> $ConvUsr
fi
chmod +x $ConvUsr

# Create conv-mach-opt headers with special build-time options
ConvHeader="$DESTINATION/tmp/conv-mach-opt.h"
ConvSh="$DESTINATION/tmp/conv-mach-opt.sh"
if [ ! -f $ConvSh -o ! -f $ConvHeader ]
then
  echo "Generating $ConvHeader, conv-mach-opt.sh"
  echo '/* Build-time options header, automatically generated by charm/build*/'> $ConvHeader
  echo '# Built-time options header, automatically generated by charm/build'> $ConvSh
  echo '[ -z "$CHARMINC" ] && CHARMINC="."' >> $ConvSh
fi
if test -n "$COMPILER"
then
      i="$COMPILER"
      echo '#include "'cc-$i.h'"' >> $ConvHeader
      echo '. $CHARMINC/'"cc-$i.sh" >> $ConvSh
fi
if test -n "$BOPTS"
then
    for i in $BOPTS
    do
      echo '#include "'conv-mach-$i.h'"' >> $ConvHeader
      echo '. $CHARMINC/'"conv-mach-$i.sh" >> $ConvSh
    done
fi

if test  -n "$BUILD_SHARED" 
then
    echo "CMK_NO_BUILD_SHARED=true" >> $ConvSh
fi

if test  -n "$WITH_ROMIO" 
then
    echo "CMK_AMPI_WITH_ROMIO=\"true\"" >> $ConvSh
fi


# build with Tau
WITH_TAU=0
if [ "$PROGRAM" = "Tau" ]
then
	echo "TAU>>>> makefile config option: $TAU_MAKEFILE"
	if [ -n "$TAU_MAKEFILE" -a -f $TAU_MAKEFILE ]
	then
	  #Setting up TAU trace library:
	  echo "TAU>>>> configuring with this TAU makefile: $TAU_MAKEFILE"

          WITH_TAU=1
	else
	  echo "TAU>>>> ERROR could not find Makefile: $TAU_MAKEFILE, ignored"
          TAU_MAKEFILE=""
	fi
fi
[ -z "$TAU_MAKEFILE" ] && TAU_MAKEFILE="Make.tau"
SED_CHARMC="s@@TAU_MAKEFILE=\(.*\)@@TAU_MAKEFILE=$TAU_MAKEFILE@@"

sed -e $SED_CHARMC src/scripts/Makefile > .Makefile.$$ && cp .Makefile.$$ src/scripts/Makefile && rm -f  .Makefile.$$
sed -e $SED_CHARMC src/scripts/charmc > .charmc.$$ && cp .charmc.$$ src/scripts/charmc && rm -f .charmc.$$

if test $WITH_TAU -eq 1
then
    echo "#define CMK_WITH_TAU               1" >> $ConvHeader
    echo "#define pthread_create             tau_pthread_create" >> $ConvHeader
    echo "#define pthread_exit               tau_pthread_exit" >> $ConvHeader

    echo "CMK_WITH_TAU=\"true\"" >> $ConvSh
fi


echo $BASEVERSION > $DESTINATION/tmp/.vdir
echo $VERSION | sed -e 's@@-.*@@@@' > $DESTINATION/tmp/.gdir

if test $BUILD_EMULATOR = 1
then
  PROGRAM="$PROGRAM bigsim"
fi

printError()
{
	echo "-------------------------------------------------"
	echo "Charm++ NOT BUILT. Either cd into $DESTINATION/tmp and try"
	echo "to resolve the problems yourself, visit"
	echo "    http://charm.cs.uiuc.edu/"
	echo "for more information. Otherwise, email the developers at ppl@@cs.uiuc.edu"
	exit $MAKEEXIT
}

echo "Performing '$MAKE $MAKEOPTS $PROGRAM OPTS="$OPTS"' in $VERSION/tmp"
cd $DESTINATION/tmp 
$MAKE $MAKEOPTS basics OPTS="$OPTS $BUILD_SHARED"
MAKEEXIT=$?
[ $MAKEEXIT -ne 0 ] && printError

$MAKE $MAKEOPTS $PROGRAM OPTS="$OPTS $BUILD_SHARED"
MAKEEXIT=$?
if [ $MAKEEXIT -eq 0 ]
then
	echo "-------------------------------------------------"
	echo "$PROGRAM built successfully."
	echo "Next, try out a sample program like" \
	     "tests/charm++/simplearrayhello"
else
        printError
fi
@


1.135
log
@fix the previous checkin about tau makefile
@
text
@d370 6
a375 1
  echo "Error> build can not find arch: $BASEVERSION!" 
@


1.134
log
@avoid empty TAU_MAKEFILE
@
text
@d207 1
d508 1
d512 1
a512 1
	if [ -f $TAU_MAKEFILE ]
d517 1
a517 2
	  SED_CHARMC="s@@TAU_MAKEFILE=\(.*\)@@TAU_MAKEFILE=$TAU_MAKEFILE@@"

d520 1
a520 1
          TAU_MAKEFILE="Make.tau"
d522 3
a524 5
else
    # Still need to set the variables in Makefile and charmc to ""
    # even in the non-Tau case.
    TAU_MAKEFILE="Make.tau"
    SED_CHARMC="s@@TAU_MAKEFILE=\(.*\)@@TAU_MAKEFILE=$TAU_MAKEFILE@@"
a525 1
fi
d529 1
a529 1
if test -n "$TAU_MAKEFILE"
@


1.133
log
@check return status of make basics
@
text
@d452 1
d512 2
a513 2
	#Setting up TAU trace library:
	echo "TAU>>>> configuring with this TAU makefile: $TAU_MAKEFILE"
d515 1
a515 1
	SED_CHARMC="s@@TAU_MAKEFILE=\(.*\)@@TAU_MAKEFILE=$TAU_MAKEFILE@@"
d518 2
a519 2
	echo "TAU>>>> ERROR could not find Makefile: $TAU_MAKEFILE"
        TAU_MAKEFILE=""
d524 1
a524 1
    TAU_MAKEFILE=""
@


1.132
log
@minor changes in screen output
@
text
@d548 10
d561 3
a564 1

d573 1
a573 6
	echo "-------------------------------------------------"
	echo "Charm++ NOT BUILT. Either cd into $DESTINATION/tmp and try"
	echo "to resolve the problems yourself, visit"
	echo "    http://charm.cs.uiuc.edu/"
	echo "for more information. Otherwise, email the developers at ppl@@cs.uiuc.edu"
	exit $MAKEEXIT
@


1.131
log
@use cp -f when copying unix2nt_*
@
text
@d427 1
d429 1
a429 1
  chmod +x $DESTINATION/tmp/system_ln
@


1.130
log
@mark tau build in conv-mach-pre.sh
@
text
@d417 1
a417 1
	cp $src/$WINNAME/unix2nt* /bin
@


1.129
log
@simplified previous fix. define pthread function to tau_ variants as macro
@
text
@d534 2
@


1.128
log
@fixed Tau compilation
@
text
@a356 23
if [ "$PROGRAM" = "Tau" ]
then
	echo "TAU>>>> makefile config option: $TAU_MAKEFILE"
	if [ -f $TAU_MAKEFILE ]
	then
	#Setting up TAU trace library:
	echo "TAU>>>> configuring with this TAU makefile: $TAU_MAKEFILE"

	SED_CHARMC="s@@TAU_MAKEFILE=\(.*\)@@TAU_MAKEFILE=$TAU_MAKEFILE@@"

	else
	echo "TAU>>>> ERROR could not find Makefile: $TAU_MAKEFILE"
        TAU_MAKEFILE=""
	fi
else
    # Still need to set the variables in Makefile and charmc to ""
    # even in the non-Tau case.
    TAU_MAKEFILE=""
    SED_CHARMC="s@@TAU_MAKEFILE=\(.*\)@@TAU_MAKEFILE=$TAU_MAKEFILE@@"

fi
sed -e $SED_CHARMC src/scripts/Makefile > .Makefile.$$ && cp .Makefile.$$ src/scripts/Makefile && rm -f  .Makefile.$$
sed -e $SED_CHARMC src/scripts/charmc > .charmc.$$ && cp .charmc.$$ src/scripts/charmc && rm -f .charmc.$$
d503 26
d531 3
a533 1
    echo "#define CMK_WITH_TAU                  1" >> $ConvHeader
d536 1
@


1.127
log
@Modifications for TAU tracing in the Charm++ framework.
@
text
@a366 4
	echo $SED_CHARMC
	sed -i -e $SED_CHARMC src/scripts/Makefile 
	echo $SED_CHARMC
	sed -i -e $SED_CHARMC src/scripts/charmc  
d369 1
a376 4
    echo $SED_CHARMC
    sed -i -e $SED_CHARMC src/scripts/Makefile
    echo $SED_CHARMC
    sed -i -e $SED_CHARMC src/scripts/charmc
d378 2
d526 5
@


1.126
log
@Final changes to make './build all blah -j' succeed
@
text
@d25 1
d93 1
d118 1
d311 8
d357 28
@


1.125
log
@- added new build target for "ChaNGa" which builds charm++ plus ckcache library.
- modified build script to write .gdir instead of relying on the name of the directory
  (which could be overridden by --destination option)
@
text
@d502 1
@


1.124
log
@compile createlink.exe on the fly
@
text
@d25 1
d493 1
@


1.123
log
@simplified
@
text
@d408 7
@


1.122
log
@fixed for win64 build
@
text
@d399 2
a400 1
if [ "x_`echo $VERSION | awk -F- '{print $2}'`" = "x_win32" ]
d402 1
a402 1
#Win32 version needs special compilers and *copied* (not linked)
d404 2
a405 12
	echo "Copying compilers for win32 into cygwin /bin directory"
	cp $src/win32/unix2nt* /bin
	cp $src/win32/system_ln $DESTINATION/tmp
	cp $src/win32/unistd.h $DESTINATION/tmp
	cp $src/win32/createlink.exe /bin
  chmod +x $DESTINATION/tmp/system_ln
elif [ "x_`echo $VERSION | awk -F- '{print $2}'`" = "x_win64" ]
then
#Win64 version needs special compilers and *copied* (not linked)
# source files.
	echo "Copying compilers for win64 into cygwin /bin directory"
	cp $src/win64/unix2nt* /bin
@


1.121
log
@comment out a debug print
@
text
@a416 1
	cp $src/win32/unistd.h $DESTINATION/include
@


1.120
log
@Added flags --destination and --suffix to allow the user to choose a destination directory different from the current default (which is <version>)
@
text
@d374 1
a374 1
echo "|$DESTINATION|$DESTINATION_SUFFIX|"
@


1.119
log
@deleting comment regarding subscription (never worked)
@
text
@d34 1
a34 1
  echo '--incdir --libdir --basedir --no-build-shared -j'
d84 7
a90 5
  echo '  --incdir=DIR	  specify additional include path for compiler'
  echo '  --libdir=DIR	  specify additional lib path for compiler'
  echo '  --basedir=DIR	  shortcut for the above two - DIR/include and DIR/lib'
  echo '  -j[N]           parallel make, N is the number of paralle make jobs'
  echo "  --with-romio    build AMPI with ROMIO library"
d117 3
a119 3
  echo ' 1. Creates directories <version> and <version>/tmp';
  echo ' 2. Copies src/scripts/Makefile into <version>/tmp';
  echo ' 3. Does a "make <target> <version> OPTS=<charmc-options>" in <version>/tmp.'
d201 2
d289 18
d374 22
a395 10
[ -d $VERSION ] || echo "Creating dir: $VERSION" 
[ -d $VERSION ] || mkdir $VERSION
[ -d $VERSION/tmp ] || echo "Creating dir: $VERSION/tmp" 
[ -d $VERSION/tmp ] || mkdir $VERSION/tmp

echo "Copying src/scripts/Makefile to $VERSION/tmp"
rm -f $VERSION/tmp/Makefile
rm -f $VERSION/tmp/Make.depends
rm -f $VERSION/tmp/Make.lb
rm -f $VERSION/tmp/Make.machine
d405 2
a406 2
	cp $src/win32/system_ln $VERSION/tmp
	cp $src/win32/unistd.h $VERSION/tmp
d408 1
a408 1
  chmod +x $VERSION/tmp/system_ln
d415 3
a417 3
	cp $src/win32/system_ln $VERSION/tmp
	cp $src/win32/unistd.h $VERSION/tmp
	cp $src/win32/unistd.h $VERSION/include
d419 1
a419 1
  chmod +x $VERSION/tmp/system_ln
d421 1
a421 1
	cat > $VERSION/tmp/system_ln <<EOF
d425 1
a425 1
  chmod +x $VERSION/tmp/system_ln
d433 1
a433 1
    $VERSION/tmp/system_ln $VERSION/$newdir $newdir
d436 1
a436 1
  $VERSION/tmp/system_ln $VERSION/include/VERSION VERSION
d439 4
a442 4
$VERSION/tmp/system_ln "../../src/scripts/Make.depends" $VERSION/tmp/Make.depends
$VERSION/tmp/system_ln "../../src/ck-ldb/Make.lb" $VERSION/tmp/Make.lb
$VERSION/tmp/system_ln "../../src/scripts/Makefile" $VERSION/tmp/Makefile
touch $VERSION/tmp/Makefile.machine
d444 1
a444 1
ConvUsr="$VERSION/tmp/conv-mach-pre.sh"
d460 2
a461 2
ConvHeader="$VERSION/tmp/conv-mach-opt.h"
ConvSh="$VERSION/tmp/conv-mach-opt.sh"
d494 1
a494 1
echo $BASEVERSION > $VERSION/tmp/.vdir
d502 1
a502 1
cd $VERSION/tmp 
d514 1
a514 1
	echo "Charm++ NOT BUILT. Either cd into $VERSION/tmp and try"
@


1.118
log
@allows arch name aliasing.
@
text
@a119 4
  echo 'You should register your copy of Charm++ with us by sending email'
  echo 'to tms@@charm.cs.uiuc.edu containing the message "subscribe charm-users"'
  echo 'This will allow us to notify you of new releases of Charm++.'
  echo ''
@


1.117
log
@If "./build" is called with no command line arguments, it will run the interactive build script.
@
text
@d208 6
a213 1
VERSION=$1; BASEVERSION=$1; ARCH=`echo $1 | sed -e 's@@-.*@@@@'`
@


1.116
log
@updated for multicore
@
text
@d205 1
a205 1
[ $# -lt 2 ] && syntax && exit 1
@


1.115
log
@fixed compilation for win64
@
text
@d28 1
a28 1
  ( cd $src ; ls -1 | egrep -v '(^CVS)|(^shmem$)|(^mpi$)|(^sim$)|(^net$)|(^elan$)|(^util$)|(^common$)|(^uth$)|(^conv-mach-fix.sh$)|(^win32$)|(^win64$)|(^paragon$)|(^vmi$)|(^lapi$)|(^cell$)|(^template$)' | pr -3 -t )
d211 3
a213 3
echo $src
echo $BASEVERSION
echo $ARCH
@


1.114
log
@Added a note to the help for infiniband mentioning that it is for net-linux-amd64 only
@
text
@d66 2
a67 2
	echo '  ibverbs         use the Infiniband OpenIB layer for communication (only for net-linux-amd64 currently)'
  echo '  tcp             use TCP sockets for communication (ony for net version)'
d380 4
a383 4
	cp $src/win64/system_ln $VERSION/tmp
	cp $src/win64/unistd.h $VERSION/tmp
	cp $src/win64/unistd.h $VERSION/include
	cp $src/win64/createlink.exe /bin
@


1.113
log
@Added a line for infiniband in the build option
@
text
@d66 1
a66 1
	echo '  ibverbs         use the Infiniband OpenIB layer for communication'
@


1.112
log
@build bigsim libraries when bigemulator option specified
@
text
@d66 1
@


1.111
log
@Added a new gcc4 configuration for the XT3 machine option only.

The XT3 pcqueue hack is apparently no longer required. calloc fails to do
the right job on the XT3 and is currently changed to malloc/memset on the
platform. All other platforms will continue to use calloc.

A decision to use malloc/memset is prefered over the original hack because
it is unclear how the original even helped in the first place, raising
concerns that some bug remains unexercised on the system. malloc/memset
on the other hand behaves semantically the same as calloc though performance
is expected to suffer due to the result of making 2 system calls as opposed
to 1.
@
text
@d12 1
a12 1
  echo '<targets>: converse charm++ LIBS AMPI FEM bigsim pose jade msa'
d21 1
a21 1
  echo '  bigsim          build additional BigSim libraries'
d32 1
a32 1
  echo 'help smp gm tcp vmi scyld clustermatic bigsim ooc syncft papi'
d73 1
a73 1
  echo '  bigsim	  compile for BigSim simulator'
d201 1
d219 1
a219 1
    	    "--basedir")
d229 1
a229 1
    	    --basedir=*)
d239 1
a239 1
    	    "--libdir")
d247 1
a247 1
    	    --libdir=*)
d256 1
a256 1
    	    "--incdir")
d264 1
a264 1
    	    --incdir=*)
d273 1
a273 1
	    --no-build-shared|-nobs|--no-shared)
d276 1
a276 1
	    --with-romio)
d279 1
a279 1
	    --build-shared|-bs)
d283 1
a283 1
	    -j*)
d315 1
d460 5
@


1.110
log
@bluegene => bigsim
@
text
@d31 1
a31 1
  echo 'cc cc64 cxx kcc pgcc acc icc ecc gcc3 mpcc pathscale'
d50 1
d209 4
@


1.109
log
@Make changes for 64-bit windows building
@
text
@d12 1
a12 1
  echo '<targets>: converse charm++ LIBS AMPI FEM bluegene pose jade msa'
d21 1
a21 1
  echo '  bluegene        build additional BigSim libraries'
d32 1
a32 1
  echo 'help smp gm tcp vmi scyld clustermatic bluegene ooc syncft papi'
d72 1
a72 1
  echo '  bluegene	  compile for BigSim (Blue Gene) simulator'
@


1.108
log
@filter "cell"
@
text
@d28 1
a28 1
  ( cd $src ; ls -1 | egrep -v '(^CVS)|(^shmem$)|(^mpi$)|(^sim$)|(^net$)|(^elan$)|(^util$)|(^common$)|(^uth$)|(^conv-mach-fix.sh$)|(^win32$)|(^paragon$)|(^vmi$)|(^lapi$)|(^cell$)|(^template$)' | pr -3 -t )
d366 11
@


1.107
log
@build will pick gmake first
@
text
@d28 1
a28 1
  ( cd $src ; ls -1 | egrep -v '(^CVS)|(^shmem$)|(^mpi$)|(^sim$)|(^net$)|(^elan$)|(^util$)|(^common$)|(^uth$)|(^conv-mach-fix.sh$)|(^win32$)|(^paragon$)|(^vmi$)|(^lapi$)|(^template$)' | pr -3 -t )
@


1.106
log
@added a section on fortran compilers in help page.
@
text
@d33 1
d61 1
d69 1
d317 6
a322 1
[ -z "$MAKE" ] && MAKE='make'
@


1.105
log
@create dummy Makefile.machine
@
text
@d52 7
@


1.104
log
@copy createlink program to cygwin/bin
@
text
@d337 1
d373 1
@


1.103
log
@added pathscale in help page
@
text
@d348 1
@


1.102
log
@defined user provided libdir and incdir to USER_OPTS_LD, etc so that it gets through properly.
@
text
@d31 1
a31 1
  echo 'cc cc64 cxx kcc pgcc acc icc ecc gcc3 mpcc'
d50 1
@


1.101
log
@allow --basedir, etc to take multiple directories with space
@
text
@d376 2
a377 2
  echo 'OPTS_LD="$OPTS_LD '$LIBDIR'"' >> $ConvUsr
  echo 'OPTS_LDXX="$OPTS_LDXX '$LIBDIR'"' >> $ConvUsr
d381 2
a382 2
  echo 'OPTS_CC="$OPTS_CC '$INCDIR'"' >> $ConvUsr
  echo 'OPTS_CXX="$OPTS_CXX '$INCDIR'"' >> $ConvUsr
@


1.100
log
@remove VERSION sym link before create it.
@
text
@d147 1
a147 1
  for dir in $*
d149 1
a149 1
    if test ! -d $dir
d151 1
a151 1
      echo Error: cannot find $1!
d203 8
a210 3
          	shift; CheckDir $1/include $1/lib
          	LIBDIR="$LIBDIR -L$1/lib";
          	INCDIR="$INCDIR -I$1/include"; shift
d214 7
a220 3
		CheckDir $basedir/include $basedir/lib
          	LIBDIR="$LIBDIR -L$basedir/lib";
          	INCDIR="$INCDIR -I$basedir/include"; shift
d224 5
a228 1
          	LIBDIR="$LIBDIR -L$1"; shift
d233 5
a237 1
          	LIBDIR="$LIBDIR -L$libdir"; shift
d241 5
a245 1
          	INCDIR="$INCDIR -I$1"; shift
d250 5
a254 1
          	INCDIR="$INCDIR -I$incdir"; shift
@


1.99
log
@link VERSION file to top dir.
@
text
@d338 1
@


1.98
log
@don't display "template"
@
text
@d338 1
@


1.97
log
@fixed "help" print.
@
text
@d28 1
a28 1
  ( cd $src ; ls -1 | egrep -v '(^CVS)|(^shmem$)|(^mpi$)|(^sim$)|(^net$)|(^elan$)|(^util$)|(^common$)|(^uth$)|(^conv-mach-fix.sh$)|(^win32$)|(^paragon$)|(^vmi$)|(^lapi$)' | pr -3 -t )
@


1.96
log
@with "help" only print uniq options.
@
text
@d133 8
a140 1
    opts=`echo $opts | sed -e 's/ /\n/g' | sort | uniq`
@


1.95
log
@preserve OPTS_LDXX when update its value in conv-mach-pre.sh
@
text
@d133 1
@


1.94
log
@defined OPTS_LD, OPTS_CXX instead of CMK_LIBDIR CMK_INCDIR
OPTS_CXX normally are put after charm headers, so that for example mpi.h is looked at charm include first.
@
text
@d341 2
a342 2
  echo "OPTS_LD=\"$LIBDIR\"" >> $ConvUsr
  echo "OPTS_LDXX=\"$LIBDIR\"" >> $ConvUsr
d346 2
a347 2
  echo "OPTS_CC=\"$INCDIR\"" >> $ConvUsr
  echo "OPTS_CXX=\"$INCDIR\"" >> $ConvUsr
@


1.93
log
@removed obsolete opteron build option.
@
text
@d339 10
a348 2
test -n "$LIBDIR" && echo "CMK_LIBDIR=\"$LIBDIR\"" >> $ConvUsr
test -n "$INCDIR" && echo "CMK_INCDIR=\"$INCDIR\"" >> $ConvUsr
@


1.92
log
@fixed path to new simplearrayhello
@
text
@d28 1
a28 1
  ( cd $src ; ls -1 | egrep -v '(^CVS)|(^shmem$)|(^mpi$)|(^sim$)|(^net$)|(^elan$)|(^util$)|(^common$)|(^uth$)|(^conv-mach-fix.sh$)|(^win32$)|(^paragon$)|(^vmi$)' | pr -3 -t )
d32 1
a32 1
  echo 'help smp gm tcp vmi scyld clustermatic opteron bluegene ooc syncft papi'
a51 1
  echo '  opteron         compile for AMD Opteron'
d75 1
a75 1
  echo "  --with-romio       build AMPI with ROMIO library"
@


1.91
log
@added mpt in help page.
@
text
@d391 1
a391 1
	     "pgms/charm++/simplearrayhello"
@


1.90
log
@Bug fix:
   Really blow away charm/bin, lib, include directories, even
if they're not just softlinks.  This lets ./build work properly
even if somebody does "cp -r" on the charm source tree--without
this change, the build would succeed, but charm/bin wouldn't change,
leading to horribly confusing errors.
@
text
@d54 1
@


1.89
log
@renamed Makefile_lb to Make.lb.
@
text
@d304 2
d321 3
a323 3
	for newdir in `echo bin lib lib_so include tmp`
	do
		echo "Soft-linking over $newdir"
d326 1
a326 1
      rm -f $newdir
d328 2
a329 2
		$VERSION/tmp/system_ln $VERSION/$newdir $newdir
	done
@


1.88
log
@link Makefile_lb to tmp.
@
text
@d302 1
a302 1
rm -f $VERSION/tmp/Makefile_lb
d330 2
a332 2
$VERSION/tmp/system_ln "../../src/scripts/Make.depends" $VERSION/tmp/Make.depends
$VERSION/tmp/system_ln "../../src/ck-ldb/Makefile_lb" $VERSION/tmp/Makefile_lb
@


1.87
log
@Added jade, msa targets to comments.
@
text
@d302 1
d332 1
@


1.86
log
@Removed ROMIO from automatic build target. Now we need to add build
option "--with-romio" to build ROMIO with AMPI.
@
text
@d12 1
a12 1
  echo '<targets>: converse charm++ LIBS AMPI FEM bluegene pose'
d23 2
@


1.85
log
@copy fake win32 unistd.h to tmp. (I don't know why it was previously removed by me)
@
text
@d73 1
d178 1
d224 3
d367 5
@


1.84
log
@examples in help page for using --incdir and --libdir.
@
text
@d303 1
@


1.83
log
@Updated build script to support the papi build option.
@
text
@d93 4
@


1.82
log
@if user choose not to build share libs, build script remembers the choice by writing CMK_NO_BUILD_SHARED=true in conv-mach-opt.sh
@
text
@d30 1
a30 1
  echo 'help smp gm tcp vmi scyld clustermatic opteron bluegene ooc syncft'
d62 1
d351 1
a355 1

@


1.81
log
@clean up for building charm shared libs.
@
text
@d214 2
a215 3
	    --no-build-shared|-nobs|--build-shared|-bs)
		# obsolete
		BUILD_SHARED="$1"; shift
d217 3
a219 3
	    --no-shared)
		# obsolete
		BUILD_SHARED="-nobs"; shift
d349 4
@


1.80
log
@remove unistd.h copying for win32
@
text
@d31 1
a31 1
  echo '--incdir --libdir --basedir --build-shared --no-shared -j'
d64 2
a65 2
  echo "  --build-shared  build Charm++ dynamic libraries (.so), this is on by default"
  echo "  --no-shared	  disable the compilation for Charm++'s shared libraries"
d171 1
a171 1
BUILD_SHARED="-build-shared"
d214 4
d219 2
a220 1
		BUILD_SHARED=""; shift
@


1.79
log
@added subscription info.
@
text
@a293 1
	cp $src/win32/unistd.h $VERSION/tmp
@


1.78
log
@added syncft option in help page
@
text
@d99 8
a106 1
  echo 'Thank you for using Charm++, please send questions or comments to Parallel Programming Lab at University of Illinois at Urbana-Champaign(email: ppl@@cs.uiuc.edu).'
@


1.77
log
@added example of using help.
@
text
@d30 1
a30 1
  echo 'help smp gm tcp vmi scyld clustermatic opteron bluegene'
d61 1
d71 1
a71 1
  echo '  -jNUM           parallel make, NUM is the number of paralle make jobs'
@


1.76
log
@minor change for clustermatics
@
text
@d78 3
a80 1
  echo '1. compile Charm++ on Linux with optimizations:'
d82 1
a82 1
  echo '2. compile Charm++ for Linux clustermatic Beowulf cluster with Intel compiler:'
d84 1
a84 1
  echo '3. compile Charm++ for IA64 Linux cluster with MPICH-GM:'
d86 1
a86 1
  echo '4. compile Charm++ for Windows with VC++ (Cygwin required):'
d88 1
a88 1
  echo '5. compile on IBM SP with MPI using parallel gmake, 4 jobs simultaneously:'
d98 1
a98 1
  echo 'Thank you for using Charm++, please send questions or comments to Parallel Programming Lab at University of Illinois at Urbana-Champaign at ppl@@cs.uiuc.edu.'
@


1.75
log
@oops, a silly error when trying to fix the bug that prevent build from abort when a arch is invalid. Refix it.
@
text
@d56 1
a56 1
  echo '  clustermatic    compile for Clustermatic Beowulf cluster based on bproc'
d70 1
a70 1
  echo '  -jNUM          parallel make, NUM is the number of paralle make jobs'
@


1.74
log
@when user gives a wrong arch name e.g. net-linux-bluegene, build should complain and abort.
@
text
@d249 5
a253 1
[ -f $src/$BASEVERSION/conv-mach.h ] || echo "Error> build can not find arch: $BASEVERSION!" && exit 1
d275 1
@


1.73
log
@for parallel make option -j, there is no blank now, e.g. -j8
@
text
@d245 1
a245 1
[ "x$VERSION" = "x" ] && syntax
d249 1
a249 1
[ -f $src/$BASEVERSION/conv-mach.h ] || syntax
@


1.72
log
@added FEM in build target option.
@
text
@d70 1
a70 1
  echo '  -j NUM          parallel make, NUM is the number of paralle make jobs'
d87 2
a88 2
  echo '  MAKE=gmake  ./build charm++ mpi-sp -j 4 -O            # sh'
  echo '  setenv MAKE gmake;  ./build charm++ mpi-sp -j 4 -O    # csh'
d207 3
a209 9
	    -j)
		shift
		MAKEOPTS="$MAKEOPTS -j $1"
		if [ -z "$1" ] 
		then
                  echo "Error> Number of jobs for parallel make is not specified!"
		  echo ''
		  printOption
		fi
@


1.71
log
@link Make.depends into tmp.
@
text
@d12 1
a12 1
  echo '<targets>: converse charm++ LIBS AMPI bluegene pose'
d18 2
a19 1
  echo '  AMPI            compile Adaptive MPI'
@


1.70
log
@fixed example for parallel make.
@
text
@d304 1
@


1.69
log
@add option -j NUM to allow parallel make.
In case gmake has to be used, set MAKE environment variable for build:
MAKE=gmake ./build ...
@
text
@d86 2
a87 1
  echo '  MAKE=gmake  ./build charm++ mpi-sp -j 4'
@


1.68
log
@fixed ooc typo and libs => LIBS
@
text
@d27 4
a30 1
  echo '<options>: help cc cc64 cxx kcc pgcc acc icc ecc gcc3 mpcc smp gm tcp vmi scyld clustermatic opteron bluegene --incdir --libdir --basedir --build-shared --no-shared'
d69 1
d77 1
a77 1
  echo '1. compile Charm++ on Linux with optimization for Charm++ (-DCMK_OPTIMIZE) and -O for g++:'
d85 2
d205 11
d251 2
d339 1
a339 1
echo "Performing 'make $MAKEOPTS $PROGRAM OPTS="$OPTS"' in $VERSION/tmp"
d341 1
a341 1
make $MAKEOPTS $PROGRAM OPTS="$OPTS $BUILD_SHARED"
@


1.67
log
@typo fixed.
@
text
@d12 1
a12 1
  echo '<targets>: converse charm++ libs AMPI bluegene pose'
d19 1
a19 1
  echo '  libs            compile additional parallel libraries with Charm++ core'
d56 1
a56 1
  echo '  occ		  compile with out of core support'
@


1.66
log
@more work in the build help page.
@
text
@d59 1
a59 1
  echo "  --build-shared  build Charm++ dynamic libaries (.so), this is on by default"
d63 3
a65 3
  echo '  --incdir=DIR	  specify additional include path for compilers'
  echo '  --libdir=DIR	  specify additional lib path for compilers'
  echo '  --basedir=DIR	  specify additional path at once - DIR/include and DIR/lib'
@


1.65
log
@reworked the verbose help page with '--help'
@
text
@d12 1
a12 1
  echo '<targets>: converse charm++ libs AMPI IDL TSM SM PVM bluegene'
d14 10
d31 1
a31 1
  echo 'Not all these options are supported by one platform. For platform specific help, use help option:'
d58 4
d66 1
d68 1
a68 4
  echo "Charm++ dynamic libraries:"
  echo "  --build-shared  build Charm++ dynamic libaries (.so), this is on by default"
  echo "  --no-shared	  disable the compilation for Charm++'s shared libraries"
  fi
d72 10
a81 1
  echo '<charmc-options>: normal compiler options e.g. -g -O -save -verbose'
d84 1
a84 1
  echo ' 2. Copies src/Common/scripts/Makefile into <version>/tmp';
d88 1
a88 1
  echo 'Thank you for using Charm++, please send questions or comments to "ppl@@cs.uiuc.edu".'
@


1.64
log
@added clustermatic in help page.
not show vmi in arch list.
@
text
@d17 1
a17 1
  echo '<options>: help cc cc64 cxx kcc pgcc acc icc ecc gcc3 mpcc smp gm tcp vmi scyld clustermatic opteron bluegene --incdir --libdir --basedir --no-shared'
d21 2
a22 2
  echo 'Not all these options are supported by one version, use version based help:'
  echo '  help		version based help message, e.g. ./build charm++ net-linux help'
d25 9
a33 9
  echo '  cc, cc64	For Sun WorkShop C++ 32/64 bit compilers'
  echo '  cxx		DIGITAL C++ compiler (DEC Alpha)'
  echo '  kcc		KAI C++ compiler'
  echo "  pgcc		Portland Group's C++ compiler"
  echo '  acc		HP aCC compiler'
  echo '  icc		Intel C/C++ compiler for Linux IA32'
  echo '  ecc		Intel C/C++ compiler for Linux IA64'
  echo '  gcc3		to use gcc3 - GNU GCC/G++ version 3'
  echo '  mpcc		SUN Solaris C++ compiler for MPI'
d36 7
a42 7
  echo '  opteron	compile for AMD Opteron'
  echo '  smp		support for SMP, multithreaded charm on each node'
  echo '  gm		use Myrinet for communication'
  echo '  tcp		use TCP sockets for communication (ony for net version)'
  echo "  vmi		use NCSA's VMI for communication"
  echo '  scyld		compile for Scyld Beowulf cluster based on bproc'
  echo '  clustermatic	compile for Clustermatic Beowulf cluster based on bproc'
d45 2
a46 2
  echo '  bluegene	compile for BigSim (Blue Gene) simulator'
  echo '  occ		compile with out of core support'
d49 7
a55 4
  echo '  --incdir=DIR	specify additional include path for compilers'
  echo '  --libdir=DIR	specify additional lib path for compilers'
  echo '  --basedir=DIR	specify additional path at once - DIR/include and DIR/lib'
  echo "  --no-shared	disable the compilation for Charm++'s shared libraries"
d57 2
d63 9
a71 4
#  echo ' 2. Copies src/Common/scripts/Makefile into <version>/tmp';
  echo ' 2. Does a "make <target> <version> OPTS=<charmc-options>" in <version>/tmp.'
#  echo "That's all build does.  The rest is handled by the Makefile."
  [ $more = 0 ] && echo "To get more detailed help, run ./build --help"
@


1.63
log
@added -h, --help option to display a much detailed help page.
@
text
@d15 1
a15 1
  ( cd $src ; ls -1 | egrep -v '(^CVS)|(^shmem$)|(^mpi$)|(^sim$)|(^net$)|(^elan$)|(^util$)|(^common$)|(^uth$)|(^conv-mach-fix.sh$)|(^win32$)|(^paragon$)' | pr -3 -t )
d17 1
a17 1
  echo '<options>: help cc cc64 cxx kcc pgcc acc icc ecc gcc3 mpcc smp gm tcp vmi scyld opteron bluegene --incdir --libdir --basedir --no-shared'
d35 1
a35 1
  echo 'Platform specific options (choose multiple):'
d41 2
a42 1
  echo '  scyld		compile for Scyld Beowulf cluster'
@


1.62
log
@don;t show paragon in help page either.
@
text
@d6 2
d12 1
a12 1
  echo '<targets>: converse, charm++ libs AMPI IDL tsm sm pvm sdag bluegene'
d17 25
a41 1
  echo '<options>: help cc cc64 cxx kcc pgcc acc icc ecc gcc3 mpcc smp gm tcp vmi scyld bluegene'
d43 12
a54 1
  echo '<charmc-options>: e.g. -g -save -verbose'
d60 1
a60 1
  exit 1
d123 2
a124 1
[ $# -lt 2 ] && syntax
@


1.61
log
@./build doesnot show non relevant arch.
@
text
@d13 1
a13 1
  ( cd $src ; ls -1 | egrep -v '(^CVS)|(^shmem$)|(^mpi$)|(^sim$)|(^net$)|(^elan$)|(^util$)|(^common$)|(^uth$)|(^conv-mach-fix.sh$)|(^win32$)' | pr -3 -t )
@


1.60
log
@don't blow away conv-mach-opt.[h, sh] when doing second build.
@
text
@d13 1
a13 1
  ( cd $src ; ls -1 | egrep -v '(^CVS)' | pr -3 -t )
@


1.59
log
@added --no-shared to turn of -build-shared option.
@
text
@d225 7
a231 4
echo "Generating $ConvHeader, conv-mach-opt.sh"
echo '/* Build-time options header, automatically generated by charm/build*/'> $ConvHeader
echo '# Built-time options header, automatically generated by charm/build'> $ConvSh
echo '[ -z "$CHARMINC" ] && CHARMINC="."' >> $ConvSh
@


1.58
log
@also symbolic link lib_so
@
text
@d84 1
d126 3
d249 1
a249 1
make $MAKEOPTS $PROGRAM OPTS="$OPTS -build-shared"
@


1.57
log
@fixed a bug that caused --basedir== didn't work.
@
text
@d198 1
a198 1
	for newdir in `echo bin lib include tmp`
@


1.56
log
@buildShared => -build-shared
@
text
@d102 4
a105 4
                dir=`echo $1 | awk -F= '{print $2}'`
		CheckDir $dir/include $dir/lib
          	LIBDIR="$LIBDIR -L$dir/lib";
          	INCDIR="$INCDIR -I$dir/include"; shift
d112 3
a114 3
                dir=`echo $1 | awk -F= '{print $2}'`
		CheckDir $dir
          	LIBDIR="$LIBDIR -L$dir"; shift
d121 3
a123 3
                dir=`echo $1 | awk -F= '{print $2}'`
		CheckDir $dir
          	INCDIR="$INCDIR -I$dir"; shift
@


1.55
log
@build charm .so by default. (appended -buildShared to the make opts)
@
text
@d245 1
a245 1
make $MAKEOPTS $PROGRAM OPTS="$OPTS -buildShared"
@


1.54
log
@Add descriptive comment at start of conv-mach-opt files,
which eliminates compiler warning about empty source file.
@
text
@d245 1
a245 1
make $MAKEOPTS $PROGRAM OPTS="$OPTS"
@


1.53
log
@in the conv-mach-opt.sh file, compiler option must appear before others because other options simply modified compiler settings instead of override each other.
@
text
@d218 1
a218 1
#special options
d222 3
a224 3
/bin/rm -f $ConvHeader  $ConvSh
touch $ConvHeader
echo '[ -z "$CHARMINC" ] && CHARMINC="."' > $ConvSh
@


1.52
log
@Need extra test in case only a compiler is set.
@
text
@d225 6
a237 6
fi
if test -n "$COMPILER"
then
      i="$COMPILER"
      echo '#include "'cc-$i.h'"' >> $ConvHeader
      echo '. $CHARMINC/'"cc-$i.sh" >> $ConvSh
@


1.51
log
@Major changes to build-time option processing:

-Dynamically detect build options based on src/arch files, rather
than hardcoded list.

-Detect compilers based on cc- prefix.

-Search for options in src/arch/common directory.

-Build conv-mach-opt.h as #include's of source conv-mach-*.h's,
rather than just concatenating all the sources together.
@
text
@d163 1
a163 1
if test -n "$BOPTS"
@


1.50
log
@Recognized "lcs" as a compiler option.

Note to Gengbin: it's silly to have to modify build just because
I added a compiler to net-linux.  Can't build just look in net-linux
for a conv-mach-$1?  Or would that interfere with your ordering
requirements?
@
text
@d27 13
a39 9
  echo
  ( str=`cd $src/$BASEVERSION; ls conv-mach-*.h 2>/dev/null | sed 's/conv-mach-\([^.]*\).h/\1/'`;
    if [ -d $src/${ARCH} ]
    then
      str="$str `cd $src/$ARCH; ls conv-mach-*.h 2>/dev/null | sed 's/conv-mach-\([^.]*\).h/\1/'`";
    fi
    printf 'supported options: '
    echo $str)
  echo
d54 16
a69 7
TestIfSupported() {
  if [ ! -f $src/$VERSION/conv-mach-$1.h ] && [ ! -f $src/$ARCH/conv-mach-$1.h ]
  then
    echo; 
    echo "Error> option: $1 is not supported in this version!"; 
    printOption
  fi
a74 3
[ $# -lt 2 ] && syntax


d77 1
d85 8
a95 18
    -*) 
          MAKEOPTS="$MAKEOPTS $1"; shift
	  ;;
    *)
          PROGRAM=$1 ; shift
          VERSION=$1; BASEVERSION=$1; ARCH=`echo $1 | sed -e 's@@-.*@@@@'`; shift
          test "$1" = "help" && printOption
          while [ ! $# -eq 0 ]
          do
            case "$1" in
	    "pgcc"|"ecc"|"icc"|"cxx"|"kcc"|"cc"|"cc64"|"acc"|"gcc3"|"mpcc"|"lcs")
                TestIfSupported $1
                COMPILER=$1; shift
	        ;;
            "gm"|"vmi"|"scyld"|"smp"|"tcp"|"bluegene")
                TestIfSupported $1
                MORE="$MORE $1"; shift
		;;
d125 7
a131 5
            *)
                OPTS="$OPTS $1"; shift
		;;
 	    esac
	  done
d133 22
d159 1
a159 1
	
d162 2
a163 2
#generate VERSION name combining all options.
if test -n "$MORE"
d165 5
a169 2
  MORE=`echo $MORE | awk  '{ for (i = 1; i <= NF; ++i) print $i }' | sort`
  for i in $MORE
a174 6
if test -n "$COMPILER"
then
  VERSION=$VERSION-$COMPILER
  MORE="$COMPILER $MORE"
fi

d221 5
a225 1
if test ! -f $ConvHeader
d227 1
a227 6
  echo "Generating $ConvHeader, conv-mach-opt.sh"
  /bin/rm -f $ConvHeader  $ConvSh
  touch $ConvHeader; touch $ConvSh
  if test -n "$MORE"
  then
    for i in $MORE
d229 2
a230 11
#      touch $VERSION/tmp/$i
      if [ -f $src/$BASEVERSION/conv-mach-$i.h ]
      then
        CONVFILEDIR="$src/$BASEVERSION/"
      else
        CONVFILEDIR="$src/$ARCH"
      fi
      echo '/* '"$CONVFILEDIR/conv-mach-$i.h"' */' >> $ConvHeader
      cat $CONVFILEDIR/conv-mach-$i.h >> $ConvHeader
      echo '# '"$CONVFILEDIR/conv-mach-$i.sh" >> $ConvSh
      cat $CONVFILEDIR/conv-mach-$i.sh >> $ConvSh
a231 1
  fi
d233 7
@


1.49
log
@fixed a bug after reorgnization it fail to detect the common options in net/ and mpi/
@
text
@d87 1
a87 1
	    "pgcc"|"ecc"|"icc"|"cxx"|"kcc"|"cc"|"cc64"|"acc"|"gcc3"|"mpcc")
@


1.48
log
@"-e" doesn't exist in the (stupid) Sun version of "test"; so you have
to use "-r".
@
text
@d28 1
a28 3
  ( cd $src/$BASEVERSION; 
    str=`ls conv-mach-*.h 2>/dev/null | sed 's/conv-mach-\([^.]*\).h/\1/'`;
    cd ../..
d31 1
a31 2
      cd $src/$ARCH
      str="$str `ls conv-mach-*.h 2>/dev/null | sed 's/conv-mach-\([^.]*\).h/\1/'`";
@


1.47
log
@oops. fixed the earlier fix.
@
text
@d182 1
a182 1
    if [ -e $newdir ]
@


1.46
log
@eliminated warnings about softlinking over existing dirs.
@
text
@d182 4
@


1.45
log
@an empty arch directory(net-linux-smp, for example) can fool build directory as
if it is supported. fixed by checking the net-linux-smp/conv-mach.h instead of
checking net-linux-smp itself for errors.
@
text
@d172 1
d178 1
d182 1
a182 5
		if [ -r $newdir ] 
		then
			rm -f $newdir
		fi
		ln -s $VERSION/$newdir $newdir
d186 1
a186 2
chmod +x $VERSION/tmp/system_ln
ln -s "../../src/scripts/Makefile" $VERSION/tmp/Makefile
@


1.44
log
@Reorganized source tree.
@
text
@d138 1
a138 1
[ -d $src/$BASEVERSION ] || syntax
@


1.43
log
@add both icc and ecc.
@
text
@d3 3
d13 1
a13 1
  ( cd src ; ls -1 | egrep -v '(^Common)|(^CVS)|(^QuickThreads)|(^ccs-client)' | pr -3 -t )
d28 1
a28 1
  ( cd src/$BASEVERSION; 
d31 1
a31 1
    if [ -d src/Common.${ARCH} ]
d33 1
a33 1
      cd src/Common.$ARCH
d54 1
a54 1
  if [ ! -f src/$VERSION/conv-mach-$1.h ] && [ ! -f src/Common.$ARCH/conv-mach-$1.h ]
d138 1
a138 2
( echo $BASEVERSION | egrep -s '^Common' ) && syntax
[ -d src/$BASEVERSION ] || syntax
d161 1
a161 1
echo "Copying src/Common/scripts/Makefile to $VERSION/tmp"
d169 3
a171 3
	cp src/Common.win32/unix2nt* /bin
	cp src/Common.win32/system_ln $VERSION/tmp
	cp src/Common.win32/unistd.h $VERSION/tmp
d189 1
a189 1
ln -s "../../src/Common/scripts/Makefile" $VERSION/tmp/Makefile
d211 1
a211 1
      if [ -f src/$BASEVERSION/conv-mach-$i.h ]
d213 1
a213 1
        CONVFILEDIR="src/$BASEVERSION/"
d215 1
a215 1
        CONVFILEDIR="src/Common.$ARCH"
@


1.42
log
@rename icc to ecc
@
text
@d12 1
a12 1
  echo '<options>: help cc cc64 cxx kcc pgcc acc ecc gcc3 mpcc smp gm tcp vmi scyld bluegene'
d87 1
a87 1
	    "pgcc"|"ecc"|"cxx"|"kcc"|"cc"|"cc64"|"acc"|"gcc3"|"mpcc")
@


1.41
log
@bluegene as an option.
@
text
@d12 1
a12 1
  echo '<options>: help cc cc64 cxx kcc pgcc acc icc gcc3 mpcc smp gm tcp vmi scyld bluegene'
d87 1
a87 1
	    "pgcc"|"icc"|"cxx"|"kcc"|"cc"|"cc64"|"acc"|"gcc3"|"mpcc")
@


1.40
log
@conv-mach-tcp for example are shared by all net version, so instead of make duplicates in all net-* versions, move it to Common.net.
@
text
@d12 1
a12 1
  echo '<options>: help cc cc64 cxx kcc pgcc acc icc gcc3 mpcc smp gm tcp vmi scyld '
d91 1
a91 1
            "gm"|"vmi"|"scyld"|"smp"|"tcp")
@


1.39
log
@ln -f cannot overwrite a created file on Sun.
@
text
@d26 7
a32 1
    str=`ls conv-mach-*.h 2>/dev/null | sed 's/conv-mach-\([^.]*\).h/\1/'`; 
d34 1
a34 1
    echo $str )
d50 14
a63 1
  [ $# -lt 2 ] && syntax
d72 1
d82 1
a82 1
          VERSION=$1; BASEVERSION=$1; shift
d88 1
a88 6
                if [ ! -f src/$VERSION/conv-mach-$1.h ]
                then
                  echo; 
		  echo "Error> option: $1 is not supported in this version!"; 
                  printOption
                fi
d92 1
a92 6
                if [ ! -f src/$VERSION/conv-mach-$1.h ]
                then
                  echo; 
		  echo "Error> option: $1 is not supported in this version!";
                  printOption
                fi
d209 10
a218 4
      echo '/* '"src/$BASEVERSION/conv-mach-$i.h"' */' >> $ConvHeader
      cat src/$BASEVERSION/conv-mach-$i.h >> $ConvHeader
      echo '# '"src/$BASEVERSION/conv-mach-$i.sh" >> $ConvSh
      cat src/$BASEVERSION/conv-mach-$i.sh >> $ConvSh
@


1.38
log
@generated an empty conv-common.h by default.
@
text
@a185 3
#common options, overwrite by Common.net Common.mpi
touch $VERSION/tmp/conv-common.h

@


1.37
log
@added --basedir option
also --incdir= --libdir= --basedir= are fine;
add correctness checking for the directories.
@
text
@d186 3
@


1.36
log
@option tcp
@
text
@d33 11
d50 1
d85 11
d97 1
a97 1
          	shift 
d100 5
d106 1
a106 1
          	shift 
d108 5
@


1.35
log
@add mpcc.
@
text
@d12 1
a12 1
  echo '<options>: help cc cc64 cxx kcc pgcc acc icc gcc3 mpcc smp gm vmi scyld '
d64 1
a64 1
            "gm"|"vmi"|"scyld"|"smp")
@


1.34
log
@sort options like gm vmi scyld smp
@
text
@d12 1
a12 1
  echo '<options>: help cc cc64 cxx kcc pgcc acc icc gcc3 smp gm vmi scyld '
d55 1
a55 1
	    "pgcc"|"icc"|"cxx"|"kcc"|"cc"|"cc64"|"acc"|"gcc3")
@


1.33
log
@SUN CC complains about blank after -I -L.
@
text
@d12 1
a12 1
  echo '<options>: help cc cc64 cxx kcc pgcc acc icc smp gm vmi scyld '
d98 1
@


1.32
log
@build now take --libdir and --incdir which are user defined directories that override default ones in conv-mach-*.sh.
@
text
@d75 1
a75 1
          	LIBDIR="$LIBDIR -L $1"; shift
d79 1
a79 1
          	INCDIR="$INCDIR -I $1"; shift
@


1.31
log
@Changed -L test to -r, because -L doesn't exist on many machines.
@
text
@d39 2
d54 31
a84 19
            if test "$1" = "pgcc" || test "$1" = "icc" || test "$1" = "cxx" || test "$1" = "kcc" || test "$1" = "cc" || test "$1" = "cc64" || test "$1" = "acc" || test "$1" = "gcc3"
            then
              if [ ! -f src/$VERSION/conv-mach-$1.h ]
              then
                echo; echo "Error> option: $1 is not supported in this version!"; 
                printOption
              fi
              COMPILER=$1; shift;
            elif test "$1" = "gm" || test "$1" = "vmi" || test "$1" = "scyld" || test "$1" = "smp"
            then
              if [ ! -f src/$VERSION/conv-mach-$1.h ]
              then
                echo; echo "Error> option: $1 is not supported in this version!";
                printOption
              fi
              MORE="$MORE $1"; shift;
            else
              OPTS="$OPTS $1"; shift;
            fi
d144 7
@


1.30
log
@Make soft links to the current version's bin, lib, and include directories.
This should make it easier for people to find charmc, and makes it
easier to describe the layout of the charm directory.
@
text
@d117 1
a117 1
	for dir in `echo bin lib include tmp`
d119 6
a124 2
		[ -L $dir ] && rm -f $dir
		ln -s $VERSION/$dir $dir
@


1.29
log
@Added gcc3 as an option for net-linux.
@
text
@d15 1
a15 1
  echo 'Note: This script is trivial.  It'
d100 1
d117 5
d160 1
a160 1
	     "$VERSION/pgms/charm++/simplearrayhello"
@


1.28
log
@Added "Charm++ build sucessfully" or "Charm++ not built!" message,
depending on whether make succeeded or not.
A user asked for this, and it makes sense.
@
text
@d52 1
a52 1
            if test "$1" = "pgcc" || test "$1" = "icc" || test "$1" = "cxx" || test "$1" = "kcc" || test "$1" = "cc" || test "$1" = "cc64" || test "$1" = "acc"
@


1.27
log
@add some blank lines.
@
text
@d145 18
a162 1
cd $VERSION/tmp ; make $MAKEOPTS $PROGRAM OPTS="$OPTS"
@


1.26
log
@add acc
@
text
@d6 1
a6 1
#  echo ''
d11 1
a11 1
#  echo ''
d13 1
@


1.25
log
@add smp option
@
text
@d12 1
a12 1
  echo '<options>: help cc cc64 cxx kcc pgcc icc smp gm vmi scyld '
d51 1
a51 1
            if test "$1" = "pgcc" || test "$1" = "icc" || test "$1" = "cxx" || test "$1" = "kcc" || test "$1" = "cc" || test "$1" = "cc64"
@


1.24
log
@add cc64 for Solaris CC 64 bits.
@
text
@d12 1
a12 1
  echo '<options>: help cc cc64 cxx kcc pgcc icc gm vmi scyld '
d59 1
a59 1
            elif test "$1" = "gm" || test "$1" = "vmi" || test "$1" = "scyld"
@


1.23
log
@added cc to help page.
@
text
@d12 1
a12 1
  echo '<options>: help cc cxx kcc pgcc icc gm vmi scyld '
d51 1
a51 1
            if test "$1" = "pgcc" || test "$1" = "icc" || test "$1" = "cxx" || test "$1" = "kcc" || test "$1" = "cc"
@


1.22
log
@added kcc in help page.
@
text
@d12 1
a12 1
  echo '<options>: help cxx kcc pgcc icc gm vmi scyld '
d51 1
a51 1
            if test "$1" = "pgcc" || test "$1" = "icc" || test "$1" = "cxx" || test "$1" = "kcc"
d92 1
a92 1
  MORE="$MORE $COMPILER"
@


1.21
log
@added scyld and cxx.
@
text
@d12 1
a12 1
  echo '<options>:  help cxx pgcc icc gm vmi scyld '
d51 1
a51 1
            if test "$1" = "pgcc" || test "$1" = "icc" || test "$1" = "cxx"
@


1.20
log
@fixed the problem when new conv-mach-opt.h created, whole charm++ is re-built.
@
text
@d12 1
a12 1
  echo '<options>:  help vmi gm pgcc icc'
d51 1
a51 1
            if test "$1" = "pgcc" || test "$1" = "icc"
d59 1
a59 1
            elif test "$1" = "gm" || test "$1" = "vmi"
@


1.19
log
@build with "help" as option will show the supported args for this platform.
@
text
@d121 3
a123 6
echo "Generating $VERSION/tmp/conv-mach-opt.h, conv-mach-opt.sh"
/bin/rm -f $VERSION/tmp/conv-mach-opt.h
/bin/rm -f $VERSION/tmp/conv-mach-opt.sh
touch $VERSION/tmp/conv-mach-opt.h
touch $VERSION/tmp/conv-mach-opt.sh
if test -n "$MORE"
d125 14
a138 8
  for i in $MORE
  do
    touch $VERSION/tmp/$i
    echo '/* '"src/$BASEVERSION/conv-mach-$i.h"' */' >> $VERSION/tmp/conv-mach-opt.h
    cat src/$BASEVERSION/conv-mach-$i.h >> $VERSION/tmp/conv-mach-opt.h
    echo '# '"src/$BASEVERSION/conv-mach-$i.sh" >> $VERSION/tmp/conv-mach-opt.sh
    cat src/$BASEVERSION/conv-mach-$i.sh >> $VERSION/tmp/conv-mach-opt.sh
  done
@


1.18
log
@ecl => icc
@
text
@d12 1
a12 1
  echo '<options>:  vmi gm pgcc icc'
d48 1
@


1.17
log
@support for intel C/C++ compiler.
@
text
@d12 1
a12 1
  echo '<options>:  vmi gm pgcc ecl'
d50 1
a50 1
            if test "$1" = "pgcc" || test "$1" = "ecl"
@


1.16
log
@ia minor change.
@
text
@d12 1
a12 1
  echo '<options>:  vmi gm pgcc'
d50 1
a50 1
            if test "$1" = "pgcc"
@


1.15
log
@build will print list of supported options if it is wrong.
@
text
@d25 1
a25 1
    str=`ls conv-mach-*.h | sed 's/conv-mach-\([^.]*\).*/\1/'`; 
@


1.14
log
@build now recognize pgcc as additional args.
@
text
@d22 10
d54 2
a55 3
                echo; 
                echo "Error> option: $1 is not supported in this version!"; echo
                exit 1
d62 2
a63 3
                echo; 
                echo "Error> option: $1 is not supported in this version!"; echo
                exit 1
d79 1
@


1.13
log
@small change
@
text
@d12 1
a12 1
  echo '<options>:  vmi gm '
d27 1
d40 10
a49 1
            if test "$1" = "gm" || test "$1" = "vmi"
d77 6
@


1.12
log
@build will create a version file (.vdir) under tmp.
@
text
@d61 1
a61 1
if test -n $MORE
@


1.11
log
@added vmi.
@
text
@d36 1
a36 1
          VERSION=$1 ; shift
d58 10
a67 2
( echo $VERSION | egrep -s '^Common' ) && syntax
[ -d src/$VERSION ] || syntax
d105 4
a108 4
    echo '/* '"src/$VERSION/conv-mach-$i.h"' */' >> $VERSION/tmp/conv-mach-opt.h
    cat src/$VERSION/conv-mach-$i.h >> $VERSION/tmp/conv-mach-opt.h
    echo '# '"src/$VERSION/conv-mach-$i.sh" >> $VERSION/tmp/conv-mach-opt.sh
    cat src/$VERSION/conv-mach-$i.sh >> $VERSION/tmp/conv-mach-opt.sh
d111 2
@


1.10
log
@build will take additional commandline options to generate conv-mach-opt.h and conv-mach-opt.sh for additional features like compile with GM.
@
text
@d12 1
a12 1
  echo '<options>:  gm'
d39 1
a39 1
            if test "$1" = "gm"
d44 1
a44 1
                echo "Error> option: $1 is not supported! in this version"; echo
d87 1
a87 1
echo "Generating $VERSION/tmp/conv-mach-opt.h"
d96 2
d99 1
@


1.9
log
@ampi => AMPI
@
text
@d5 1
a5 1
  echo 'Usage: build <target> <version> [charmc-options ...]'
d12 2
a13 1
  echo 'example <charmc-options>: -g -save -verbose'
d26 1
d39 12
a50 1
            OPTS="$OPTS $1"; shift
d85 15
@


1.8
log
@Replaced "goto syntax" with just "syntax", which
works on non-bash /bin/sh'es.
@
text
@d7 1
a7 1
  echo '<targets>: converse, charm++ libs ampi IDL tsm sm pvm sdag bluegene'
@


1.7
log
@add bluegene in help page.
@
text
@d46 1
a46 1
[ -d src/$VERSION ] || goto syntax
@


1.6
log
@copy unistd.h from Common.win32 to version/tmp.
@
text
@d7 1
a7 1
  echo '<targets>: converse, charm++ libs ampi IDL tsm sm pvm sdag'
@


1.5
log
@split version into 3 columes due to some long names, make the words short for fit into the screen.
@
text
@d62 1
@


1.4
log
@changed pr -4t to pr -4 -t, this fix the pr on ibm sp.
@
text
@d6 1
a6 1
  echo ''
d10 2
a11 2
  ( cd src ; ls -1 | egrep -v '(^Common)|(^CVS)|(^QuickThreads)|(^ccs-client)' | pr -4 -t )
  echo ''
d15 3
a17 3
  echo ' 2. Copies src/Common/scripts/Makefile into <version>/tmp';
  echo ' 3. Does a "make <target> <version> OPTS=<charmc-options>" in <version>/tmp.'
  echo "That's all build does.  The rest is handled by the Makefile."
@


1.3
log
@Changes for win32 build under Cygwin with Visual C++ compilers--
we must copy all header files, etc instead of using the Cygwin
soft-links, which Visual C++ does not recognize.
@
text
@d10 1
a10 1
  ( cd src ; ls -1 | egrep -v '(^Common)|(^CVS)|(^QuickThreads)|(^ccs-client)' | pr -4t )
@


1.2
log
@removed references to super_install.
@
text
@d54 16
d71 1
@


1.1
log
@Renamed super_install as build.
@
text
@d5 1
a5 1
  echo 'Usage: SUPER-INSTALL <target> <version> [charmc-options ...]'
d17 1
a17 1
  echo "That's all SUPER_INSTALL does.  The rest is handled by the Makefile."
@

