head	1.217;
access;
symbols
	charm6_1:1.217
	charm_6_0_1:1.217
	charm6_0_1:1.214
	charm6_0:1.196
	ChaNGa_1-0:1.194
	charm5_9:1.178
	charm_5-4-2:1.64
	charm_5-4-1:1.59
	pre-winnt-version:1.27
	charm500:1.16
	charm499:1.14;
locks; strict;
comment	@# @;


1.217
date	2009.02.20.21.39.33;	author kunzman;	state Exp;
branches;
next	1.216;
commitid	OsHNUZEEfl34HdDt;

1.216
date	2009.02.18.22.19.22;	author kunzman;	state Exp;
branches;
next	1.215;
commitid	SbmQnxOSBDRUYXCt;

1.215
date	2009.02.18.20.28.29;	author kunzman;	state Exp;
branches;
next	1.214;
commitid	CkWG7tWcUiMvmXCt;

1.214
date	2009.02.09.16.43.45;	author gzheng;	state Exp;
branches;
next	1.213;
commitid	AMEd6nYhDvEvpMBt;

1.213
date	2009.02.06.07.52.43;	author gzheng;	state Exp;
branches;
next	1.212;
commitid	e6luDuzYIkjrzlBt;

1.212
date	2009.02.05.22.17.15;	author gzheng;	state Exp;
branches;
next	1.211;
commitid	F71l2vJt7QW5oiBt;

1.211
date	2009.02.05.21.28.52;	author abecker;	state Exp;
branches;
next	1.210;
commitid	L87zAC44XIXx7iBt;

1.210
date	2009.02.05.14.16.29;	author gzheng;	state Exp;
branches;
next	1.209;
commitid	oPzGx9BDIzQ8JfBt;

1.209
date	2009.02.04.22.47.22;	author kunzman;	state Exp;
branches;
next	1.208;
commitid	23Qy8gi0EBQhAaBt;

1.208
date	2009.01.30.17.50.58;	author gzheng;	state Exp;
branches;
next	1.207;
commitid	Fl0MhxrVQH1v6vAt;

1.207
date	2009.01.29.18.05.07;	author gzheng;	state Exp;
branches;
next	1.206;
commitid	AkwaCy6isAgudnAt;

1.206
date	2008.11.25.04.09.52;	author gzheng;	state Exp;
branches;
next	1.205;
commitid	tqB1Iaj0Wd7zGWrt;

1.205
date	2008.11.22.03.58.29;	author cheelee;	state Exp;
branches;
next	1.204;
commitid	FSz2ZeuEX9fxIyrt;

1.204
date	2008.11.13.04.42.37;	author idooley2;	state Exp;
branches;
next	1.203;
commitid	0a1OWxkQk8gufpqt;

1.203
date	2008.10.09.05.36.21;	author gioachin;	state Exp;
branches;
next	1.202;
commitid	2JVcoEmrTK4WFUlt;

1.202
date	2008.09.13.20.40.07;	author cheelee;	state Exp;
branches;
next	1.201;
commitid	ig3wL9JBHchBvEit;

1.201
date	2008.05.22.06.12.18;	author gzheng;	state Exp;
branches;
next	1.200;
commitid	K1oCDGRjanK2nV3t;

1.200
date	2008.04.24.02.15.37;	author gioachin;	state Exp;
branches;
next	1.199;
commitid	j9iuUFCQKLfSXi0t;

1.199
date	2008.03.27.16.31.05;	author gzheng;	state Exp;
branches;
next	1.198;
commitid	KqoLKpDQrRIUAMWs;

1.198
date	2008.03.26.21.15.01;	author gioachin;	state Exp;
branches;
next	1.197;
commitid	onD2k8kxnetucGWs;

1.197
date	2008.03.26.03.21.33;	author gioachin;	state Exp;
branches;
next	1.196;
commitid	YnBbeF1U3aMggAWs;

1.196
date	2007.04.24.19.13.21;	author idooley2;	state Exp;
branches;
next	1.195;
commitid	5434462e56ab4567;

1.195
date	2007.02.14.01.46.49;	author idooley2;	state Exp;
branches;
next	1.194;
commitid	4f1845d269d84567;

1.194
date	2006.12.10.04.39.45;	author gzheng;	state Exp;
branches;
next	1.193;
commitid	7c81457b8f6f4567;

1.193
date	2006.12.06.02.53.12;	author cheelee;	state Exp;
branches;
next	1.192;
commitid	5a19457630524567;

1.192
date	2006.07.11.16.04.29;	author gzheng;	state Exp;
branches;
next	1.191;

1.191
date	2006.07.11.04.36.24;	author gzheng;	state Exp;
branches;
next	1.190;

1.190
date	2006.07.11.04.26.57;	author gzheng;	state Exp;
branches;
next	1.189;

1.189
date	2006.06.09.04.32.12;	author gzheng;	state Exp;
branches;
next	1.188;

1.188
date	2006.04.16.05.00.57;	author chao;	state Exp;
branches;
next	1.187;

1.187
date	2006.03.31.23.26.59;	author gzheng;	state Exp;
branches;
next	1.186;

1.186
date	2006.03.22.04.16.12;	author gzheng;	state Exp;
branches;
next	1.185;

1.185
date	2006.03.16.16.31.23;	author gzheng;	state Exp;
branches;
next	1.184;

1.184
date	2006.01.11.23.10.34;	author chao;	state Exp;
branches;
next	1.183;

1.183
date	2005.12.09.18.15.37;	author idooley2;	state Exp;
branches;
next	1.182;

1.182
date	2005.11.25.03.56.30;	author gzheng;	state Exp;
branches;
next	1.181;

1.181
date	2005.11.24.07.17.00;	author gzheng;	state Exp;
branches;
next	1.180;

1.180
date	2005.09.04.06.55.56;	author gzheng;	state Exp;
branches;
next	1.179;

1.179
date	2005.07.23.19.54.36;	author chao;	state Exp;
branches;
next	1.178;

1.178
date	2005.01.25.23.13.30;	author gzheng;	state Exp;
branches;
next	1.177;

1.177
date	2005.01.25.21.22.40;	author gzheng;	state Exp;
branches;
next	1.176;

1.176
date	2005.01.16.05.50.35;	author gzheng;	state Exp;
branches;
next	1.175;

1.175
date	2005.01.12.04.58.05;	author gzheng;	state Exp;
branches;
next	1.174;

1.174
date	2004.11.30.21.35.30;	author gzheng;	state Exp;
branches;
next	1.173;

1.173
date	2004.11.19.05.44.13;	author gzheng;	state Exp;
branches;
next	1.172;

1.172
date	2004.10.29.20.39.34;	author gzheng;	state Exp;
branches;
next	1.171;

1.171
date	2004.10.25.04.54.08;	author gzheng;	state Exp;
branches;
next	1.170;

1.170
date	2004.10.25.04.40.39;	author gzheng;	state Exp;
branches;
next	1.169;

1.169
date	2004.10.22.18.48.46;	author gzheng;	state Exp;
branches;
next	1.168;

1.168
date	2004.10.21.18.19.52;	author gzheng;	state Exp;
branches;
next	1.167;

1.167
date	2004.10.20.22.40.43;	author gzheng;	state Exp;
branches;
next	1.166;

1.166
date	2004.10.20.05.03.58;	author gzheng;	state Exp;
branches;
next	1.165;

1.165
date	2004.10.14.20.42.20;	author gzheng;	state Exp;
branches;
next	1.164;

1.164
date	2004.10.11.05.05.45;	author gzheng;	state Exp;
branches;
next	1.163;

1.163
date	2004.10.11.03.07.35;	author gzheng;	state Exp;
branches;
next	1.162;

1.162
date	2004.10.01.19.40.38;	author gzheng;	state Exp;
branches;
next	1.161;

1.161
date	2004.10.01.18.48.02;	author gzheng;	state Exp;
branches;
next	1.160;

1.160
date	2004.08.13.19.16.52;	author olawlor;	state Exp;
branches;
next	1.159;

1.159
date	2004.06.18.23.28.17;	author gzheng;	state Exp;
branches;
next	1.158;

1.158
date	2004.06.03.20.35.53;	author gzheng;	state Exp;
branches;
next	1.157;

1.157
date	2004.05.28.18.20.19;	author gzheng;	state Exp;
branches;
next	1.156;

1.156
date	2004.05.27.18.50.40;	author gzheng;	state Exp;
branches;
next	1.155;

1.155
date	2004.05.27.17.58.44;	author gzheng;	state Exp;
branches;
next	1.154;

1.154
date	2004.05.13.21.57.09;	author olawlor;	state Exp;
branches;
next	1.153;

1.153
date	2004.05.06.19.57.22;	author gzheng;	state Exp;
branches;
next	1.152;

1.152
date	2004.03.06.02.27.07;	author gzheng;	state Exp;
branches;
next	1.151;

1.151
date	2004.02.09.18.10.03;	author olawlor;	state Exp;
branches;
next	1.150;

1.150
date	2004.02.02.23.25.36;	author olawlor;	state Exp;
branches;
next	1.149;

1.149
date	2004.02.02.06.15.23;	author gzheng;	state Exp;
branches;
next	1.148;

1.148
date	2004.01.30.19.50.01;	author gzheng;	state Exp;
branches;
next	1.147;

1.147
date	2004.01.30.04.02.22;	author gzheng;	state Exp;
branches;
next	1.146;

1.146
date	2004.01.28.16.48.33;	author gzheng;	state Exp;
branches;
next	1.145;

1.145
date	2004.01.11.22.08.34;	author gzheng;	state Exp;
branches;
next	1.144;

1.144
date	2004.01.11.19.43.11;	author gzheng;	state Exp;
branches;
next	1.143;

1.143
date	2004.01.06.23.05.44;	author chao;	state Exp;
branches;
next	1.142;

1.142
date	2003.12.04.04.42.52;	author gzheng;	state Exp;
branches;
next	1.141;

1.141
date	2003.11.12.02.04.58;	author gzheng;	state Exp;
branches;
next	1.140;

1.140
date	2003.11.05.06.29.39;	author gzheng;	state Exp;
branches;
next	1.139;

1.139
date	2003.10.27.21.41.19;	author gzheng;	state Exp;
branches;
next	1.138;

1.138
date	2003.10.26.06.51.00;	author gzheng;	state Exp;
branches;
next	1.137;

1.137
date	2003.10.11.02.39.14;	author chao;	state Exp;
branches;
next	1.136;

1.136
date	2003.09.27.07.22.59;	author gzheng;	state Exp;
branches;
next	1.135;

1.135
date	2003.09.26.18.16.13;	author olawlor;	state Exp;
branches;
next	1.134;

1.134
date	2003.09.14.22.20.07;	author gzheng;	state Exp;
branches;
next	1.133;

1.133
date	2003.08.29.16.05.59;	author gzheng;	state Exp;
branches;
next	1.132;

1.132
date	2003.08.28.22.28.48;	author gzheng;	state Exp;
branches;
next	1.131;

1.131
date	2003.08.20.04.59.27;	author gzheng;	state Exp;
branches;
next	1.130;

1.130
date	2003.08.01.05.50.47;	author gzheng;	state Exp;
branches;
next	1.129;

1.129
date	2003.07.18.03.20.06;	author olawlor;	state Exp;
branches;
next	1.128;

1.128
date	2003.07.09.19.36.02;	author olawlor;	state Exp;
branches;
next	1.127;

1.127
date	2003.06.27.19.04.25;	author olawlor;	state Exp;
branches;
next	1.126;

1.126
date	2003.06.15.05.29.18;	author gzheng;	state Exp;
branches;
next	1.125;

1.125
date	2003.06.06.00.42.06;	author gzheng;	state Exp;
branches;
next	1.124;

1.124
date	2003.06.02.00.14.58;	author gzheng;	state Exp;
branches;
next	1.123;

1.123
date	2003.06.01.23.35.15;	author gzheng;	state Exp;
branches;
next	1.122;

1.122
date	2003.06.01.22.17.18;	author gzheng;	state Exp;
branches;
next	1.121;

1.121
date	2003.05.31.20.58.40;	author gzheng;	state Exp;
branches;
next	1.120;

1.120
date	2003.05.30.07.25.52;	author gzheng;	state Exp;
branches;
next	1.119;

1.119
date	2003.05.29.22.08.14;	author gzheng;	state Exp;
branches;
next	1.118;

1.118
date	2003.05.29.17.18.36;	author gzheng;	state Exp;
branches;
next	1.117;

1.117
date	2003.05.29.15.53.39;	author gzheng;	state Exp;
branches;
next	1.116;

1.116
date	2003.05.29.04.40.39;	author gzheng;	state Exp;
branches;
next	1.115;

1.115
date	2003.05.28.06.37.48;	author gzheng;	state Exp;
branches;
next	1.114;

1.114
date	2003.05.26.04.51.39;	author gzheng;	state Exp;
branches;
next	1.113;

1.113
date	2003.05.25.21.48.32;	author gzheng;	state Exp;
branches;
next	1.112;

1.112
date	2003.05.25.18.42.20;	author gzheng;	state Exp;
branches;
next	1.111;

1.111
date	2003.05.25.18.25.12;	author gzheng;	state Exp;
branches;
next	1.110;

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

1.109
date	2003.05.18.06.22.19;	author gzheng;	state Exp;
branches;
next	1.108;

1.108
date	2003.05.16.03.17.52;	author gzheng;	state Exp;
branches;
next	1.107;

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

1.106
date	2003.05.09.01.55.18;	author olawlor;	state Exp;
branches;
next	1.105;

1.105
date	2003.05.08.23.00.20;	author olawlor;	state Exp;
branches;
next	1.104;

1.104
date	2003.05.08.16.55.40;	author olawlor;	state Exp;
branches;
next	1.103;

1.103
date	2003.04.22.20.33.36;	author olawlor;	state Exp;
branches;
next	1.102;

1.102
date	2003.04.01.16.19.37;	author olawlor;	state Exp;
branches;
next	1.101;

1.101
date	2003.03.27.22.49.28;	author olawlor;	state Exp;
branches;
next	1.100;

1.100
date	2003.03.27.17.25.58;	author chao;	state Exp;
branches;
next	1.99;

1.99
date	2003.03.27.17.18.04;	author chao;	state Exp;
branches;
next	1.98;

1.98
date	2003.03.27.06.53.08;	author chao;	state Exp;
branches;
next	1.97;

1.97
date	2003.03.21.22.18.10;	author olawlor;	state Exp;
branches;
next	1.96;

1.96
date	2003.01.20.20.23.43;	author olawlor;	state Exp;
branches;
next	1.95;

1.95
date	2002.12.16.20.23.44;	author olawlor;	state Exp;
branches;
next	1.94;

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

1.93
date	2002.10.24.22.37.51;	author olawlor;	state Exp;
branches;
next	1.92;

1.92
date	2002.10.02.21.20.19;	author olawlor;	state Exp;
branches;
next	1.91;

1.91
date	2002.08.12.23.51.52;	author olawlor;	state Exp;
branches;
next	1.90;

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

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

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

1.87
date	2002.08.06.19.54.27;	author olawlor;	state Exp;
branches;
next	1.86;

1.86
date	2002.07.30.23.15.45;	author olawlor;	state Exp;
branches;
next	1.85;

1.85
date	2002.07.24.20.50.13;	author olawlor;	state Exp;
branches;
next	1.84;

1.84
date	2002.07.19.22.40.59;	author olawlor;	state Exp;
branches;
next	1.83;

1.83
date	2002.03.16.23.04.35;	author milind;	state Exp;
branches;
next	1.82;

1.82
date	2002.03.08.23.10.39;	author unger1;	state Exp;
branches;
next	1.81;

1.81
date	2002.03.01.19.41.25;	author olawlor;	state Exp;
branches;
next	1.80;

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

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

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

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

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

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

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

1.73
date	2001.12.06.23.36.18;	author olawlor;	state Exp;
branches;
next	1.72;

1.72
date	2001.10.29.21.18.43;	author olawlor;	state Exp;
branches;
next	1.71;

1.71
date	2001.09.05.19.22.38;	author olawlor;	state Exp;
branches;
next	1.70;

1.70
date	2001.09.05.05.08.00;	author milind;	state Exp;
branches;
next	1.69;

1.69
date	2001.08.27.17.19.11;	author olawlor;	state Exp;
branches;
next	1.68;

1.68
date	2001.07.23.16.09.38;	author olawlor;	state Exp;
branches;
next	1.67;

1.67
date	2001.07.11.18.53.40;	author milind;	state Exp;
branches;
next	1.66;

1.66
date	2001.07.06.18.27.53;	author olawlor;	state Exp;
branches;
next	1.65;

1.65
date	2001.05.25.07.52.06;	author milind;	state Exp;
branches;
next	1.64;

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

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

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

1.61
date	2001.03.29.10.53.22;	author milind;	state Exp;
branches;
next	1.60;

1.60
date	2001.03.12.22.51.48;	author milind;	state Exp;
branches;
next	1.59;

1.59
date	2001.03.08.07.36.24;	author milind;	state Exp;
branches;
next	1.58;

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

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

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

1.55
date	2001.01.29.21.32.54;	author olawlor;	state Exp;
branches;
next	1.54;

1.54
date	2001.01.15.10.22.34;	author milind;	state Exp;
branches;
next	1.53;

1.53
date	2000.12.21.07.38.42;	author milind;	state Exp;
branches;
next	1.52;

1.52
date	2000.12.15.21.26.04;	author gzheng;	state Exp;
branches;
next	1.51;

1.51
date	2000.12.15.17.31.00;	author milind;	state Exp;
branches;
next	1.50;

1.50
date	2000.12.04.21.49.49;	author gzheng;	state Exp;
branches;
next	1.49;

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

1.48
date	2000.12.02.06.52.28;	author milind;	state Exp;
branches;
next	1.47;

1.47
date	2000.12.02.05.34.47;	author olawlor;	state Exp;
branches;
next	1.46;

1.46
date	2000.11.17.18.14.49;	author gzheng;	state Exp;
branches;
next	1.45;

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

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

1.43
date	2000.10.15.07.49.35;	author milind;	state Exp;
branches;
next	1.42;

1.42
date	2000.09.15.18.57.05;	author milind;	state Exp;
branches;
next	1.41;

1.41
date	2000.09.15.18.07.28;	author milind;	state Exp;
branches;
next	1.40;

1.40
date	2000.09.13.19.44.44;	author milind;	state Exp;
branches;
next	1.39;

1.39
date	2000.08.11.17.47.24;	author milind;	state Exp;
branches;
next	1.38;

1.38
date	2000.08.07.17.00.48;	author milind;	state Exp;
branches;
next	1.37;

1.37
date	2000.08.04.22.12.37;	author milind;	state Exp;
branches;
next	1.36;

1.36
date	2000.07.24.20.15.04;	author milind;	state Exp;
branches;
next	1.35;

1.35
date	2000.07.19.11.41.58;	author milind;	state Exp;
branches;
next	1.34;

1.34
date	2000.07.18.20.13.54;	author milind;	state Exp;
branches;
next	1.33;

1.33
date	2000.07.10.18.52.03;	author milind;	state Exp;
branches;
next	1.32;

1.32
date	2000.07.05.20.30.05;	author milind;	state Exp;
branches;
next	1.31;

1.31
date	2000.04.25.21.32.56;	author gzheng;	state Exp;
branches;
next	1.30;

1.30
date	2000.04.04.19.48.48;	author jdesouza;	state Exp;
branches;
next	1.29;

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

1.28
date	2000.03.09.20.05.19;	author milind;	state Exp;
branches;
next	1.27;

1.27
date	2000.02.06.06.06.31;	author milind;	state Exp;
branches;
next	1.26;

1.26
date	2000.02.06.01.55.24;	author milind;	state Exp;
branches;
next	1.25;

1.25
date	99.11.01.19.07.40;	author milind;	state Exp;
branches;
next	1.24;

1.24
date	99.10.29.18.54.47;	author olawlor;	state Exp;
branches;
next	1.23;

1.23
date	99.10.28.08.44.16;	author milind;	state Exp;
branches;
next	1.22;

1.22
date	99.10.24.05.35.45;	author olawlor;	state Exp;
branches;
next	1.21;

1.21
date	99.08.20.22.36.52;	author milind;	state Exp;
branches;
next	1.20;

1.20
date	99.06.29.21.55.53;	author rbrunner;	state Exp;
branches;
next	1.19;

1.19
date	99.06.01.21.36.38;	author milind;	state Exp;
branches;
next	1.18;

1.18
date	99.03.06.21.08.08;	author milind;	state Exp;
branches;
next	1.17;

1.17
date	99.02.15.20.57.32;	author milind;	state Exp;
branches;
next	1.16;

1.16
date	98.11.12.23.45.51;	author milind;	state Exp;
branches;
next	1.15;

1.15
date	98.11.12.23.23.36;	author milind;	state Exp;
branches;
next	1.14;

1.14
date	98.10.08.00.19.21;	author milind;	state Exp;
branches;
next	1.13;

1.13
date	98.08.10.17.17.58;	author rbrunner;	state Exp;
branches;
next	1.12;

1.12
date	98.08.04.03.53.38;	author milind;	state Exp;
branches;
next	1.11;

1.11
date	98.05.25.15.21.16;	author milind;	state Exp;
branches;
next	1.10;

1.10
date	98.05.22.22.05.13;	author milind;	state Exp;
branches;
next	1.9;

1.9
date	98.05.03.09.48.01;	author milind;	state Exp;
branches;
next	1.8;

1.8
date	98.05.03.08.56.08;	author milind;	state Exp;
branches;
next	1.7;

1.7
date	98.04.16.16.28.44;	author milind;	state Exp;
branches;
next	1.6;

1.6
date	98.02.27.11.53.06;	author jyelon;	state Exp;
branches;
next	1.5;

1.5
date	98.01.13.17.03.28;	author milind;	state Exp;
branches;
next	1.4;

1.4
date	97.12.22.22.53.02;	author jyelon;	state Exp;
branches;
next	1.3;

1.3
date	97.11.26.19.17.26;	author milind;	state Exp;
branches;
next	1.2;

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

1.1
date	97.07.30.19.58.00;	author jyelon;	state Exp;
branches;
next	;


desc
@@


1.217
log
@Fixed addition of libraries to SPU_EXTRA_LIBS to automatically include "-l" before library name.
@
text
@#!/bin/sh
##############################################################################
# charmc: Compiler for Converse/Charm/Charm++ programs
#
# Converted to Bourne Shell by Orion Sky Lawlor, 10/21/1999
#
# Initialize the main controlling variables, setup error handler
# ALL variables used by this script should be initialized here.
#
##############################################################################

#Prepare aliases for the external commands we use--
# Note that adding /bin/ to everything breaks Cygwin32.
RM="rm -f"
CP="cp -p"
MV="mv"
LN="ln"
WC="wc"
SED="sed"

MACHTYPE=""
SEQUENTIAL=""
NATIVE=""
LANGUAGE=""
BALANCE="rand"
TRACEMODE=""
TRACE_OBJ=
MEMORY="default"
THREAD="default"
VERBOSE=""
DEBUG_SCRIPT=""
SAVE=""
PURIFY=""
SKIPLINK=""
OVERRIDE_CC=""
OVERRIDE_CXX=""
OVERRIDE_F90=""
OVERRIDE_LD=""
OVERRIDE_LDXX=""
#Generic options, passed to everything
OPTS=""
#Specific options
#charm internal flag, only pass to c and cxx, not f90
OPTS_CPP_INTERNAL="-D__CHARMC__=1 "
OPTS_CPP=
OPTS_LDRO="" 
OPTS_CC=""
OPTS_CXX="" 
OPTS_F90=""
OPTS_LD=""  
OPTS_LDXX=""
OPTS_PIC="$CMK_PIC"
test -z "$OPTS_PIC" && OPTS_PIC='-fpic'

CHARMDEBUG=""
LINK_PYTHON=""
OBJECT=""
POST_LANGUAGE=""
POST_LIBRARIES=""    
PRE_LIBRARIES=""  
USE_F90_LIBRARIES="0"  
USE_F77_LIBRARIES="0"  
F90_MODDIR=
AMPIMAIN=""
COPYTO=""        
MODCOPIES=""        
MODULES=""
BALANCER=""
FILES=""       
OBJECTFILES=""  
DELETE=""    
MAINOBJ=""   
GENCPM=""
OPTIMIZE_MODE=""
USE_RELIABLE_CC=""
USE_FASTEST_CC=""
PROG_EXT=""

COPY_CHARMRUN=true

COPY_EXIT="true"
CHARM_SHARED="0"
BUILD_SHARE="1"
SWAPGLOBALS="0"

TAU_MAKEFILE=Make.tau
TAU_TRACE_MPI=1

CMK_CELL=0
SPU_USE_CPP=0
SPU_EXTRA_LIBS=""

####################################################################
#
#  Utility routines used below
#
###################################################################

# PrintUsage: prints a helpful command-line usage message and quits
# Args: any additional messages
printUsage() {
    printVersion
    echo 
    echo "Usage: charmc [ flags ] <files>"
    echo
    echo "  flags:"
    echo "        -o <target> -g -O"
    echo "        -D<define> -I<include path> -L<lib path> -l<library> -s"
    echo "        -machine <mach> -seq -host -langage <lang> "
    echo "        -balance <mode> -tracemode <mode> -memory <mode>"
    echo "        -modules <comma-separated list of C++ modules>"
    echo "        -verbose -save -purify -cp <dest> -gen-cpm <package>"
    echo "        -use-reliable-cc -use-fastest-cc"
    echo "        -cc <new cc> -c++ <new CC>  -ld <new ld> -ld++ <new LD>"
    echo "        -cpp-option <opt> -ldro-option <opt> -cc-option <opt>"
    echo "        -c++-option <opt> -ld-option <opt> -ld++-option <opt>"
    echo "        -fmoddir <f90mod path>"
    echo "        -pg <opt> -build-shared -charm-shared -no-trace-mpi"
    echo
    echo "  Cell specific flags:"
    echo "        -spu-cpp -spu-lib <libname>"
    echo
    echo "  Charmc compiles C, C++, f77, f90, Converse, Converse++, Charm, "
    echo "and Charm++ programs.  The flags generally match those of cc or f77."
    echo "Version 5.0, Parallel Programming Lab, UIUC, 1999"
    echo $*
    exit 1
}

# End blows away the temporary files (unless SAVE is true) and exits
# Args: <exit code>
End() {
    if [ -z "$SAVE" ]
	then
        for FILE in `echo $FILES`
        do
			BASE=`stripExtention $FILE`
			TMP=`basename $FILE`".TMP"
            $RM $TMP.P.C $TMP.cpp $TMP.space $TMP.xlat $TMP.o
            $RM $TMP.c $TMP.c.0.h $TMP.c.1.h $TMP.c.2.h
            $RM $TMP.i $TMP.$CMK_CPP_SUFFIX
        done
        $RM core $DELETE
	if test -n "$modInitObj"
	then
	    [ -n "$VERBOSE" ] && echo $RM $modInitSrc $modInitObj
	    DoNoErrCheck $RM $modInitSrc $modInitObj > /dev/null 2>&1
	fi
    fi
    exit $1
}

# Write this error message to stderr
# ("1>&2" redirects the echo output to stderr).
Warning() {
	echo "$@@" 1>&2
}

# This procedure prints an error message and exits.
# Args: written to stderr
Abort() {
	Warning "Fatal Error by charmc in directory "`pwd`
	Warning "   $@@"
	Warning "charmc exiting..."
	End 1
}


# Instead of an ECHO_CMD variable, I define a procedure Do,
# which (possibly) echos, runs, and tests the errors of the given command.
# Args: executed as given
DoNoErrCheck() {
	[ -n "$VERBOSE" ] && echo "charmc: Executing $@@" 1>&2
	"$@@"
}

Do() {
	DoNoErrCheck "$@@"
	Do_res=$?
# The UNIX result code better be zero, or we die
	[ $Do_res -eq 0 ] || Abort "Command $@@ returned error code $Do_res"
}

# This procedure removes the extention (the ".c" in "./main.c") from
# its first argument, and prints the result. Unlike the builtin command
# basename, it keeps the directory path.
# Args: <name to strip>
stripExtention() {
	se_base=`echo $1 | awk -F/ '{print $NF}'`
	se_strip=`echo $se_base | awk -F. '{ORS="";print $1;for (i=2;i<NF;i++) print "."$i}'`
	se_ret=`echo $1 | awk -F/ '{ORS="";for (i=1;i<NF;i++) print $i"/"}'`"$se_strip"
	echo $se_ret
}

# GetExtention returns the extention on the given file name
# or "" if none.  (e.g. "./bob/snack.c" returns ".c")
# Args: <name to find extention of>
getExtention() {
	se_base=`echo $1 | awk -F/ '{print $NF}'`
        se_ret=`echo $se_base | awk -F. '{if (NF<=1) print ""; else print "."$NF}'`
	echo $se_ret
}

Debugf() {
	[ -n "$VERBOSE" ] && echo "charmc>" $@@
}

Debug() {
    if [ -n "$DEBUG_SCRIPT" ]
    then
	echo 
	echo "------- Charmc Debugging info: $* -------"
	echo "CHARMBIN=$CHARMBIN"
	echo "CHARMINC=$CHARMINC"
	echo "CHARMLIB=$CHARMLIB"
	echo "FILES=$FILES"
	echo "DELETE=$DELETE"
	echo "OBJECT=$OBJECT"
	echo "LANGUAGE=$LANGUAGE"
#	echo "Working directory="`pwd`
    fi
}

# Return success if $1 is not in any of the other arguments
notInList() {
	search=$1
	shift
	while [ $# -gt 0 ]
	do
		if [ "$search" = "$1" ]
		then
			# It's already in there-- fail
			return 1
		fi
		shift
	done
	# It's missing--succeed
	return 0
}

# Add arguments to our modules list, avoiding duplicates
AddModules() {
    for M in "$@@"
    do
      notInList $M $MODULES && MODULES="$MODULES $M"
    done
}

# Add this word to this list, avoiding duplicates
AddList() {
    ret=""
    for M in "$@@"
    do
      notInList $M $ret && ret="$ret $M"
    done
    echo $ret
}

# Append the last word to this list, avoiding duplicates
# the difference to previous AddList() is that when duplication happens,
# only keep the last one, instead of keeping the first one as in AddList()
# this helps to solve the multiple -lfoo in the link command. 
AppendList() {
	ret=""
	search=$1
	shift
	while [ $# -gt 0 ] 
	do
		if notInList $search $@@
		then
			ret="$ret $search"
		fi
		search=$1
		shift
	done
	echo $ret $search
}


# TEMP_BASE is appended with this script's process ID (PID),
# so multiple charmcs can run in parallel without overwriting
# each other's temporary files.
TEMP_BASE="/tmp/charmc_tmp.$$"

# Try to find CHARMBIN by looking in directory where charmc is
findCharmBin() {
if [ -z "$CHARMBIN" ]
then
	SCRIPT=$1
	CHARMBIN=`dirname $SCRIPT`
#	CHARMBIN=`cd $CHARMBIN; pwd`
# NOTE: this script no longer tries to follow soft links
# to find the "original" charmc-- if this is bad, 
# translate these lines to Bourne shell from C shell:
# -------------------- Begin C Shell ------------------------->
#    if ($SCRIPT:h != $SCRIPT:t) then
#        cd $SCRIPT:h
#        set SCRIPT=$SCRIPT:t
#    else
#        foreach dir ($path)
#            if (-x $dir/$SCRIPT && ! -d $dir/$SCRIPT) then
#                cd $dir
#                break
#            endif
#        end
#    endif
#    while (x`find $SCRIPT -type l -print` == x$SCRIPT)
#        set SCRIPT=`ls -al ./$SCRIPT:t | sed -e "s@@.*-> @@@@"`
#        if ($SCRIPT:h != $SCRIPT:t) then
#            cd $SCRIPT:h
#            set SCRIPT=$SCRIPT:t
#        endif
#    end
#    set CHARMBIN=`pwd`
# <------------------ End C Shell -----------------------------
fi
}

printVersion()
{
	findCharmBin $0
	version=`cat $CHARMBIN/../include/VERSION`
	echo Charm++ Version $version
}


##############################################################################
#
# The following section identifies CHARMBIN, the charm binary-directory.
#
##############################################################################

ORIGDIR=`pwd`

# Try to find CHARMBIN by looking in directory where charmc is

findCharmBin $0

FIRST_THREE=`uname -s | awk '{print substr($1,1,3)}' `
if [ "$FIRST_THREE" = "CYG" ]
then
# Running on a windows system-- append .exe to file names
	PROG_EXT=".exe"
fi

CHARMLIB="$CHARMBIN/../lib"
CHARMINC="$CHARMBIN/../include"
CHARMLIBSO=
if test -d "$CHARMBIN/../lib_so" 
then
  CHARMLIBSO=`cd $CHARMBIN/../lib_so 2>/dev/null && pwd`
  #getting absolute path is harder than thought because of symbolic links and ..
  #ksh needs cd -P to resolve werid symbolic links, however -P is not portable
  #csh is ok too if it exists 
  test -z "$CHARMLIBSO" && CHARMLIBSO=`cd -P $CHARMBIN/../lib_so 2>/dev/null && pwd`
  test -z "$CHARMLIBSO" && CHARMLIBSO=`csh -c "cd $CHARMBIN/../lib_so >& /dev/null && pwd"`
  test -z "$CHARMLIBSO" && echo "$CHARMBIN/../lib_so: not found" && exit 1
fi

##############################################################################
#
# Parse the arguments
#
# Don't do any analysis in here, just the parsing.
#
##############################################################################

[ $# -eq 0 ] && printUsage "Error: No arguments given."

processArgs() {
while [ ! $# -eq 0 ]
do
	arg="$1"
	shift

	case "$arg" in
	"-V")
		printVersion
		exit 0
		;;

	"-machine")
		MACHTYPE="$1"
		shift
		;;

	"-seq")
		SEQUENTIAL=true
		;;

	"-host")
		NATIVE=true
		;;

	"-language")
		# Parse out some fake languages (that are actually modules)
		case "$1" in
		"ampi") AddModules tcharmmain ampi ;;
		"ampif") AddModules tcharmmain ampif ; USE_F90_LIBRARIES="1" ;;
		"armci") AddModules tcharmmain armci ;;
		"armcif") AddModules tcharmmain armci ; USE_F90_LIBRARIES="1" ;;
		"fem") AddModules tcharmmain fem ; AMPIMAIN="femmain";;
		"femf") AddModules tcharmmain fem ; AMPIMAIN="femmain"; USE_F90_LIBRARIES="1" ;;
		"ParFUM_TOPS") AddModules tcharmmain ParFUM ParFUM_TOPS ; AMPIMAIN="ParFUMmain";;
    "ParFUM") AddModules tcharmmain ParFUM ; AMPIMAIN="ParFUMmain";;
    "ParFUMf") AddModules tcharmmain ParFUM ; AMPIMAIN="ParFUMmain"; USE_F90_LIBRARIES="1" ;;
		"mblock") AddModules tcharmmain mblock ;;
		"mblockf") AddModules tcharmmain mblock ; USE_F90_LIBRARIES="1" ;;
		*) 
			LANGUAGE="$1"
			POST_LANGUAGE=1
			;;
		esac
		shift
		;;

        "-debug")
                # Requested support from charmdebug: add some modules and libraries
                CHARMDEBUG=1
                MEMORY="charmdebug"
                ;;

	"-module"|"-modules")
		AddModules `echo $1 | sed -e 's/,/ /g'`
		shift
		;;

	"-balancer")
#                test -n "$BALANCER" && Abort "More than one -balancer specified!"
		BALANCER="$BALANCER $1"
		mod=`echo $1| sed -e 's/:/ /' -e 's/,/ /g'`
		AddModules $mod
		shift
		;;

	"-balance")
		BALANCE="$1"
		shift
		;;

	"-queue")
		Warning "Warning: -queue currently being ignored."
		shift
		;;

	"-memory")
	        MEMORY="$1"
		shift
		;;

	"-thread")
	        THREAD="$1"
		shift
		;;

	"-tracemode")
		TRACEMODE_NEW=`AddList $TRACEMODE $1`
 		if [ "$TRACEMODE_NEW" = "$TRACEMODE" ]
		then
			Warning "Warning: Duplicate tracemode $1 ignored"
		else
			TRACEMODE=$TRACEMODE_NEW
		fi
		shift
		;;
	"-no-trace-mpi")
		TAU_TRACE_MPI=0
		;;
	
	"-swapglobal"|"-swapglobals")
		SWAPGLOBALS="1"
		OPTS_CC="$OPTS_CC $OPTS_PIC"
		OPTS_CXX="$OPTS_CXX $OPTS_PIC"
		OPTS_F90="$OPTS_F90 $OPTS_PIC"
		OPTS_LD="$OPTS_LD $OPTS_PIC"
		;;

	"-copyglobal"|"-copyglobals")
		SWAPGLOBALS="2"
		OPTS_CC="$OPTS_CC $OPTS_PIC"
		OPTS_CXX="$OPTS_CXX $OPTS_PIC"
		OPTS_F90="$OPTS_F90 $OPTS_PIC"
		OPTS_LD="$OPTS_LD $OPTS_PIC"
		;;

	"-verbose")
		echo "Verbose mode set"
		VERBOSE=true
		;;

        "-spu-cpp")
		SPU_USE_CPP=1
		;;

        "-spu-lib")
		SPU_EXTRA_LIBS="$SPU_EXTRA_LIBS -l$1"
		shift
		;;

        "-intrinsic")
		XI_INTERNAL=true
		;;

	"-debug-script")
	        echo "Will give excessive charmc debugging output..."
		DEBUG_SCRIPT=true
		;;

	"-save")
		SAVE=true
		;;

	"-purify")
		PURIFY=true
		;;

	"-use-reliable-cc")
		USE_RELIABLE_CC=1
		;;

	"-use-fastest-cc")
		USE_FASTEST_CC=1
		;;

	"-cc")
		OVERRIDE_CC="$1"
		shift
		;;

	"-c++")
		OVERRIDE_CXX="$1"
		shift
		;;

	"-f90")
		OVERRIDE_F90="$1"
		shift
		;;

	"-ld")
		OVERRIDE_LD="$1"
		shift
		;;

	"-ld++")
		OVERRIDE_LDXX="$1"
		shift
		;;

	"-cpp-option")
		OPTS_CPP="$OPTS_CPP $1"
		shift
		;;

	"-ldro-option")
		OPTS_LDRO="$OPTS_LDRO $1"
		shift
		;;

	"-cc-option")
		OPTS_CC="$OPTS_CC $1"
		shift
		;;

	"-c++-option")
		OPTS_CXX="$OPTS_CXX $1"
		shift
		;;

	"-f90-option")
		OPTS_F90="$OPTS_F90 $1"
		shift
		;;

	"-ld-option")
		OPTS_LD="$OPTS_LD $1"
		shift
		;;

	"-ld++-option")
		OPTS_LDXX="$OPTS_LDXX $1"
		shift
		;;

	"-rpath")
		OPTS_LDXX="$OPTS_LDXX -rpath $1"
		shift
		;;
	
	"-fortran"|"-flib"|"-flibs")
		USE_F90_LIBRARIES="1" 
		;;
	"-f77")
		USE_F77="1" 
		;;
	"-fortran77"|"-f77lib"|"-f77libs")
		USE_F77_LIBRARIES="1" 
		;;
	"-E")
# Run preprocessor/assembler only
		PREPROCESS="yes"
		SKIPLINK="yes"
		OPTS="$OPTS $arg"
		;;
        "-preprocess")
# Run preprocessor as an extra step, continue after preprocessing
		PREPROCESS="yes"
                ;;
	"-M"|"-P"|"-S")
# Run preprocessor/assembler only
		SKIPLINK="yes"
		OPTS="$OPTS $arg"
		;;
	"-c")
# This is ignored.
		;;

	"-o")
		OBJECT=$1
		shift
		;;

	"-cp")
		COPYTO="$1"
		shift
		;;

	"-cpmod")
		MODCOPIES="$1 $MODCOPIES"
		shift
		;;

	"-gen-cpm")
		GENCPM="$GENCPM $1"
		shift
		;;

	-I)
		OPTS_CPP="$OPTS_CPP -I$1"
		shift
		;;

	-D*|-I*)
		OPTS_CPP="$OPTS_CPP $arg"
		;;

	-LANG*)
		Warning "passing unrecognized option $arg to all compilers and linkers"
		OPTS="$OPTS $arg"
		;;
	-shared|-G)
		BUILD_SHARE="1"
		;;
	-L*|-shared|-G)
		OPTS_LD="$OPTS_LD $arg"
		;;
	-charm-shared|-cs)
		CHARM_SHARED="1"
		;;
	-build-shared|-bs)
		# used internally when building Charm++ to create lib_so
		# obsolete, do nothing since BUILD_SHARE is on by default
		;;
	-no-build-shared|-nobs)
		# used internally not to build Charm++ lib_so
		BUILD_SHARE="0"
		;;
	"-O")
		OPTIMIZE_MODE=true
		;;

	"-NO")
		OPTIMIZE_MODE=false
		;;
	
	"-pg"|"-g"|-W*|-O*)
		OPTS="$OPTS $arg"
		;;

	"-fmoddir")
		F90_MODDIR="$F90_MODDIR $1"
		shift
		;;

	-l*|*.a)
		if [ -n "$POST_LANGUAGE" ]
		then
			POST_LIBRARIES=`AppendList $POST_LIBRARIES $arg`
		else
			PRE_LIBRARIES=`AppendList $PRE_LIBRARIES $arg`
		fi
		;;

	-s)
		OPTS_LD="$OPTS_LD   $arg"
		;;
	-no-charmrun)
		COPY_CHARMRUN=false
		;;
        -h|--help)
	        printUsage
		;;
	-f90main)
		F90_MAIN=1
		;;
	-nof90main)
		F90_MAIN=
		;;
	-*|+*)
#		Warning "passing unrecognized option $arg to all compilers and linkers"
		OPTS="$OPTS  $arg"
		;;
	*.*)
		[ -n "$VERBOSE" ] && echo "Adding file $arg..."
		FILES="$FILES $arg"
		;;
# Default
	*)
#		printUsage  "Error: Unrecognized argument $arg"
#		Warning "passing unrecognized option $arg to all compilers and linkers"
		OPTS="$OPTS  $arg"
		;;
	esac
done
}

trap 'End 1' 2

# Process original command-line arguments
processArgs "$@@"


##############################################################################
#
# Load module dependencies.
#
##############################################################################

Debug "About to read machine config script"
Debug "Read config script, setting defaults..."

[ ! -r $CHARMINC/conv-config.sh ] && Abort "Cannot find conv-config.sh in $CHARMINC"
. $CHARMINC/conv-config.sh $CHARMINC

Debug "Setting vars..."

# If we are debugging, add "-g -O0" to the C/C++ flags
if [ -n "$CHARMDEBUG" ]; then
       if [ -n "$CMK_BUILD_PYTHON" ]; then
         	AddModules PythonCCS charmdebug_python
		POST_LIBRARIES=`AddList $POST_LIBRARIES -lpython${CMK_BUILD_PYTHON}`
   	fi
    	OPTS_CPP="$OPTS_CPP -O0 -g"
fi

PROCESSED_MODULES=""

# Look up and add the dependencies for module $1
findModuleDep() {
	M=$1
	notInList $M $PROCESSED_MODULES || return
	PROCESSED_MODULES="$PROCESSED_MODULES $M"
	PRE_LIBRARIES=`AddList $PRE_LIBRARIES -lmodule$M`
# HACK: add modules to both ends of library list, to avoid
#  undefined symbol CkRegisterMainModule when it's in a module file.
	POST_LIBRARIES=`AddList $POST_LIBRARIES -lmodule$M`
	if [ "$M" = "PythonCCS" ]
            then
            LINK_PYTHON=1
        fi

	dep=""
# fixme: should search everything in the -L library paths:
	for dir in `echo . $CHARMLIB`
	do
		d="$dir/libmodule$M.dep"
		[ -r "$d" ] && dep=$d
	done
	if [ -r "$dep" ]
	then
		# Add the module dependencies in this file
		# Debugf "Adding module" $M "dependencies from" $dep
		deps=`cat $dep`
		Debugf "Module" $M "adds dependencies:" $deps
		processArgs $deps
	fi
}

# Repeat the module-dependency search until we find no
#  new modules:
START_MODULES=""
while [ "$START_MODULES" != "$MODULES" ]
do
	Debugf "----------- Module dependency search ------------"
	START_MODULES="$MODULES"
	for m in $MODULES
	do
		findModuleDep $m
	done
done

Debugf "----------- Module dependency search complete ------------"



##############################################################################
#
# Load machine-specific configuration data, then handle overrides to it.
#
##############################################################################


if [ "$BUILD_SHARE" = "1" ]
then
	if [ -n "$CMK_NO_BUILD_SHARED" -o -z "$CHARMLIBSO" ]
	then
		BUILD_SHARE="0"
	fi
fi

if [ "$BUILD_SHARE" = "1" ]
then
	# ignore BUILD_SHARE if the target is not .a or .so
	case "$OBJECT" in
	*.a|*.so|*.so.*|*.sl|*.dylib)
 		OPTS_LD="$OPTS_LD $CMK_LD_SHARED $OPTS_LDRO -L$CHARMLIBSO"
		;;
	*)	
		BUILD_SHARE="0"
		;;
	esac
fi

if [ -n "$OVERRIDE_CC" ]
then
    CMK_CC="$OVERRIDE_CC"
fi
Debug "set 2"
if [ -n "$OVERRIDE_CXX" ]
then
    CMK_CXX="$OVERRIDE_CXX"
fi

if [ -n "$OVERRIDE_F90" ]
then
    CMK_CF90="$OVERRIDE_F90"
fi

if [ -n "$OVERRIDE_LD" ]
then
    CMK_LD="$OVERRIDE_LD"
fi

if [ -n "$OVERRIDE_LDXX" ]
then
    CMK_LDXX="$OVERRIDE_LDXX"
fi

if [ -n "$USE_RELIABLE_CC" ]
then
	CMK_CC="$CMK_CC_RELIABLE"
fi

if [ -n "$USE_FASTEST_CC" ]
then
    CMK_CC="$CMK_CC_FASTEST"
fi

if [ -n "$USE_F77" ]
then
    CMK_CF90=$CMK_CF77
    CMK_CF90_FIXED=$CMK_CF77
    CMK_F90LIBS=$CMK_F77LIBS
fi

if [ -n "$CMK_F90_MODINC" ]
then
    CMK_CF90_MODINC="$CMK_F90_MODINC"
else
    CMK_CF90_MODINC="-M"
fi

if [ -n "$F90_MODDIR" ]
then
    for dir in $F90_MODDIR
    do
      OPTS_F90="$OPTS_F90 $CMK_CF90_MODINC $dir"
    done
fi

if [ -n "$CMK_F90_USE_MODDIR" ]
then
    CMK_CF90="$CMK_CF90 $CMK_CF90_MODINC$CHARMINC "
fi

if [ -n "$SEQUENTIAL" ]
then
    CMK_CC="$CMK_SEQ_CC -DCMK_SEQUENTIAL=1 "
    CMK_LD="$CMK_SEQ_LD"
    CMK_CXX="$CMK_SEQ_CXX -DCMK_SEQUENTIAL=1 " 
    CMK_CF90="$CMK_SEQ_F90 " 
    CMK_LDXX="$CMK_SEQ_LDXX" 
    CMK_AR="$CMK_SEQ_AR"
    CMK_RANLIB="$CMK_SEQ_RANLIB"
fi

if [ -n "$NATIVE" ]
then
    CMK_CC="$CMK_NATIVE_CC " 
    CMK_LD="$CMK_NATIVE_LD" 
    CMK_CXX="$CMK_NATIVE_CXX " 
    CMK_LDXX="$CMK_NATIVE_LDXX" 
fi

if [ -n "$PREPROCESS" ]
then
    CMK_CF90=$CMK_FPP
fi

if [ -n "$PURIFY" ]
then
    CMK_LD="purify $CMK_LD"
    CMK_LDXX="purify $CMK_LDXX"
fi

Debug "set 4"
if [ -n "$OPTIMIZE_MODE" ]
then
    OPTS_CC="$CMK_C_OPTIMIZE $OPTS_CC"
    OPTS_CXX="$CMK_CXX_OPTIMIZE $OPTS_CXX"
    OPTS_F90="$CMK_F90_OPTIMIZE $OPTS_F90"
    OPTS_LD="$CMK_C_OPTIMIZE $OPTS_LD"
    OPTS_LDXX="$CMK_CXX_OPTIMIZE $OPTS_LDXX"
fi

if [ -n "$XI_INTERNAL" ]
then
    CMK_XIOPTS="$CMK_XIOPTS -intrinsic"
fi

#Add generic options to the compiler- and linker-options
OPTS_CC="$OPTS $OPTS_CC"
OPTS_CXX="$OPTS $OPTS_CXX"
OPTS_F90="$OPTS $OPTS_F90"
OPTS_LD="$OPTS $OPTS_LD"
# OPTS_LDXX gets OPTS from OPTS_LD

if [ -n "$F90_MAIN" ] 
then
# for_main needs to be placed at beginning
	CMK_LD="$CMK_LD $CMK_F90MAINLIBS"
	CMK_LDXX="$CMK_LDXX $CMK_F90MAINLIBS"
fi

# There's really no analog for this in the Bourne shell: 
#  -------- C Shell ------> onintr failure
# Luckily, it's irrelevant as long as nobody sends us a ^Z.

##############################################################################
#
# Check for valid choice of LANGUAGE
#
##############################################################################
Debug "Checking language..."

if [ -z "$LANGUAGE" ]
then
    LANGUAGE="charm++"
    [ -n "$SEQUENTIAL" ] && LANGUAGE=c
fi

case "$LANGUAGE" in
"c"|"C"|"c++"|"C++")
	[ -z "$SEQUENTIAL" -a -z "$NATIVE" ] && Abort "Language $LANGUAGE is for sequential programs"
	;;
esac

# update charm to bgcharm
if [ "$LANGUAGE" = "charm++" -a -n "$CMK_BLUEGENE" ]
then
        LANGUAGE="bgcharm++"
fi
if [ "$LANGUAGE" = "converse++" -a -n "$CMK_BLUEGENE" ]
then
        LANGUAGE="bgconverse++"
fi
if [ "$LANGUAGE" = "bgcharm++" ]
then
	TRACEMODE=`AddList $TRACEMODE bluegene`
fi

########################################################################
#
# We've parsed and verified the command-line parameters.
# Now we prepare routines to clean up and exit.
# None of these routines ever returns-- they all just exit.
#
########################################################################


Copyobj() {
	if [ "a$COPYTO" != "a" -a "a$COPYTO" != "a$OBJECT" ] 
	then
		[ -d $COPYTO ] && COPYTO="$COPYTO/"
		if [ "a$PROG_EXT" != "a" -a -r "$OBJECT$PROG_EXT" ] ; then
			Warning "Appending $PROG_EXT to object file name"
			OBJECT="$OBJECT$PROG_EXT"
		fi
		[ ! -d $COPYTO ] && DoNoErrCheck $RM $COPYTO 
		Do $CP $OBJECT $COPYTO
	fi
	test -n "$COPY_EXIT" && Success
}

Copymod() {
	for COPY in `echo $MODCOPIES`
	do
		if [ "a$COPY" != "a$OBJECT" ] 
		then
			[ -d $COPY ] && COPY="$COPY/"
			if [ -n "$CMK_MOD_NAME_ALLCAPS" ] ; then
			  OBJECT=`echo $OBJECT | tr "a-z" "A-Z"`
			fi
			if [ -r "$OBJECT.$CMK_MOD_EXT" ] ; then
			  Warning "Appending .$CMK_MOD_EXT to object file name"
			  OBJECT="$OBJECT.$CMK_MOD_EXT"
			fi
			[ ! -d $COPY ] && DoNoErrCheck $RM $COPY 
			Do $CP $OBJECT $COPY
		fi
	done
	Success
}

Success() {
	End 0
}


##############################################################################
#
# Preprocess the GEN-CPM files
#
##############################################################################

Debug "Preprocessing GEN-CPM files"

for FILE in `echo $GENCPM`
do
# This used to be "$FILE:r", which strips the extention
	BASE=`stripExtention $FILE`
	TMP=`basename $FILE`".TMP"
	DELETE="$DELETE $TMP.c $TMP.i"
	DoNoErrCheck $RM $BASE.cpm.h $TMP.c
	Do touch $BASE.cpm.h
	Do $LN -f -s $FILE $TMP.c
	Do $CMK_CPP_C -I$CHARMINC $OPTS_CC $OPTS_CPP $TMP.c > $TMP.i
	Do $CHARMBIN/conv-cpm $TMP.i $BASE.cpm.h
done

##############################################################################
#
# Compile all specified files
#
# All temporary files named *.TMP.* for easy cleanup.
#
##############################################################################

Debug "About to compile..."

for FILE in `echo $FILES`
do
	BASE=`stripExtention \`basename $FILE\``
	TMP=`basename $FILE`".TMP"
	FILE_EXT=`getExtention $FILE`
	BASEO="$BASE.o"
	DESTO="-o $BASEO"

	# in case of: charmc -o object.o -c foo.c,
	# avoid foo.c => remove foo.o => foo.o => object.o,
	# instead generate object.o directly.
 	# remove and generate foo.o may be dangerous in parallel make 
	# for example in the case of compiling several objs from one 
	# same c file such as memory.c.
	numFiles=`echo $FILES | wc -w`
	if [ $numFiles = 1 -a -n "$OBJECT" ]
	then
		OBJ_EXT=`getExtention $OBJECT`
		if [ "$OBJ_EXT" = '.o' ]
          	then
        	    BASEO=$OBJECT
		    DESTO="-o $OBJECT"
	  	fi
        fi

	if [ "$FILE_EXT" != ".o" -a "$FILE_EXT" != ".M" -a "$FILE_EXT" != ".ci" ]
	then
		[ $VERBOSE ] && echo "Compiling $FILE"
		DoNoErrCheck $RM $BASEO $BASE.f.o
	fi
	if [ ! -z "$SKIPLINK" ] 
	then
		DESTO=""
	fi
	NU_OBJ=""
	case "$FILE" in
	*.ci)
                XIOPTS=$CMK_XIOPTS
                test "$LANGUAGE" = "f90charm" && XIOPTS="$XIOPTS -f90"
                if [ -n "$PREPROCESS" ]
                then
		  Do $CMK_CPP_CHARM $FILE | Do $CHARMBIN/charmxi $XIOPTS
                else
		  Do $CHARMBIN/charmxi $XIOPTS $FILE
                fi
		;;
	*.c|*.s)
		Do $CMK_CC -I$CHARMINC $OPTS_CPP_INTERNAL $OPTS_CPP $OPTS_CC -c $FILE $DESTO
		NU_OBJ=$BASEO
		;;
	bglmachine.C)
		Do $CMK_GCXX -I$CHARMINC $OPTS_CPP_INTERNAL $OPTS_CPP $OPTS_CXX -c $FILE $DESTO
		NU_OBJ=$BASEO
		;;
	*.C|*.cc|*.cxx|*.cpp|*.c++|*.cu)
		Do $CMK_CXX -I$CHARMINC $OPTS_CPP_INTERNAL $OPTS_CPP $OPTS_CXX -c $FILE $DESTO
		NU_OBJ=$BASEO
		;;
	*.f|*.F)
		test -z "$CMK_CF90_FIXED" && Abort "No F90 compiler (CMK_CF90_FIXED) defined"
		Do $CMK_CF90_FIXED -I$CHARMINC $OPTS_CPP $OPTS_F90 -c $FILE $DESTO
		NU_OBJ=$BASEO
		;;
	*.f90|*.F90)
		test -z "$CMK_CF90" && Abort "No F90 compiler (CMK_CF90) defined"
		test -z "$PREPROCESS" && OPTS_F90="$OPTS_F90 -c"
		Do $CMK_CF90 -I$CHARMINC $OPTS_CPP $OPTS_F90 $FILE $DESTO
		NU_OBJ=$BASEO
		;;
	*.fc|*.FC)
		Abort "I'm not yet smart enough to compile $FILE"
		;;
	*.o|*.so|*.so.*|*.sl|*.a|*.dylib)
		[ ! -s $FILE ] && Abort "$FILE: file not recognized: File truncated"
		OBJECTFILES="$OBJECTFILES $FILE"
		;;
	*.M|*.mod)
	        OBJECT="$BASE"
		Copymod
		Success
		;;
	*)
		Abort "file with unrecognized extension $FILE"
	esac
# Handle new object files
	if [ -n "$NU_OBJ" -a -n "$OBJECT" ] 
	then
		if [ "$OBJECT" != "$BASEO" ]
		then
			DELETE="$DELETE $NU_OBJ"
		fi
		OBJECTFILES="$OBJECTFILES $NU_OBJ"
	fi
done

##############################################################################
#
#                        POSSIBLY, SKIP LINK-STEP
#
# 1. No $OBJECT may be specified at all --- its just a compilation.
# 2. If $OBJECT is a ".a" file, a library is created from $OBJECTFILES.
# 3. If $OBJECT is a ".o" file, then an "LDRO" is created from $OBJECTFILES.
# 4. Language may be sequential.  Do a quick and easy linkage.
#
#               in any of these cases, the full link step is skipped.
#
##############################################################################

MakeSO() {
	Debugf "Running ldro..."
	DoNoErrCheck $RM $OBJECT
	# convert to absolute path if required
	if test -n "$CMK_LD_SHARED_ABSOLUTE_PATH"
	then
	dir=`dirname $OBJECT`
	fname=`basename $OBJECT`
	dir=`cd $dir; pwd`
	OBJECT=$dir/$fname
	fi
	Warning "Warning: creating $OBJECT "
	if test "$MAKE_LDXX" = "1"
	then
 	  soCmd="$CMK_LDXX -o $OBJECT $OPTS_LD $OPTS_LDRO $OBJECTFILES $PRE_LIBRARIES $POST_LIBRARIES $CMK_LD_SHARED_LIBS"
	else
	  soCmd="$CMK_LD -o $OBJECT $OPTS_LD $OPTS_LDRO $OBJECTFILES $PRE_LIBRARIES $POST_LIBRARIES $CMK_LD_SHARED_LIBS"
	fi
	DoNoErrCheck $soCmd
	Do_res=$?
	if [ $Do_res -ne 0 ] 
	then
	echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
	echo "!!  Failed to compile Charm++ shared library. You can disable shared  !!"
	echo "!!  lib compilation by providing --no-build-shared build option like: !!"
	echo "!!     ./build charm++ net-linux --no-build-shared -O                 !!"
	echo "!!  or reexecute this charmc command with -nobs compile option        !!"
	echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
	Abort "Command $soCmd returned error code $Do_res"
	fi
	Copyobj
}

if [ -z "$OBJECT" -o ! -z "$SKIPLINK" ] 
then
# We have no target object, or are playing preprocessor tricks-- just end
	Debugf "No target object-- finished"
	Success
fi

Debug "About to link..."

case "$OBJECT" in
*.o)
	Debugf "Converting $FILES to $OBJECTFILES"
	nFiles=`echo $FILES | wc -w`
	nObj=`echo $OBJECTFILES | wc -w`
# One source file, one .o: just move the .o
	if [ $OBJECT != $OBJECTFILES ]
	then
		Debugf "Moving .o to destination"
		DoNoErrCheck $RM $OBJECT
		Do $MV $OBJECTFILES $OBJECT
	fi
	Copyobj
	;;
*.so|*.so.*|*.sl|*.dylib)
# Make shared library
	# if no build share is set, exit normally.
	if [ "$BUILD_SHARE" = 0 ]
	then
		End 0
	elif [ "$CHARM_SHARED" = "0" ]
	then
	  	MakeSO
	fi
	;;
*.a)
# Make regular (.a, non-shared) library
	# in case building charm so, build .so under lib_so as well # Gengbin
	if [ "$BUILD_SHARE" = "1" ]
	then
	  COPY_EXIT=""
	  OBJECT_SAVE=$OBJECT
	  COPYTO_SAVE=$COPYTO
	  if [ -z "$COPYTO" ]
	  then
	    DESTDIR=`echo $OBJECT | sed -e 's@@lib/[^/]*\.a$@@lib_so@@'`
	    OBJECT=`echo $OBJECT | sed -e 's@@lib/\([^/]*\)\.a$@@lib_so/\1.a@@'`
	  else
	    COPYTO=`echo $COPYTO | sed -e 's@@lib[/]*$@@lib_so@@'`
	    DESTDIR=$COPYTO
	  fi
	  OBJECT=`echo $OBJECT | sed -e 's/\.a$/.'"$CMK_SHARED_SUF"'/'`
	  [ -f $DESTDIR/.charmso ] && MakeSO
	  COPYTO=$COPYTO_SAVE
	  OBJECT=$OBJECT_SAVE
	  COPY_EXIT="true"
	fi
	# build normal .a
	DoNoErrCheck $RM $OBJECT
	Do $CMK_AR $OBJECT $OBJECTFILES
	Do $CMK_RANLIB $OBJECT
	Copyobj
	;;
esac
# If the above case returns, we're not creating a .o or .a file,
# so linking is needed.

############ Determine the language and libraries ##########

# Parse out the real languages
case "$LANGUAGE" in
"charm++f")
	LANGUAGE="charm++"
	USE_F90_LIBRARIES="1"
	;;
"f90charm")
        PRE_LIBRARIES="$PRE_LIBRARIES -lf90charm -lckf"
        POST_LIBRARIES="$POST_LIBRARIES $CMK_F90LIBS"
	;;
"bluegene"|"bigsim")
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bigsim -lconv-bigsim-logs"
	;;
"ckbluegene")
        POST_LIBRARIES="$POST_LIBRARIES -lbluegene"
	;;
"bgcharm++")
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bigsim -lconv-bigsim-logs -lconv-bluegene-stub"
	;;
"bgconverse++")
        MIDDLE_LIBS="$MIDDLE_LIBS -lconv-bigsim -lconv-bigsim-logs"
	;;
esac

# DMK - ACCEL SUPPORT - If this is a cell build, add the spe code object to POST_LIBRARIES
if [ $CMK_CELL -eq 1 ]
then
  if [ "$LANGUAGE" == "charm++" ]
  then

    if [ $SPU_USE_CPP -eq 1 ]
    then
        SPU_COMPILER=$CMK_SPU_CXX
        SPU_LINKER=$CMK_SPU_LDXX
    else
        SPU_COMPILER=$CMK_SPU_CC
        SPU_LINKER=$CMK_SPU_LD
    fi

    # Make the spe object file to be included
    Do $SPU_COMPILER -c -I$CHARMINC -o main__funcLookup__.genSPECode.o main__funcLookup__.genSPECode.c -DCMK_CELL_SPE=1
    Do $SPU_LINKER -L$CHARMLIB -o main__funcLookup__.genSPECode main__funcLookup__.genSPECode.o $CMK_SPERT_LIBS $SPU_EXTRA_LIBS
    Do $CMK_PPU_EMBEDSPU spert_main main__funcLookup__.genSPECode main__funcLookup__.genSPECode.ppe.o

    # Include the spe object file for linking into main executable
    POST_LIBRARIES="$POST_LIBRARIES main__funcLookup__.genSPECode.ppe.o"

  fi
fi

if [ "$AMPIMAIN" != "" ]
then
	OBJECTFILES="$CHARMLIB/lib$AMPIMAIN.o $OBJECTFILES"
fi

if [ "$SWAPGLOBALS" = "1" ]
then
	swapo="$CHARMLIB/libglobal-swap.o"
	if [ ! -r "$swapo" -o ! -s "$swapo" ]
	then
		echo "Global-swapping library $swapo missing--"
		echo "  Is -swapglobals supported on this machine?"
		exit 1
	else
		OBJECTFILES="$swapo $OBJECTFILES"
	fi
fi
if [ "$SWAPGLOBALS" = "2" ]
then
	swapo="$CHARMLIB/libglobal-copy.o"
	if [ ! -r "$swapo" -o ! -s "$swapo" ]
	then
		echo "Global-copying library $swapo missing--"
		echo "  Is -copyglobals supported on this machine?"
		exit 1
	else
		OBJECTFILES="$swapo $OBJECTFILES $CHARMLIB/loadsym.o"
	fi
fi

if [ $USE_F77_LIBRARIES = "1" ]
then
	POST_LIBRARIES="$POST_LIBRARIES $CMK_F77LIBS"
fi

if [ $USE_F90_LIBRARIES = "1" ]
then
	if [ ! -r $CHARMLIB/libconv-utilf.a ]
	then
		echo "Fortran support library $CHARMLIB/libconv-utilf.a missing"
		echo "Is your Fortran compiler working?"
		exit 1
	fi
	
	POST_LIBRARIES="$POST_LIBRARIES -lconv-utilf $CMK_F90LIBS"
        if [ -z "$SEQUENTIAL" -a ! -z "$CMK_F90OBJS" ] 
        then
          for f90obj in $CMK_F90OBJS
          do
            OBJECTFILES="$OBJECTFILES $CHARMLIB/$f90obj"
          done
        fi
fi

# check if we're linking a sequential object
case "$LANGUAGE" in
"c"|"C"|"f90"|"f77")
        if [ -n "$NATIVE" ]
 	then
	  Do $CMK_NATIVE_LD $OPTS_LD -o $OBJECT $OBJECTFILES \
		-L$CHARMLIB $PRE_LIBRARIES $CMK_NATIVE_LIBS $POST_LIBRARIES
  	else
	  Do $CMK_SEQ_LD $OPTS_LD -o $OBJECT $OBJECTFILES \
		-L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
	fi
	Copyobj
	;;
"c++"|"C++")
        if [ -n "$NATIVE" ]
 	then
	  Do $CMK_NATIVE_LDXX $OPTS_LD -o $OBJECT $OBJECTFILES \
		-L$CHARMLIB $PRE_LIBRARIES $CMK_NATIVE_LIBS $POST_LIBRARIES
	else
	  Do $CMK_SEQ_LDXX $OPTS_LD -o $OBJECT $OBJECTFILES \
		-L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
	fi
	Copyobj
	;;
esac

##############################################################################
#
# Some quick consistency checks prior to full link-step
#
# Check for valid choice of TRACEMODE
# Check for valid choice of BALANCE
# Check for compatibility among BALANCE and TRACEMODE
#
##############################################################################

Debug "About to check TRACEMODE=$TRACEMODE and BALANCE=$BALANCE..."

# Check for valid choice of TRACEMODE

# [ -r $CHARMLIB/libtrace-projections.a ] || Abort "trace libraries not installed.  Is Charm++ built properly?"

if [ x"$TRACEMODE" != x ]
then
for trace in $TRACEMODE; do
[ ! -r "$CHARMLIB/libtrace-$trace.a" ] && Abort "charmc : No such tracemode $trace"
TRACE_OBJ="$TRACE_OBJ -ltrace-$trace"
done
TRACE_OBJ="$TRACE_OBJ $CMK_LIBZ"
fi

if test x$LANGUAGE = x"bgcharm++"
then 
    BALANCE=bluegene
fi

BAL_EXT=`getExtention $BALANCE`
if [ -z "$BAL_EXT" ]
then
# Balance has no extention-- is a library reference
    BAL_OBJ="$CHARMLIB/libldb-$BALANCE.o"
else
# Balance has some extention-- must be a .o or .a file
    BAL_OBJ="$BALANCE"
fi

Debug "Finished with BAL_OBJ=$BAL_OBJ, TRACEMODE=$TRACEMODE..."

if [ ! -r "$BAL_OBJ" ]
then
	if [ "$BALANCE" = "$BAL_OBJ" ]
	then
		Abort "Could not find load balancer object $BAL_OBJ"
	else
		(cd $CHARMLIB ; ls -al libldb-*)
		Abort "Unknown load balancer $BALANCE / $BAL_OBJ"
	fi
fi


# Check for valid choice of MEMORY

MEM_OBJ="$CHARMLIB/libmemory-$MEMORY.o"

if [ ! -r $MEM_OBJ -o ! -s $MEM_OBJ ] 
then
  (cd $CHARMLIB ; list=`ls libmemory-* 2>/dev/null`; test -n "$list" && for i in $list; do [ -s $i ] && ls -l $i; done )
  Abort "charmc : No such memory mode $MEMORY"
fi

# For memory wrapping around the OS allocator, need to add also the wrapper object
case $MEMORY in
  os-*)
  MEM_OBJ=$MEM_OBJ" $CHARMLIB/libmemory-os-wrapper.o"
  ;;
esac

# Check for valid choice of THREAD

if [ "$CHARM_SHARED" = "1" -a -n "$CMK_LD_SHARED_THREAD" -a "$THREAD" = "default" ]
then
  THREAD=$CMK_LD_SHARED_THREAD
fi
THREAD_OBJ="$CHARMLIB/libthreads-$THREAD.o"

if [ ! -r $THREAD_OBJ -o ! -s $THREAD_OBJ ] 
then
  (cd $CHARMLIB ; list=`ls libthreads-* 2>/dev/null`; test -n "$list" && for i in $list; do [ -s $i ] && ls -l $i; done )
  Abort "charmc : No such thread mode $THREAD"
fi

################# Build the module initialization function ##################
modInitName="moduleinit$$"
modInitSrc="$modInitName.C"
modInitObj="$modInitName.o"
DoNoErrCheck $RM $modInitSrc $modInitObj > /dev/null 2>&1

for module in $MODULES; do
    echo "extern void _register$module(void);" >> $modInitSrc
done
for trace in $TRACEMODE; do
    if test $trace = "summary" 
    then
      echo "  extern void _registerTraceSummary();" >> $modInitSrc
    elif test $trace = "projections"
    then
      echo "  extern void _registerTraceProjections();" >> $modInitSrc
    elif test $trace = "simple"
    then
      echo "  extern void _registerTraceSimple();" >> $modInitSrc
    elif test $trace = "Tau"
    then
      echo "  extern void _registerTraceTau();" >> $modInitSrc
    elif test $trace = "controlPoints"
    then
      echo "  extern void _registerTraceControlPoints();" >> $modInitSrc
    elif test $trace = "all"
    then
      echo "  extern void _registerTraceProjections();" >> $modInitSrc
      echo "  extern void _registerTraceSummary();" >> $modInitSrc
    fi
done
if test -n "$BALANCER"
then
    echo "extern void LBDefaultCreate(const char *);" >> $modInitSrc
fi
echo "void _registerExternalModules(char **argv) {" >> $modInitSrc
for module in $MODULES; do
    [ -n "$VERBOSE" ] && echo "Adding registration for module $module"
    echo "  _register$module();" >> $modInitSrc
done
for trace in $TRACEMODE; do
    if test $trace = "summary"
    then
      echo "  _registerTraceSummary();" >> $modInitSrc
    elif test $trace = "projections"
    then
      echo "  _registerTraceProjections();" >> $modInitSrc
    elif test $trace = "Tau"
    then
      TRACE_WITH_TAU=1
      echo "  _registerTraceTau();" >> $modInitSrc
    elif test $trace = "simple"
    then
      echo "  _registerTraceSimple();" >> $modInitSrc
    elif test $trace = "controlPoints"
    then
      echo "  _registerTraceControlPoints();" >> $modInitSrc
    elif test $trace = "all"
    then
      echo "  _registerTraceProjections();" >> $modInitSrc
      echo "  _registerTraceSummary();" >> $modInitSrc
    fi
done
if test -n "$BALANCER"
then
    [ -n "$VERBOSE" ] && echo "Adding load balancer for $BALANCER"
    for deflb in $BALANCER
    do
      echo "  LBDefaultCreate(\"$deflb\");" >> $modInitSrc
    done
fi
echo "}" >> $modInitSrc

# creating projections
echo "void _createTraces(char **argv) {" >> $modInitSrc
for trace in $TRACEMODE; do
    [ -n "$VERBOSE" ] && echo "Adding registration for trace $trace"
    echo "extern void _createTrace$trace(char **argv);" >> $modInitSrc
    echo "_createTrace$trace(argv);" >> $modInitSrc
done
echo "}" >> $modInitSrc

Do $CMK_CXX $OPTS_CPP_INTERNAL $OPTS_CPP $OPTS_CXX -c $modInitSrc -o $modInitObj

###############################################################################
#
#                               Finally, LINK
#
###############################################################################

Debug "About to perform final link..."

MAKE_LDXX="0"
MAKE_LD="0"

CORE_LIBS="-lconv-core -lconv-util $TRACE_OBJ "

# get TAU stub makefile variables
if test "$CMK_WITH_TAU" = "true"
then
  echo "include $TAU_MAKEFILE" > _make.tau.tmp
  echo "print-%:; @@echo \$(\$*)" >> _make.tau.tmp
  TAU_LIBS=`make --no-print-directory -f _make.tau.tmp print-TAU_LIBS`
  TAU_MPI_LIBS=`make --no-print-directory -f _make.tau.tmp print-TAU_MPI_LIBS` 
  TAU_MPI_FLIBS=`make --no-print-directory -f _make.tau.tmp print-TAU_MPI_FLIBS`
  rm -f _make.tau.tmp
fi
# done getting TAU variables

case "$LANGUAGE" in
"f90charm")
	MAKE_LDXX="1"
	MIDDLE_LIBS="-lck -lconv-cplus-y $CORE_LIBS "
        CMK_SYSLIBS="$CMK_SYSLIBS -lm"
	if [ "$TAU_TRACE_MPI" = "1" ]
	then
		TAU_LIBS="$TAU_MPI_FLIBS $TAU_LIBS"
	else
		TAU_LIBS="$TAU_LIBS"
	fi
	;;
"charm"|"charm++"|"f90charm"|"ckbluegene"|"bgcharm++")
	MAKE_LDXX="1"
	MIDDLE_LIBS="-lck -lconv-cplus-y $CORE_LIBS "
        CMK_SYSLIBS="$CMK_SYSLIBS -lm"
	if [ "$TAU_TRACE_MPI" = "1" ]
	then
		TAU_LIBS="$TAU_MPI_LIBS $TAU_LIBS"
	else
		TAU_LIBS="$TAU_LIBS"
	fi
	;;
"converse")
	MAKE_LD="1"
	MIDDLE_LIBS="-lconv-cplus-n $CORE_LIBS -ltrace-converse "
        CMK_SYSLIBS="$CMK_SYSLIBS -lm"
	;;
"converse++"|"bluegene"|"bigsim"|"bgconverse++")
	MAKE_LDXX="1"
	MIDDLE_LIBS="$MIDDLE_LIBS -lconv-cplus-y $CORE_LIBS -ltrace-converse "
        CMK_SYSLIBS="$CMK_SYSLIBS -lm"
	;;
*)
	Abort "Unrecognized choice of language $LANGUAGE"
	;;
esac

if [ "$BUILD_SHARE" = "0" ]
then
	MIDDLE_LIBS="$MEM_OBJ $THREAD_OBJ $MIDDLE_LIBS"
fi

if [ "$CHARM_SHARED" = "1" ]
then
  [ -z "$CHARMLIBSO" ] &&  Abort "Charm++ lib_so directory not found!"
  # build user executable/shared lib linking with charm .so
  OPTS_LD="$OPTS_LD $CMK_LD_LIBRARY_PATH"
  if [ "$BUILD_SHARE" = "1" ]
  then
    LANG_LIBS="-L$CHARMLIBSO $OBJECTFILES $PRE_LIBRARIES"
  else
    LANG_LIBS="-L$CHARMLIBSO $BAL_OBJ $OBJECTFILES $modInitObj $PRE_LIBRARIES"
  fi
else
  LANG_LIBS="-L$CHARMLIB -I$CHARMINC $BAL_OBJ $OBJECTFILES $modInitObj $PRE_LIBRARIES"
fi
if [ "$TRACE_WITH_TAU" = 1 ]
then
	echo "Linking with the TAU libraries: $TAU_LIBS"
	ALL_LIBS="$LANG_LIBS $MIDDLE_LIBS $CMK_LIBS $POST_LIBRARIES $CMK_SYSLIBS $TAU_LIBS"
else
	ALL_LIBS="$LANG_LIBS $MIDDLE_LIBS $CMK_LIBS $POST_LIBRARIES $CMK_SYSLIBS"
fi
Debugf "All libraries are: $ALL_LIBS"

if [ "$BUILD_SHARE" = "1" -a "$CHARM_SHARED" = "1" ]
then
  # build an applicaiton .so linking with charm .so
  OPTS_LD="$OPTS_LD $CMK_LD_SHARED $OPTS_LDRO -L$CHARMLIBSO"
  Debugf "Running ldro..."
  DoNoErrCheck $RM $OBJECT
  [ "$MAKE_LDXX" = "1" ] && Do $CMK_LDXX $OPTS_LD $OPTS_LDXX -o $OBJECT $ALL_LIBS
  [ "$MAKE_LD" = "1" ] && Do $CMK_LD $OPTS_LD -o $OBJECT $ALL_LIBS
  Copyobj
else
# Make a regular executable: call the appropriate linker
  [ "$MAKE_LDXX" = "1" ] && Do $CMK_LDXX $OPTS_LD $OPTS_LDXX -o $OBJECT $ALL_LIBS
  [ "$MAKE_LD" = "1" ] && Do $CMK_LD $OPTS_LD -o $OBJECT $ALL_LIBS
fi

########################################################################
#
# Copy conv-host to user directory if it is present in installation.
#
########################################################################

if test "$COPY_CHARMRUN" = "true"
then
  targ=charmrun$CMK_POST_EXE
  [ ! -x $CHARMBIN/$targ -a -n "$CMK_POST_EXE" ] && targ=charmrun
  convhost=conv-host$CMK_POST_EXE

  if [ -x $CHARMBIN/$targ ]
  then
	DoNoErrCheck $RM $targ
	Do $CP $CHARMBIN/$targ $targ
  fi
fi

[ -z "$SAVE" ] && DoNoErrCheck $RM $modInitSrc $modInitObj > /dev/null 2>&1

Copyobj


@


1.216
log
@Added default value for CMK_CELL.
@
text
@d496 1
a496 1
		SPU_EXTRA_LIBS="$SPU_EXTRA_LIBS $1"
@


1.215
log
@Added C++ and user specified library support for SPEs.
@
text
@d89 1
@


1.214
log
@include an empty Makefile for tau when tau is not compiled is not acceptable for standard make. fixed by having a dummy empty tau makefile.
@
text
@d88 4
d119 3
d490 9
d1309 9
d1319 2
a1320 2
    Do $CMK_SPU_CC -c -I$CHARMINC -o main__funcLookup__.genSPECode.o main__funcLookup__.genSPECode.c -DCMK_CELL_SPE=1
    Do $CMK_SPU_LD -L$CHARMLIB -o main__funcLookup__.genSPECode main__funcLookup__.genSPECode.o $CMK_SPERT_LIBS
@


1.213
log
@make sure CMK_CELL is set to 0 as default. This simplifies charmc test
@
text
@d86 1
a86 1
TAU_MAKEFILE=
@


1.212
log
@refix the previous checkin
@
text
@d1288 1
a1288 1
if [ -n "$CMK_CELL" -a "$CMK_CELL" == "1" ]
@


1.211
log
@changed CMK_CELL comparison from int to string
@
text
@d1288 1
a1288 1
if [ "$CMK_CELL" == "1" ]
@


1.210
log
@fixed previous checkin in  CMK_CELL test
@
text
@d1288 1
a1288 1
if [ "$CMK_CELL" -eq 1 ]
@


1.209
log
@Added commands to build SPE code from generated charmxi code.
@
text
@d1288 1
a1288 1
if [ "$CMK_CELL" == "1" ]
@


1.208
log
@when copying charmrun to source dir under windows, charmrun can be a script for multicore-win32. Make sure both charmrun.exe and charmrun are tried.
@
text
@d1287 17
@


1.207
log
@mostly Gregory Crosswhite's charmc patch, adding -preprocess argument for charmxi.
@
text
@d1650 3
a1652 2
targ=charmrun$CMK_POST_EXE
convhost=conv-host$CMK_POST_EXE
d1654 2
a1655 2
if [ -x $CHARMBIN/$targ ]
then
d1658 1
a1658 1
fi
@


1.206
log
@fix for tau build
@
text
@d588 4
d1091 8
a1098 6
		if [ "$LANGUAGE" = "f90charm" ]
		then
		    Do $CHARMBIN/charmxi -f90 $CMK_XIOPTS $FILE
		else
		    Do $CHARMBIN/charmxi $CMK_XIOPTS $FILE
		fi
@


1.205
log
@Modifications for TAU tracing in the Charm++ framework.
@
text
@d86 1
a86 1
TAU_MAKEFILE=/expand/home/cheelee/work/tau-charm/tau-2.17.3b2/x86_64/lib/Makefile.tau
d1495 1
a1495 1
		  TRACE_WITH_TAU=1
d1544 9
a1552 6
echo "include $TAU_MAKEFILE" > _make.tau.tmp
echo "print-%:; @@echo \$(\$*)" >> _make.tau.tmp
TAU_LIBS=`make --no-print-directory -f _make.tau.tmp print-TAU_LIBS`
TAU_MPI_LIBS=`make --no-print-directory -f _make.tau.tmp print-TAU_MPI_LIBS` 
TAU_MPI_FLIBS=`make --no-print-directory -f _make.tau.tmp print-TAU_MPI_FLIBS`
#rm _make.tau.tmp
@


1.204
log
@Adding a control point framework. It is a module created by Isaac.
@
text
@d86 2
d113 1
a113 1
    echo "        -pg <opt> -build-shared -charm-shared"
d458 3
d1465 3
d1493 4
d1543 9
d1553 11
d1568 6
d1609 8
a1616 1
ALL_LIBS="$LANG_LIBS $MIDDLE_LIBS $CMK_LIBS $POST_LIBRARIES $CMK_SYSLIBS"
@


1.203
log
@fixed problem with -debug flag
moved python modules load to before modules are parsed
@
text
@d1460 3
d1488 3
@


1.202
log
@Added a template trace-module as an example of how someone might write other
trace modules for Charm++.
@
text
@a410 1
		shift
d713 17
a786 17
Debug "About to read machine config script"
Debug "Read config script, setting defaults..."

[ ! -r $CHARMINC/conv-config.sh ] && Abort "Cannot find conv-config.sh in $CHARMINC"
. $CHARMINC/conv-config.sh $CHARMINC

Debug "Setting vars..."

# If we are debugging, add "-g -O0" to the C/C++ flags
if [ -n "$CHARMDEBUG" ]; then
       if [ -n "$CMK_BUILD_PYTHON" ]; then
         	AddModules PythonCCS charmdebug_python
		POST_LIBRARIES=`AddList $POST_LIBRARIES -lpython${CMK_BUILD_PYTHON}`
   	fi
    	OPTS_CPP="$OPTS_CPP -O0 -g"
fi

@


1.201
log
@change to allow recognition of suffix such as .so.6 as shared library. This allows rocstar to link on turing linux.
@
text
@d1458 3
d1483 3
@


1.200
log
@Wrapping memory-os with the other memory libraries available: paranoid, charmdebug, verbose, leak, isomalloc.
The new libraries are called libmemory-os-<wrapper_library>
An extra file and library, libmemory-os-wrapper, is compiled to provide runtime support to this feature. charmc automatically includes this library if the user requests a library wrapping the OS malloc (like "-memory os-leak"

Charm build process does not depend on these libraries to successfully build.
@
text
@d800 1
a800 1
	*.a|*.so|*.sl|*.dylib)
d1116 1
a1116 1
	*.o|*.so|*.sl|*.a|*.dylib)
d1208 1
a1208 1
*.so|*.sl|*.dylib)
@


1.199
log
@fixed Filippo's check in. Get rid of preloading of conv-config.sh, which changed the value of $@@ on some platform for example IBM SP.
@
text
@d1421 7
@


1.198
log
@forgot check for machines without python
@
text
@a349 10
################################
# Preload configuration script
################################
Debug "About to preload machine config script"
Debug "Preload config script, setting defaults..."

[ ! -r $CHARMINC/conv-config.sh ] && Abort "Cannot find conv-config.sh in $CHARMINC"
. $CHARMINC/conv-config.sh $CHARMINC


d411 1
a411 3
                if [ -n "$CMK_BUILD_PYTHON" ]; then
                    AddModules PythonCCS charmdebug_python
                fi
a706 4
# If we are debugging, add "-g -O0" to the C/C++ flags
if [ -n "$CHARMDEBUG" ]; then
    OPTS_CPP="$OPTS_CPP -O0 -g"
fi
d779 7
a785 4
# Now that we have read the config file, if python is requested, add the correct version
if [ -n "$CMK_BUILD_PYTHON" ]
then
	POST_LIBRARIES=`AddList $POST_LIBRARIES -lpython${CMK_BUILD_PYTHON}`
@


1.197
log
@Added flag "-debug" to charmc for usage with charmdebug.
Some work done on CmiReduce to make it possible to have concurrent reductions.
Added memory tagging by chare ID in charmdebug.
Fixed breakpointing with charmdebug: now each entry point is defined by its sequential index in the EP table (before a string match was performed).
Added stepping: delivery of a single message in the queue. Also, all the system entry methods are currently always executed, and never get buffered by charmdebug (they can still breakpoint if the user so chooses).
Fixed race condition in python interface. To do that the interface itself has been modified, in particular with regard to high-level python. Python is now more flexible and it allows any chare collection to be "python" and receive requests. The replies are reduced to a PythonCCS mainchare which will handle the socket.
The python directory has now another module (charmdebug-python) for usage by charmdebug introspection code.
@
text
@d796 4
a799 1
POST_LIBRARIES=`AddList $POST_LIBRARIES -lpython${CMK_BUILD_PYTHON}`
@


1.196
log
@Recognize a .cu file(for CUDA) as a normal C++ file.
@
text
@d55 2
d316 44
d417 9
d719 3
a721 18

##############################################################################
#
# The following section identifies CHARMBIN, the charm binary-directory.
#
##############################################################################

ORIGDIR=`pwd`

# Try to find CHARMBIN by looking in directory where charmc is

findCharmBin $0

FIRST_THREE=`uname -s | awk '{print substr($1,1,3)}' `
if [ "$FIRST_THREE" = "CYG" ]
then
# Running on a windows system-- append .exe to file names
	PROG_EXT=".exe"
a723 16
CHARMLIB="$CHARMBIN/../lib"
CHARMINC="$CHARMBIN/../include"
CHARMLIBSO=
if test -d "$CHARMBIN/../lib_so" 
then
  CHARMLIBSO=`cd $CHARMBIN/../lib_so 2>/dev/null && pwd`
  #getting absolute path is harder than thought because of symbolic links and ..
  #ksh needs cd -P to resolve werid symbolic links, however -P is not portable
  #csh is ok too if it exists 
  test -z "$CHARMLIBSO" && CHARMLIBSO=`cd -P $CHARMBIN/../lib_so 2>/dev/null && pwd`
  test -z "$CHARMLIBSO" && CHARMLIBSO=`csh -c "cd $CHARMBIN/../lib_so >& /dev/null && pwd"`
  test -z "$CHARMLIBSO" && echo "$CHARMBIN/../lib_so: not found" && exit 1
fi



d741 5
a745 1
	
d795 3
@


1.195
log
@Moving ParFUM_TOPS code into its own directory, and adding it as a language in charmc.
@
text
@d1077 1
a1077 1
	*.C|*.cc|*.cxx|*.cpp|*.c++)
@


1.194
log
@added copy global make rules and compiler option.
fixed projections rule.
@
text
@d358 1
@


1.193
log
@Projections is now a module. Online outlier analysis now supported with the
runtime option "+outlier". This analysis happens at the end of the run and
decides which log files should be generated.
@
text
@d422 8
d1272 12
@


1.192
log
@language bluegene => bigsim
@
text
@d1329 1
a1329 1
[ -r $CHARMLIB/libtrace-projections.a ] || Abort "trace libraries not installed.  Is Charm++ built properly?"
d1403 1
a1403 1
    if test $trace = "summary" || test $trace = "all"
d1406 7
d1425 7
a1431 1
    if test $trace = "summary" || test $trace = "all"
d1433 1
@


1.191
log
@more bluegene => bigsim
@
text
@d1468 1
a1468 1
"converse++"|"bluegene"|"bgconverse++")
@


1.190
log
@bluegene => bigsim
@
text
@d1233 2
a1234 2
"bluegene")
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene -lconv-bigsim-logs"
d1240 1
a1240 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene -lconv-bigsim-logs -lconv-bluegene-stub"
d1243 1
a1243 1
        MIDDLE_LIBS="$MIDDLE_LIBS -lconv-bluegene -lconv-bigsim-logs"
@


1.189
log
@link -lz only when linking projections
@
text
@d1234 1
a1234 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene -lconv-bluegene-logs"
d1240 1
a1240 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene -lconv-bluegene-logs -lconv-bluegene-stub"
d1243 1
a1243 1
        MIDDLE_LIBS="$MIDDLE_LIBS -lconv-bluegene -lconv-bluegene-logs"
@


1.188
log
@Add armcif language option for armci with fortran library
@
text
@d1337 1
@


1.187
log
@print error mesg when CMK_CF90 is not defined
@
text
@d353 1
d355 1
a355 1
		"ampif") AddModules tcharmmain ampif ; USE_F90_LIBRARIES="1" ;;
@


1.186
log
@read CMK_PIC for compiler specific -fpic option
@
text
@d1072 1
d1077 1
@


1.185
log
@build a libckf.a for ck fortan api.
@
text
@d52 2
d415 4
a418 5
		# fixme: -fpic is only for gcc-- should wait until we read config script
		OPTS_CC="$OPTS_CC -fpic"
		OPTS_CXX="$OPTS_CXX -fpic"
		OPTS_F90="$OPTS_F90 -fpic"
		OPTS_LD="$OPTS_LD -fpic"
@


1.184
log
@*** empty log message ***
@
text
@d1226 1
a1226 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lf90charm "
@


1.183
log
@Added ParFUM as a language. It works just like its predecessor, the FEM language.
@
text
@d351 1
@


1.182
log
@define CMK_FPP for preprocessing.
@
text
@d354 2
@


1.181
log
@allow -I <dir> as well as -I<dir>
@
text
@d521 7
a527 1
	"-M"|"-E"|"-P"|"-S")
d855 5
d1072 2
a1073 1
		Do $CMK_CF90 -I$CHARMINC $OPTS_CPP $OPTS_F90 -c $FILE $DESTO
@


1.180
log
@move -lm to the end of link command line (this fixed Mac link with mpich and malloc hook check problem)
@
text
@d550 5
@


1.179
log
@Added a special case to always compile bglmachine.C w/ GNU g++
@
text
@d1435 2
a1436 1
	MIDDLE_LIBS="-lck -lconv-cplus-y $CORE_LIBS -lm"
d1440 2
a1441 1
	MIDDLE_LIBS="-lconv-cplus-n $CORE_LIBS -ltrace-converse -lm"
d1445 2
a1446 1
	MIDDLE_LIBS="$MIDDLE_LIBS -lconv-cplus-y $CORE_LIBS -ltrace-converse -lm"
@


1.178
log
@need -nof90main as well to override the -f90main in some rare cases.
@
text
@d1043 4
@


1.177
log
@added new option -f90main which simply tells charmc that main is in f90 code, and for_main needs to be linked.
@
text
@d613 3
@


1.176
log
@put all libraries in CMK_SYSLIBS to the very end of link command line.
When specifying "-save", leave moduleinit.Co.
@
text
@d610 3
d869 7
d1103 6
a1108 1
	soCmd="$CMK_LD -o $OBJECT $OPTS_LD $OPTS_LDRO $OBJECTFILES $PRE_LIBRARIES $POST_LIBRARIES $CMK_LD_SHARED_LIBS"
@


1.175
log
@cleanup moduleinit file at end.
trap control^C for better cleanup.
@
text
@d1447 1
a1447 1
ALL_LIBS="$LANG_LIBS $MIDDLE_LIBS $CMK_LIBS $POST_LIBRARIES"
d1482 1
a1482 1
DoNoErrCheck $RM $modInitSrc $modInitObj > /dev/null 2>&1
@


1.174
log
@fixed bug for override:
CMK_CXX="$OVERRIDE_CXX $CMK_CXX "
which generated command line with 2 compilers.
@
text
@d130 5
d162 1
a265 1

d628 1
@


1.173
log
@fixed a bug for supporting the feature where one can specify multiple -balancer at compile time. The specical meaning of this is that it specifies different load balancers for subsequent load balancing steps.
@
text
@d751 25
a831 20
if [ -n "$OVERRIDE_CC" ]
then
    CMK_CC="$OVERRIDE_CC $CMK_CC "
fi
Debug "set 2"
if [ -n "$OVERRIDE_CXX" ]
then
    CMK_CXX="$OVERRIDE_CXX $CMK_CXX "
fi

if [ -n "$OVERRIDE_F90" ]
then
    CMK_CF90="$OVERRIDE_F90 $CMK_CF90 "
fi

if [ -n "$OVERRIDE_LD" ]
then
    CMK_LD="$OVERRIDE_LD $CMK_LD"
fi

a837 5
if [ -n "$OVERRIDE_LDXX" ]
then
    CMK_LDXX="$OVERRIDE_LDXX $CMK_LDXX"
fi

@


1.172
log
@name moduleinit with process number($$) so that parallel make (linking) won't co
nflict with this file.
@
text
@d365 2
a366 2
                test -n "$BALANCER" && Abort "More than one -balancer specified!"
		BALANCER="$1"
d1373 4
a1376 1
    echo "  LBDefaultCreate(\"$BALANCER\");" >> $modInitSrc
@


1.171
log
@fixed the previous fix, suppress error output by using /dev/null
@
text
@d1341 1
a1341 1
modInitName="moduleinit"
@


1.170
log
@getting absolute path is difficult than thought. cd && pwd does not work for some weird symbolic links, so has to try something else.
@
text
@d652 7
a658 7
  CHARMLIBSO=`cd $CHARMBIN/../lib_so && pwd`
  # getting absolute path is harder than thought because of symbolic links
  # ksh needs cd -P to resolve werid symbolic link, however -P is not portable
  # csh is ok too if it exists 
  test -z "$CHARMLIBSO" && CHARMLIBSO=`cd -P $CHARMBIN/../lib_so && pwd`
  test -z "$CHARMLIBSO" && CHARMLIBSO=`csh -c "cd $CHARMBIN/../lib_so && pwd"`
  test -z "$CHARMLIBSO" &&  exit 1
@


1.169
log
@a new option "-no-charmrun" which disable the copying of charmrun to user directory. (requested by csar)
@
text
@d650 11
a660 1
[ -d "$CHARMBIN/../lib_so" ] && CHARMLIBSO=`cd "$CHARMBIN/../lib_so"; pwd`
@


1.168
log
@if CMK_LD_SHARED_ABSOLUTE_PATH is set, change libso path to absolute path
@
text
@d75 2
d599 3
a601 1

d1451 2
d1461 1
@


1.167
log
@two changes for compiling csar code:
1. apparently passing -D___CHARMC___ to both c and fortran compilers is not a good idea because f90 compiler does not like it often time, so cahnge it to send to c and cxx compiler only
2. for user provides parameter like  -framework vecLib, what happened to charmc was that it takes -framework as unrecognizable parameter and pass to real compiler, while abort since it does not know how to deal with "vecLib". Change it to pass to compiler anyway if this case also.
@
text
@d1064 8
@


1.166
log
@modifed to recognize .dylib
@
text
@d43 3
a45 1
OPTS_CPP="-D__CHARMC__=1 "
d611 3
a613 1
		printUsage  "Error: Unrecognized argument $arg"
d1007 1
a1007 1
		Do $CMK_CC -I$CHARMINC $OPTS_CPP $OPTS_CC -c $FILE $DESTO
d1011 1
a1011 1
		Do $CMK_CXX -I$CHARMINC $OPTS_CPP $OPTS_CXX -c $FILE $DESTO
d1364 1
a1364 1
Do $CMK_CXX $OPTS_CPP $OPTS_CXX -c $modInitSrc -o $modInitObj
@


1.165
log
@updated the error output in building shared lib.
@
text
@d724 1
a724 1
	*.a|*.so|*.sl)
d1021 1
a1021 1
	*.o|*.so|*.sl|*.a)
d1061 1
a1061 1
	soCmd="$CMK_LD -o $OBJECT $OPTS_LD $OPTS_LDRO $OBJECTFILES $PRE_LIBRARIES $POST_LIBRARIES"
d1100 1
a1100 1
*.so|*.sl)
@


1.164
log
@when compiling bigsim emulator program, don't need to link -lconv-bluegene-logs (which invokes initCharm). It is only needed for charm++ program.
@
text
@d1066 6
a1071 4
	echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
	echo "!!      Failed to compile Charm++ shared library               !!"
	echo "!!      compile Charm++ again with -no-build-shared option     !!"
	echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
@


1.163
log
@added make rule for compiling blue_stub.o into library which sets default user start entry function on each bluegene node. Modified charmc to link against this new lib.
@
text
@d1154 1
a1154 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene -lconv-bluegene-logs -lconv-bluegene-stub"
d1163 1
a1163 1
        MIDDLE_LIBS="$MIDDLE_LIBS -lconv-bluegene -lconv-bluegene-logs -lconv-bluegene-stub"
@


1.162
log
@change -p to -fmoddir to avoid possible name confliction.
@
text
@d102 1
d1154 1
a1154 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene -lconv-bluegene-logs"
d1160 1
a1160 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene -lconv-bluegene-logs"
d1163 1
a1163 1
        MIDDLE_LIBS="$MIDDLE_LIBS -lconv-bluegene -lconv-bluegene-logs"
@


1.161
log
@added -p option for charmc for compiling f90 to specify -mod dir.
@
text
@d577 1
a577 1
	"-p")
@


1.160
log
@Remove annoying "passing unrecognized option ... to all compilers and linkers"
warning.  This warning is quite annoying anytime you have to pass
extra arguments to the compiler, e.g.:
   - Machine or optimization flags, like -msse for g++.
   - Bounds checks to Fortran compiler (-B111), like the rocket code.

I suspect this warning annoys many more people than it educates,
so it doesn't belong there.
@
text
@d57 1
d577 5
d756 8
@


1.159
log
@changed processArgs $@@ to "$@@" to prevent quotes ("") in the parameter to be interpreted.
@
text
@d593 1
a593 1
		Warning "passing unrecognized option $arg to all compilers and linkers"
@


1.158
log
@fixed a bug introduced last when making it a function to find the charm bin dir.
@
text
@d610 1
a610 1
processArgs $@@
@


1.157
log
@fixed for NAMD which still uses old commlib name and refuse to change Makefile. copying a libmodulecommlib.a from libmodulecomlib.a.
Increased Charm++ version number.
charmc -V should now print Charm version number (after running configure).
@
text
@d264 1
a264 1
	SCRIPT=$0
d296 1
a296 1
	findCharmBin
d623 1
a623 1
findCharmBin
@


1.156
log
@fixed an error due to uninitialized USE_F77_LIBRARIES.
@
text
@d86 2
d260 41
d318 5
d623 1
a623 30
if [ -z "$CHARMBIN" ]
then
	SCRIPT=$0
	CHARMBIN=`dirname $SCRIPT`
#	CHARMBIN=`cd $CHARMBIN; pwd`
# NOTE: this script no longer tries to follow soft links
# to find the "original" charmc-- if this is bad, 
# translate these lines to Bourne shell from C shell:
# -------------------- Begin C Shell ------------------------->
#    if ($SCRIPT:h != $SCRIPT:t) then
#        cd $SCRIPT:h
#        set SCRIPT=$SCRIPT:t
#    else
#        foreach dir ($path)
#            if (-x $dir/$SCRIPT && ! -d $dir/$SCRIPT) then
#                cd $dir
#                break
#            endif
#        end
#    endif
#    while (x`find $SCRIPT -type l -print` == x$SCRIPT)
#        set SCRIPT=`ls -al ./$SCRIPT:t | sed -e "s@@.*-> @@@@"`
#        if ($SCRIPT:h != $SCRIPT:t) then
#            cd $SCRIPT:h
#            set SCRIPT=$SCRIPT:t
#        endif
#    end
#    set CHARMBIN=`pwd`
# <------------------ End C Shell -----------------------------
fi
@


1.155
log
@added simple implementation for accepting -f77 for invoking fortran77 compiler
@
text
@d56 1
@


1.154
log
@Link in .a files along with other libraries, instead of treating
them as separate "other files".
@
text
@d455 6
d716 7
d1148 5
@


1.153
log
@Fixed LANGUAGE setting for compiling bluegene simulator program when -language is missing.
@
text
@d521 1
a521 1
	-l*)
@


1.152
log
@changed -native to -host
@
text
@a678 14
# update charm to bgcharm
if [ "$LANGUAGE" = "charm++" -a -n "$CMK_BLUEGENE" ]
then
        LANGUAGE="bgcharm++"
fi
if [ "$LANGUAGE" = "converse++" -a -n "$CMK_BLUEGENE" ]
then
        LANGUAGE="bgconverse++"
fi
if [ "$LANGUAGE" = "bgcharm++" ]
then
	TRACEMODE=`AddList $TRACEMODE bluegene`
fi

d816 14
@


1.151
log
@Rearranged so the charm headers come before all user-specified
headers.  This is so machines like Blue Gene, which have the
mpi.h header in a user-specified directory, will find the AMPI
mpi.h header instead.
@
text
@d90 1
a90 1
    echo "        -machine <mach> -seq -native -langage <lang> "
d283 1
a283 1
	"-native")
@


1.150
log
@Remove "eval" from main Do routine.  This prevents charmc
from stripping off the quotes when doing, e.g.,
	charmc -c foo.c -DBAR='"bar"'
or
	charmc -c foo.c -DBAR="\"bar\""

This "send in a quoted string from the command line" idiom
is used by both PETSc and the latest CSAR GENx.
@
text
@d896 1
a896 1
	Do $CMK_CPP_C $OPTS_CC $OPTS_CPP -I$CHARMINC $TMP.c > $TMP.i
d955 1
a955 1
		Do $CMK_CC $OPTS_CPP $OPTS_CC -I$CHARMINC -c $FILE $DESTO
d959 1
a959 1
		Do $CMK_CXX $OPTS_CPP $OPTS_CXX -I$CHARMINC -c $FILE $DESTO
d963 1
a963 1
		Do $CMK_CF90_FIXED $OPTS_CPP $OPTS_F90 -I$CHARMINC -c $FILE $DESTO
d967 1
a967 1
		Do $CMK_CF90 $OPTS_CPP $OPTS_F90 -I$CHARMINC -c $FILE $DESTO
d1350 1
a1350 1
    LANG_LIBS="-L$CHARMLIBSO -I$CHARMINC $OBJECTFILES $PRE_LIBRARIES"
d1352 1
a1352 1
    LANG_LIBS="-L$CHARMLIBSO -I$CHARMINC $BAL_OBJ $OBJECTFILES $modInitObj $PRE_LIBRARIES"
@


1.149
log
@charmc takes bgconverse++ to link bluegene converse libraries.
updated Make.depends.
@
text
@d128 1
a128 1
	echo $* 1>&2
d135 1
a135 1
	Warning "   $*"
d145 2
a146 2
	[ -n "$VERBOSE" ] && echo "charmc: Executing $*" 1>&2
	eval $*
d149 1
a149 1
	DoNoErrCheck $*
d152 1
a152 1
	[ $Do_res -eq 0 ] || Abort "Command $* returned error code $Do_res"
@


1.148
log
@fixed a silly bug introduced recently failed to create .so when -cp is used.
@
text
@d684 4
d1114 3
d1329 1
a1329 1
"converse++"|"bluegene")
d1331 1
a1331 1
	MIDDLE_LIBS="-lconv-cplus-y $CORE_LIBS -ltrace-converse -lm"
@


1.147
log
@minor change to check early when an obj file is of size 0 and abort.
This is to avoid unnecessary report of "failure of building charm share libs"
when for example f90 is not available and a fake obj is touched.
@
text
@d1071 1
a1071 1
	    DESTDIR=COPYTO
@


1.146
log
@when building charm++ shared libraries failed, print a verbose information and suggest using -no-build-shared to compile charm again disabling the shared libs.
@
text
@d970 1
d1018 1
a1018 1
	 Abort "Command $soCmd returned error code $Do_res"
@


1.145
log
@if lib_so is removed for saving disk space, building charm share libraies is disabled automatically.
@
text
@d1008 11
a1018 2
	Do $CMK_LD -o $OBJECT $OPTS_LD $OPTS_LDRO $OBJECTFILES \
		$PRE_LIBRARIES $POST_LIBRARIES
@


1.144
log
@changed charmc to always creating .so file instead of having to use -build-shared in OPTS= when make under tmp. Not creating .so together with .a results in the situation that the shared libs built at "build" time (as default) is inconsistent with the latest ".a" under charm/lib when typing "make" directly under charm/tmp.
To tell charmc that it is building charm so, in gather source tree phase, Makefile creates a hidden flag file ".charmso" under lib_so/ to tell charmc that this is compiling charm++ instead of building users source code where building share libs should be skipped.
@
text
@d689 1
a689 1
if [ "$BUILD_SHARE" = "1" -a -n "$CMK_NO_BUILD_SHARED" ]
d691 4
a694 1
	BUILD_SHARE="0"
a698 1
 	[ -z "$CHARMLIBSO" ] &&  Abort "Charm++ lib_so not found!"
@


1.143
log
@corrected the flag for creating ELF position independent code for Fortran
compilers. (Absoft fortran compiler apparently doesn't work.)
@
text
@d73 1
a73 1
BUILD_SHARE="0"
d503 5
a507 1
		BUILD_SHARE="1"
d1055 1
d1059 1
d1062 1
a1062 1
	  MakeSO
d1222 1
a1222 1
  (cd $CHARMLIB ; for i in `ls libmemory-*`; do [ -s $i ] && ls -l $i; done )
d1236 1
a1236 1
  (cd $CHARMLIB ; for i in `ls libthreads-*`; do [ -s $i ] && ls -l $i; done )
@


1.142
log
@a minor improvement - When some memory, threads or swapglobal module compilation fail, touch an empty file to eliminate the annoying re-try afterwards.
Modified charmc to be smart enough to skip the empty modules and complain by print a list of availble non-zero file sized modules.
@
text
@d353 1
a353 1
		OPTS_F90="$OPTS_F90 -c"
@


1.141
log
@support cross compilation, to invoke native compiler use "-native" charmc option. By default, use native compiler to compile charmxi since it is run locally.
@
text
@d1102 1
a1102 1
	if [ ! -r "$swapo" ]
d1214 5
a1218 1
[ ! -r $MEM_OBJ ] && Abort "charmc : No such memory mode $MEMORY"
d1228 5
a1232 1
[ ! -r $THREAD_OBJ ] && Abort "charmc : No such thread mode $THREAD"
@


1.140
log
@modified charm to recognize -intrinsic option.
added -intrinsic option to charmxii in Makefile when building charm.
@
text
@d23 1
d90 1
a90 1
    echo "        -machine <mach> -seq -langage <lang> "
d283 4
d737 8
d817 1
a817 1
	[ -z "$SEQUENTIAL" ] && Abort "Language $LANGUAGE is for sequential programs"
d1134 6
a1139 1
	Do $CMK_SEQ_LD $OPTS_LD -o $OBJECT $OBJECTFILES \
d1141 1
d1145 6
a1150 1
	Do $CMK_SEQ_LDXX $OPTS_LD -o $OBJECT $OBJECTFILES \
d1152 1
@


1.139
log
@allow especify ComboCentLB balancer in -balancer at compile time, for example -balancer ComboCentLB:GreedyLB,RefineLB
@
text
@d357 4
d771 5
@


1.138
log
@added shorthand for -charm-shared(-cs) and -build-shared(-bs)
@
text
@d307 2
a308 1
		AddModules $1
@


1.137
log
@The relocatable object(ELF) flag for f90 should be -d instead of -fpic
@
text
@d488 1
a488 1
	-charm-shared)
d491 1
a491 1
	-build-shared)
@


1.136
log
@in case of: charmc -o object.o -c foo.c,
avoid foo.c => remove foo.o => foo.o => object.o
instead, generate object.o directly.
Remove and generate foo.o may be dangerous in parallel make for example in the case of compiling several objs from one same c file such as memory.c.
@
text
@d345 4
a348 1
		OPTS="$OPTS -fpic"
@


1.135
log
@Added support for -swapglobals flag, which enables
the Ctg global-swapping routines.
@
text
@d879 20
d902 1
a902 1
		DoNoErrCheck $RM $BASE.o $BASE.f.o
a903 2
	BASEO="$BASE.o"
	DESTO="-o $BASEO"
d951 1
a951 1
		if [ "$OBJECT" != "$BASE.o" ]
@


1.134
log
@in case when lib_so is removed, charmc should still work in non shared lib compilation.
@
text
@d73 1
d341 6
d1053 13
@


1.133
log
@for -tracemode option, check for duplcaites and ignore the duplciated options.
@
text
@d584 2
a585 1
CHARMLIBSO=`cd "$CHARMBIN/../lib_so"; pwd`
d672 1
d1236 1
@


1.132
log
@when compile with bgcharm++, trace-bluegene is always enabled and linked.
@
text
@d229 3
d331 7
a337 1
		TRACEMODE="$TRACEMODE $1"
d661 1
a661 1
	TRACEMODE="$TRACEMODE bluegene"
@


1.131
log
@increase the charm version; change LB calls in moduleinit.C.
@
text
@d650 4
@


1.130
log
@-language bluegene needs to link two bluegene libraries.
@
text
@d1152 1
a1152 2
    echo "extern void LBSetDefaultCreate(void (*fn)(void));" >> $modInitSrc
    echo "extern void Create$BALANCER();" >> $modInitSrc
d1168 1
a1168 1
    echo "  LBSetDefaultCreate(Create$BALANCER);" >> $modInitSrc
@


1.129
log
@Minor tweaks for new FEM:
  1.) Use less clash-prone "__CHARMC__" #define,
      rather than just "CHARM".  CSAR's Rocflu,
      in particular, already used "CHARM" to mean
      something else.
  2.) Initialize the new FEM as an AMPI main routine.
@
text
@d1018 1
a1018 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene"
d1024 1
a1024 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene"
d1140 1
@


1.128
log
@If the fortran support libraries are missing, die with a real
error instead of silently removing them.
@
text
@d42 1
a42 1
OPTS_CPP="-DCHARM=1 "
d55 1
d283 2
a284 2
		"fem") AddModules tcharmmain fem ;;
		"femf") AddModules tcharmmain fem ; USE_F90_LIBRARIES="1" ;;
d1027 5
@


1.127
log
@Add "tcharmmain" module when building
to a tcharm-based language.
@
text
@a1025 1
[ -r $CHARMLIB/libconv-utilf.a ] || USE_F90_LIBRARIES="0"
d1029 7
@


1.126
log
@in function DO(), calling eval $*, instead of $* directly to allow args being  read and concatenated together into a  single command with special charater being interpreted.
@
text
@d280 6
a285 6
		"ampi") AddModules ampi ;;
		"ampif") AddModules ampif ;;
		"fem") AddModules fem ;;
		"femf") AddModules fem ; USE_F90_LIBRARIES="1" ;;
		"mblock") AddModules mblock ;;
		"mblockf") AddModules mblock ; USE_F90_LIBRARIES="1" ;;
@


1.125
log
@make CHARMLIBSO an absolute path to be used in rpath.
@
text
@d143 1
a143 1
	$*
@


1.124
log
@cleaned some leftovers.
@
text
@d574 1
a574 1
CHARMLIBSO="$CHARMBIN/../lib_so"
@


1.123
log
@removed "-makelibcharm", stop creating bizarre libfoo.dir's.
@
text
@d468 1
a468 1
	-charm-shared|-charmShared)
d471 1
a471 1
	-build-shared|-buildShared)
a997 4
	destDir="$OBJECT.dir"
	[ -n "$COPYTO" ] && destDir="$COPYTO/$OBJECT.dir"
	[ ! -d $destDir ] && DoNoErrCheck mkdir $destDir
	Do cp $OBJECTFILES $destDir
@


1.122
log
@compiled threads.c into different .o (similar to memory.c), which including qt, context, pthreads and fibers. added "-thread" option to charmc to allow choosing thread mode at compile time.
@
text
@a72 2
MAKELIBCHARM="0"

a421 6
	"-makelibcharm")
		MAKELIBCHARM="1"
		OBJECT=$1
		shift
		;;
	
a590 2
	if [ "$MAKELIBCHARM" = "0" ]
	then
d593 1
a593 2
		POST_LIBRARIES=`AddList $POST_LIBRARIES -lmodule$M`
	fi
d969 1
a969 1
	elif [ "$MAKELIBCHARM" = 0 -a "$CHARM_SHARED" = "0" ]
d1206 1
a1206 1
if [ "$MAKELIBCHARM" = "0" -a "$BUILD_SHARE" = "0" ]
a1234 49
elif [ "$MAKELIBCHARM" = "1" ]
then
# Make a libCharm.so: replace all .a's with their constituent.o's, since 
#   linkers will remove (for now!) unreferenced .o's from .a's.
  Debugf "Building shared library: original list of libraries: $ALL_LIBS"
  OLD_LIBS="$ALL_LIBS"
  ALL_LIBS=""
  for l in $OLD_LIBS
  do
	SOURCEDIR=""
	case "$l" in
	*.a) 
		Debugf " checking .a library $l "
		SOURCEDIR="$l.dir"
		;;
	-l*) 
		libbase=`echo $l | sed -e "s/-l//" `
		libname="$CHARMLIB/lib$libbase.a"
		Debugf " checking -l library $libname "
		[ -r "$libname" ] && SOURCEDIR="$libname.dir"
		;;
	esac
	
  	REPLACEOBJ=""
	if [ -n "$SOURCEDIR" ]
	then
		Debugf "    searching for .o in $SOURCEDIR "
		if [ -x "$SOURCEDIR" ]
		then
			REPLACEOBJ=`echo $SOURCEDIR/*.o`
		fi
	fi
	
	if [ -n "$REPLACEOBJ" ]
	then
# It is a charm library-- add all the .o's instead of the .a
		Debug "    Found .o: $REPLACEOBJ"
		ALL_LIBS="$ALL_LIBS $REPLACEOBJ"
	else
# It's probably not a charm library-- just keep it 
		ALL_LIBS="$ALL_LIBS $l"
# It's probably not a charm library-- just keep it (if it's not a duplicate!)
#		ALL_LIBS=`AddList $l $ALL_LIBS`
	fi
  done
  
  Debugf "Building shared library: final list of libraries: $ALL_LIBS"
  [ "$MAKE_LDXX" = "1" ] && Do $CMK_LDXX $CMK_LD_SHARED $OPTS_LD $OPTS_LDXX -o $OBJECT $ALL_LIBS
  [ "$MAKE_LD" = "1" ] && Do $CMK_LD $CMK_LD_SHARED $OPTS_LD -o $OBJECT $ALL_LIBS
d1246 5
a1250 1
if [ "$MAKELIBCHARM" = "0" ]
a1251 5
  targ=charmrun$CMK_POST_EXE
  convhost=conv-host$CMK_POST_EXE

  if [ -x $CHARMBIN/$targ ]
  then
d1254 1
a1254 1
  fi
d1256 1
a1256 1
  DoNoErrCheck $RM $modInitSrc $modInitObj > /dev/null 2>&1
d1258 1
a1258 3
  Copyobj

fi
@


1.121
log
@ if no build share is set, exit normally
@
text
@d28 1
d323 5
d1128 10
d1219 1
a1219 1
	MIDDLE_LIBS="$MEM_OBJ $MIDDLE_LIBS"
@


1.120
log
@mistakenly put exit when CMK_NO_BUILD_SHARED is true.
@
text
@d970 5
a974 1
	if [ "$MAKELIBCHARM" = 0 -a "$CHARM_SHARED" = "0" ]
@


1.119
log
@exit normally when CMK_NO_BUILD_SHARE defined
@
text
@a657 1
	End 0
@


1.118
log
@small change
@
text
@d655 1
a655 1
if [ "BUILD_SHARE" = "1" -a -n "$CMK_NO_BUILD_SHARED" ]
d658 1
@


1.117
log
@added new flags into help page.
@
text
@d939 1
a941 1
	Warning "Warning: creating $OBJECT "
@


1.116
log
@now support shared library name whose suffix is other than .so, for example in HP, it used .sl. define CMK_SHARED_SUF conv-machs.
@
text
@d96 1
a96 1
    echo "        -pg <opt>"
d941 1
@


1.115
log
@moved memobj  before -lconv-cplus-y due to the CmiAbort in memobj.
@
text
@d664 1
a664 1
	*.a|*.so)
d901 1
a901 1
	*.o|*.so|*.a)
d967 1
a967 1
*.so)
d988 1
a988 1
	  OBJECT=`echo $OBJECT | sed -e 's/\.a$/.so/'`
@


1.114
log
@when CMK_NO_BUILD_SHARED" is defined, don;t build share lib by default.
@
text
@d69 2
a70 2
CHARM_SHARED=""
BUILD_SHARE=""
d465 1
a465 1
		BUILD_SHARE=true
d471 1
a471 1
		CHARM_SHARED=true
d475 1
a475 1
		BUILD_SHARE=true
d655 1
a655 1
if [ -n "BUILD_SHARE" -a -n "$CMK_NO_BUILD_SHARED" ]
d657 1
a657 1
	BUILD_SHARE=""
d660 1
a660 1
if [ -n "$BUILD_SHARE" ]
d662 1
a662 1
	# ignore BUILD_SHARE is the target is not .a or .so
d668 1
a668 1
		BUILD_SHARE=""
d969 1
a969 1
	if [ "$MAKELIBCHARM" = 0 -a -z "$CHARM_SHARED"  ]
d977 1
a977 1
	if [ -n "$BUILD_SHARE" ]
a1172 7
if [ "$MAKELIBCHARM" = "1" -o -n "$BUILD_SHARE" ]
then
CORE_LIBS="-lconv-core -lconv-util $TRACE_OBJ "
else
CORE_LIBS="-lconv-core -lconv-util $TRACE_OBJ $MEM_OBJ "
fi

d1176 2
d1196 6
a1201 1
if [ -n "$CHARM_SHARED" ] 
d1203 1
a1203 1
  # build linking with charm .so
d1205 1
a1205 1
  if [ -n "$BUILD_SHARE" ]
d1216 1
a1216 1
if [ -n "$BUILD_SHARE" -a -n "$CHARM_SHARED" ]
d1218 1
a1218 1
  # build an applicaiton .so linking wit charm .so
@


1.113
log
@when linking charm .so, use CMK_LD_LIRARY_PATh for rpath.
@
text
@d655 5
@


1.112
log
@change -buildShared to -build-shared  to be consistent with other naming conventions.
@
text
@d1198 2
d1207 1
a1207 1
LANG_LIBS="-L$CHARMLIB -I$CHARMINC $BAL_OBJ $OBJECTFILES $modInitObj $PRE_LIBRARIES"
d1213 1
@


1.111
log
@Major changes:
1. added support for -buildShared: used for internally by Charm build to create all .so.
2. added -charmShared: used for compiling a user so and binary to link charm so instead of .a.
@
text
@d473 1
a473 1
	-charm-so|-buildShared)
@


1.110
log
@to compile charm++ program under bluegene environment, now changes to -language bgcharm++ is not necessary any more.
@
text
@d68 4
d464 3
d470 7
a476 1

d576 1
a643 1
# loading system configuration shell scripts
d650 6
a655 1
if [ "$LANGUAGE" = "charm++" -a -n "$CMK_BLUEGENE" ] 
d657 9
a665 1
	LANGUAGE="bgcharm++"
d792 1
a792 1
	Success
d931 8
d964 1
a964 1
	if [ "$MAKELIBCHARM" = 0 ]
d966 1
a966 5
		Debugf "Running ldro..."
		DoNoErrCheck $RM $OBJECT
		Do $CMK_LD -o $OBJECT $OPTS_LD $OPTS_LDRO $OBJECTFILES \
			$PRE_LIBRARIES $POST_LIBRARIES
		Copyobj
d971 19
d1168 1
a1168 1
if [ "$MAKELIBCHARM" = "1" ]
d1196 9
d1206 1
d1209 9
a1217 2

if [ "$MAKELIBCHARM" = "1" ]
@


1.109
log
@fixed charmc to be able to correctly compile eg. pgms/ampi/Cjacobi3D. The problem is that in the case when -lfoo appears for multiple times, the later -lfoo is ignored which may cause unsatisfied symbols linking error. Changed AddList in charmc to AppendList so that the last -lfoo always be used.
@
text
@d630 1
d635 6
@


1.108
log
@memory-default.o need to be static linked when shared.
@
text
@d224 18
d479 1
a479 1
			POST_LIBRARIES=`AddList $POST_LIBRARIES $arg`
d481 1
a481 1
			PRE_LIBRARIES=`AddList $PRE_LIBRARIES $arg`
@


1.107
log
@mkdir of .dir is done after checking if the dir is present or not.
@
text
@d1094 4
d1099 1
@


1.106
log
@Minor fixes for new dynamic linking scheme.
@
text
@d921 1
a921 1
	DoNoErrCheck mkdir $destDir
@


1.105
log
@Cursory "-makecharmlib" support.
@
text
@d696 1
a696 1
OPTS_LDXX="$OPTS $OPTS_LDXX"
d1160 2
d1163 1
a1163 1
		ALL_LIBS=`AddList $l $ALL_LIBS`
d1168 1
a1168 1
  [ "$MAKE_LDXX" = "1" ] && Do $CMK_LDXX $CMK_LD_SHARED $OPTS_LDXX -o $OBJECT $ALL_LIBS
d1172 1
a1172 1
  [ "$MAKE_LDXX" = "1" ] && Do $CMK_LDXX $OPTS_LDXX -o $OBJECT $ALL_LIBS
@


1.104
log
@Shared library support:
  - Allow .so's to be linked into an executable just like .o's.
  - Allow charmc to spit out a .so, like
       charmc -shared -o foo.so foo.o bar.o
    FIXME: The "-shared" flag should be turned into "-G" on
    some platforms (Suns, IBM SP's.)
  - Rearrange link order so libraries get linked exactly once.
@
text
@d54 1
a54 1
COPIES=""        
d68 2
d395 7
d420 1
a420 1
		COPIES="$1 $COPIES"
d561 2
d565 2
a566 1
	POST_LIBRARIES=`AddList $POST_LIBRARIES -lmodule$M`
d731 6
a736 11
	for COPY in `echo $COPIES`
	do
		if [ "a$COPY" != "a$OBJECT" ] 
		then
			[ -d $COPY ] && COPY="$COPY/"
			if [ "a$PROG_EXT" != "a" -a -r "$OBJECT$PROG_EXT" ] ; then
				Warning "Appending $PROG_EXT to object file name"
				OBJECT="$OBJECT$PROG_EXT"
			fi
			[ ! -d $COPY ] && DoNoErrCheck $RM $COPY 
			Do $CP $OBJECT $COPY
d738 3
a740 1
	done
d905 8
a912 5
	Debugf "Running ldro..."
	DoNoErrCheck $RM $OBJECT
	Do $CMK_LD -o $OBJECT $OPTS_LD $OPTS_LDRO $OBJECTFILES \
		$PRE_LIBRARIES $POST_LIBRARIES
	Copyobj
d915 1
d919 4
a1093 1
LANG_LIBS="-L$CHARMLIB -I$CHARMINC $BAL_OBJ $OBJECTFILES $modInitObj $PRE_LIBRARIES"
d1096 3
d1101 2
a1102 2
	Do $CMK_LDXX $OPTS_LD $OPTS_LDXX -o $OBJECT \
		$LANG_LIBS -lck -lconv-cplus-y $CORE_LIBS -lm $CMK_LIBS $POST_LIBRARIES
d1105 2
a1106 2
	Do $CMK_LD $OPTS_LD -o $OBJECT \
		$LANG_LIBS -lconv-cplus-n $CORE_LIBS -ltrace-converse -lm $CMK_LIBS $POST_LIBRARIES
d1109 2
a1110 3
	Do $CMK_LDXX $OPTS_LD $OPTS_LDXX -o $OBJECT \
		$LANG_LIBS -lconv-cplus-y $CORE_LIBS -ltrace-converse \
		-lm $CMK_LIBS $POST_LIBRARIES
d1117 57
d1179 4
d1184 2
a1185 5
targ=charmrun$CMK_POST_EXE
convhost=conv-host$CMK_POST_EXE

if [ -x $CHARMBIN/$targ ]
then
d1188 1
a1188 2
	[ ! -f $convhost ] && Do $LN -f -s $targ $convhost
fi
d1190 1
d1192 1
a1192 1
DoNoErrCheck $RM $modInitSrc $modInitObj > /dev/null 2>&1
d1194 1
a1194 1
Copyobj
@


1.103
log
@Add "CHARM" define to all source code.  This lets programs easily
tell if they're being built under charm, so, e.g.:

#ifdef CHARM
	CmiAbort("foo.");
#else
	myAbort("foo.");
#endif
@
text
@d206 1
a206 1
    for M in $*
d212 11
d433 1
a433 1
	-L*)
d452 1
a452 1
			POST_LIBRARIES="$POST_LIBRARIES $arg"
d454 1
a454 1
			PRE_LIBRARIES="$PRE_LIBRARIES $arg"
d551 4
d836 1
a836 1
	*.o|*.a)
d885 2
a886 1
	if [ $nFiles -eq 1 -a $nObj -eq 1 ] 
d888 1
a888 10
# One source file, one .o: just move the .o
		if [ $OBJECT != $OBJECTFILES ]
		then
			Debugf "Moving .o to destination"
			DoNoErrCheck $RM $OBJECT
			Do $MV $OBJECTFILES $OBJECT
		fi
	else
# Multiple source files, one .o: make shared library
		Debugf "Running ldro..."
d890 1
a890 1
		Do $CMK_LDRO $OBJECT $OPTS_LD $OPTS_LDRO $OBJECTFILES
d894 8
a947 7
# Add the modules to the link list
LINK_MODULES=""
for module in $MODULES; do
    LINK_MODULES="$LINK_MODULES -lmodule$module"
done
PRE_LIBRARIES="$LINK_MODULES $PRE_LIBRARIES"

d1078 1
a1078 1
CORE_LIBS="$LINK_MODULES -lconv-core -lconv-util $TRACE_OBJ $MEM_OBJ "
d1087 1
a1087 2
		$LANG_LIBS -lconv-cplus-n $CORE_LIBS -ltrace-converse \
		-lm $CMK_LIBS $POST_LIBRARIES
@


1.102
log
@Send all warnings to stderr, not stdout.  This is important
for people that redirect the output of charmc, e.g., to generate
dependencies automatically.
@
text
@d41 1
a41 1
OPTS_CPP=""
@


1.101
log
@Move trace-common.C to be a part of Charm++;
add a new trace-converse.c for when Charm++ is missing.
@
text
@d117 6
a123 1
# ("1>&2" redirects the echo output to stderr).
d126 3
a128 3
	echo "Fatal Error by charmc in directory "`pwd` 1>&2
	echo "   $*" 1>&2
	echo "charmc exiting..." 1>&2
d132 1
d278 1
a278 1
		echo "Warning: -queue currently being ignored."
d419 1
a419 1
		echo "passing unrecognized option $arg to all compilers and linkers"
d455 1
a455 1
		echo "passing unrecognized option $arg to all compilers and linkers"
d710 1
a710 1
				echo "Appending $PROG_EXT to object file name"
d730 1
a730 1
			  echo "Appending .$CMK_MOD_EXT to object file name"
@


1.100
log
@Fixed a bug. Oops...
@
text
@a971 7
# Check for valid choice of BALANCE
if [ "$TRACEMODE" = replay ]
then
	[ "$BALANCE" != replay ] && echo "Ignoring -balance $BALANCE, incompatible with -tracemode replay"
    BALANCE=replay
fi

d1073 2
a1074 1
		$LANG_LIBS -lconv-cplus-n $CORE_LIBS -lm $CMK_LIBS $POST_LIBRARIES
d1078 2
a1079 1
		$LANG_LIBS -lconv-cplus-y $CORE_LIBS -lm $CMK_LIBS $POST_LIBRARIES
@


1.99
log
@moved -lcomm into .dep files for AMPI
@
text
@d240 2
a241 2
		"ampi") AddModules ampi
		"ampif") AddModules ampif
@


1.98
log
@Added -lcomm for building ampi(f).
@
text
@a240 1
			POST_LIBRARIES="$POST_LIBRARIES -lcomm" ;;
a241 1
			 POST_LIBRARIES="$POST_LIBRARIES -lcomm" ;;
@


1.97
log
@Added "conv-config.sh", which wraps "conv-mach.sh" and adds default
values and build-time options.
@
text
@d240 4
a243 2
		"ampi") AddModules ampi ;;
		"ampif") AddModules ampif ;;
@


1.96
log
@Added module .dep files.  These files list the command-line arguments
needed at link time by a particular module.  For example, a library
that depends on some system library libfoo might have a .dep file:
-lfoo

Similarly, a module foo that depends on another module bar might say:
-module bar
in the libmodulefoo.dep file.

The .dep file is currently only looked up for modules, and can only
be one line long (for now).  It also only works for modules in the
system charm/lib/ directory, which is just a bug.

This is intended to replace the bizarre language-specific dependencies
currently used for -language fem/femf/ampi/ampif/mblock/mblockf
@
text
@a574 19
# Load machine-specific defaults:
CMK_C_OPTIMIZE="-O"
CMK_CXX_OPTIMIZE="-O"
CMK_F90_OPTIMIZE="-O"
CMK_C_DEBUG="-g"
CMK_CXX_DEBUG="-g"
CMK_F90_DEBUG="-g"

CMK_CF90_FIXED="none"

if [ -r $CHARMINC/conv-mach-pre.sh ]
then
. $CHARMINC/conv-mach-pre.sh
fi

if [ ! -r $CHARMINC/conv-mach.sh ]
then
	Abort "Can't find conv-mach.sh in $CHARMINC directory."
fi
d577 1
a577 1
. $CHARMINC/conv-mach.sh
d579 2
a580 4
if [ -r $CHARMINC/conv-mach-opt.sh ]
then
. $CHARMINC/conv-mach-opt.sh
fi
d582 1
a582 1
Debug "Read config script, setting vars..."
a593 5
if [ "$CMK_CF90_FIXED" = "none" ]
then
   CMK_CF90_FIXED="$CMK_CF90"
fi

d611 1
a611 1
    CMK_CF90="$CMK_SEQ_F90 -DCMK_SEQUENTIAL=1 " 
d613 2
a614 8
    if [ -n "$CMK_SEQ_AR" ]
    then
      CMK_AR="$CMK_SEQ_AR"
    fi
    if [ -n "$CMK_SEQ_RANLIB" ]
    then
      CMK_RANLIB="$CMK_SEQ_RANLIB"
    fi
d888 46
a933 1
# If the above case returns, we're not creating a .o or .a file--
a934 1

d937 2
a938 1
	Do $CMK_SEQ_LD $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
d942 2
a943 1
	Do $CMK_SEQ_LDXX $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
a1012 43

############ Determine the language and libraries ##########

# Parse out the real languages
case "$LANGUAGE" in
"charm++f")
	LANGUAGE="charm++"
	USE_F90_LIBRARIES="1"
	;;
"f90charm")
        PRE_LIBRARIES="$PRE_LIBRARIES -lf90charm "
        POST_LIBRARIES="$POST_LIBRARIES $CMK_F90LIBS"
	;;
"bluegene")
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene"
	;;
"ckbluegene")
        POST_LIBRARIES="$POST_LIBRARIES -lbluegene"
	;;
"bgcharm++")
        PRE_LIBRARIES="$PRE_LIBRARIES -lconv-bluegene"
	;;
esac
[ -r $CHARMLIB/libconv-utilf.a ] || USE_F90_LIBRARIES="0"

if [ $USE_F90_LIBRARIES = "1" ]
then
	POST_LIBRARIES="$POST_LIBRARIES -lconv-utilf $CMK_F90LIBS"
        if [ ! -z "$CMK_F90OBJS" ] 
        then
          for f90obj in $CMK_F90OBJS
          do
            OBJECTFILES="$OBJECTFILES $CHARMLIB/$f90obj"
          done
        fi
fi

# Add the modules to the link list
LINK_MODULES=""
for module in $MODULES; do
    LINK_MODULES="$LINK_MODULES -lmodule$module"
done
PRE_LIBRARIES="$LINK_MODULES $PRE_LIBRARIES"
@


1.95
log
@Put a second copy of modules *after* -lck, which is
needed for compat_regmm to be found in -module tcharm.
Hopefully, having two copies of all the -modules on the
link line won't cause any other problems...
@
text
@d181 18
d202 1
a202 6
      OK=1
      for i in `echo $MODULES`
      do
        test "$M" = "$i" && OK=0
      done
      test $OK = 1 && MODULES="$MODULES $M"
d221 1
d238 13
a250 2
		LANGUAGE="$1"
		POST_LANGUAGE=1
d462 6
d520 49
a1000 35
IS_F90="n"

# Parse out the pseudo-languages (just libraries, but easier to say)
case "$LANGUAGE" in
"ampi")
	MODULES="$MODULES ampi"
	POST_LIBRARIES="$POST_LIBRARIES -lddt -lmetis"
	LANGUAGE="tcharm"
	;;
"ampif")
	MODULES="$MODULES ampif"
	POST_LIBRARIES="$POST_LIBRARIES -lddt -lmetis"
	LANGUAGE="tcharmf"
	;;
"fem")
	MODULES="$MODULES fem"
	POST_LIBRARIES="$POST_LIBRARIES -lddt -lmetis"
	LANGUAGE="tcharm"
	;;
"femf")
	MODULES="$MODULES fem"
	POST_LIBRARIES="$POST_LIBRARIES -lddt -lmetis"
	LANGUAGE="tcharmf"
	;;
"mblock")
	MODULES="$MODULES mblock"
	POST_LIBRARIES="$POST_LIBRARIES -lddt -lmetis"
	LANGUAGE="tcharm"
	;;
"mblockf")
	MODULES="$MODULES mblock"
	POST_LIBRARIES="$POST_LIBRARIES -lddt -lmetis"
	LANGUAGE="tcharmf"
	;;
esac
a1003 7
"tcharm")
	MODULES="$MODULES tcharm"
	;;
"tcharmf")
	MODULES="$MODULES tcharm"
	USE_F90_LIBRARIES="1"
	;;
a1010 1
#       IS_F90="y"
d1022 1
d1103 1
a1103 1
"charm"|"charm++"|"f90charm"|"tcharm"|"tcharmf"|"ckbluegene"|"bgcharm++")
@


1.94
log
@recent stripExtension change broke namd2 compilation of .ci file! e.g.
charmc src/main.ci became charmxi main.ci and complained no such file.
@
text
@d1062 1
a1062 1
CORE_LIBS="-lconv-core -lconv-util $TRACE_OBJ $MEM_OBJ "
@


1.93
log
@Added "-fortran" link-time option, which allows the use
of f90 libraries in Charm++ code.  In particular, this is
needed by the quantum chem. folks.
@
text
@d743 1
a743 1
		    Do $CHARMBIN/charmxi -f90 $CMK_XIOPTS $BASE.ci
d745 1
a745 1
		    Do $CHARMBIN/charmxi $CMK_XIOPTS $BASE.ci
@


1.92
log
@Bug fix for destination of created object files.

For example,
	gcc -c srcdir/foo.c
produces ./foo.o (NOT srcdir/foo.o), so
	charmc -c srcdir/foo.c
should do the same thing, which means stripping off the
directory path from source files when deciding on .o names.
@
text
@d52 2
a53 1
PRE_LIBRARIES=""    
d351 3
d964 1
a964 2
        POST_LIBRARIES="$POST_LIBRARIES -lconv-utilf $CMK_F90LIBS"
	IS_F90="y"
a966 1
        POST_LIBRARIES="$POST_LIBRARIES -lconv-utilf $CMK_F90LIBS"
d968 1
a968 1
	IS_F90="y"
d986 1
a986 1
if [ $IS_F90 = "y" ]
d988 1
@


1.91
log
@Added language "charm++f", which is just charm++ but with the
Fortran runtime libraries.  This is needed by Charm++ programs
that happen to include a small amount of (serial) fortran.
@
text
@d720 1
a720 1
	BASE=`stripExtention $FILE`
@


1.90
log
@Added CF90_FIXED, for fixed-format f90 source files.
@
text
@d963 5
@


1.89
log
@register module for trace-summary in trace all case.
@
text
@d499 2
d531 5
d553 1
a553 1
    CMK_F90="$CMK_SEQ_F90 -DCMK_SEQUENTIAL=1 " 
d577 1
a577 1
    CMK_F90="$OVERRIDE_F90 $CMK_F90 "
d753 1
a753 1
		Do $CMK_CF90 $OPTS_CPP $OPTS_F90 -I$CHARMINC -c $FILE $DESTO
@


1.88
log
@updated Makefile for new trace-summary.ci, etc.
charmc to register the module.
@
text
@d999 1
a999 1
    if test $trace = "summary"
d1015 1
a1015 1
    if test $trace = "summary"
@


1.87
log
@If conv-mach.sh didn't define CMK_F90_OPTIMIZE, charmc would
silently ignore -O for f90 files.
@
text
@d998 6
d1013 6
@


1.86
log
@Cleaned up command-line option handling, and added
OPTS_CPP to f90 command line.  (f90 runs preprocessor
on files that end in .F or .F90)
@
text
@d491 8
@


1.85
log
@Accept -E, -M, -S, and -P options, which supress the normal
.o output and create various bizarre preprocessor or
assembler outputs.  -M is needed by the Rocket center codes.
@
text
@a39 4
#Compiler-only options
OPTSC=""
#Linker-only options
OPTSL=""
d379 2
a380 7
	-D*)
		OPTSC="$OPTSC $arg"
		;;

	-I*)
		OPTSC="$OPTSC $arg"
		OPTS_F90="$OPTS_F90 $arg"
d385 1
a385 1
		OPTSC="$OPTSC  $arg"
d388 1
a388 1
		OPTSL="$OPTSL $arg"
d413 1
a413 1
		OPTSL="$OPTSL   $arg"
d592 2
a593 1
OPTSC="$OPTS $OPTSC"
d595 2
a596 1
OPTSL="$OPTS $OPTSL"
d689 1
a689 1
	Do $CMK_CPP_C $OPTSC $OPTS_CPP -I$CHARMINC $TMP.c > $TMP.i
d730 1
a730 1
		Do $CMK_CC $OPTSC $OPTS_CC -I$CHARMINC -c $FILE $DESTO
d734 1
a734 1
		Do $CMK_CXX $OPTSC $OPTS_CXX -I$CHARMINC -c $FILE $DESTO
d738 1
a738 1
		Do $CMK_CF90 $OPTS_F90 -I$CHARMINC -c $FILE $DESTO
d742 1
a742 1
		Do $CMK_CF90 $OPTS_F90 -I$CHARMINC -c $FILE $DESTO
d810 1
a810 1
		Do $CMK_LDRO $OBJECT $OPTSL $OPTS_LDRO $OBJECTFILES
d826 1
a826 1
	Do $CMK_SEQ_LD $OPTSL $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
d830 1
a830 1
	Do $CMK_SEQ_LDXX $OPTSL $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
d1016 1
a1016 1
Do $CMK_CXX $OPTSC $OPTS_CXX -c $modInitSrc -o $modInitObj
d1031 1
a1031 1
	Do $CMK_LDXX $OPTSL $OPTS_LDXX -o $OBJECT \
d1035 1
a1035 1
	Do $CMK_LD $OPTSL $OPTS_LD -o $OBJECT \
d1039 1
a1039 1
	Do $CMK_LDXX $OPTSL $OPTS_LDXX -o $OBJECT \
@


1.84
log
@Eliminate compiler warnings on net-linux and O2k.
@
text
@d32 1
d164 4
d354 5
a358 1

d720 6
d737 2
a738 2
		Do $CMK_CC $OPTSC $OPTS_CC -I$CHARMINC -c $FILE -o $BASE.o
		NU_OBJ=$BASE.o
d741 2
a742 2
		Do $CMK_CXX $OPTSC $OPTS_CXX -I$CHARMINC -c $FILE -o $BASE.o
		NU_OBJ=$BASE.o
d745 2
a746 2
		Do $CMK_CF90 $OPTS_F90 -I$CHARMINC -c $FILE -o $BASE.o
		NU_OBJ=$BASE.o
d749 2
a750 1
		Do $CMK_CF90 $OPTS_F90 -I$CHARMINC -c $FILE -o $BASE.o
d790 1
a790 1
if [ -z "$OBJECT" ] 
d792 2
a793 1
# We have no target object-- just end
d801 1
d806 1
d809 1
d814 2
@


1.83
log
@Fixed Fortran90 versionof AMPI-> MPI change.
@
text
@a390 4
	"-pg"|"-g")
		OPTS="$OPTS $arg"
		;;

a394 4
	-O*)
		OPTS="$OPTS $arg"
		;;

d397 4
@


1.82
log
@Update so that arguments are passed to "createTrace" modules
@
text
@d934 1
a934 1
        POST_LIBRARIES="$POST_LIBRARIES $CMK_F90LIBS"
@


1.81
log
@Not all compilers (e.g., Absoft) support -freeform, so if
it's really needed it should be put in conv-mach.sh.
@
text
@d984 1
a984 1
echo "void _registerExternalModules(void) {" >> $modInitSrc
d997 1
a997 1
echo "void _createTraces(void) {" >> $modInitSrc
d1000 2
a1001 2
    echo "extern void _createTrace$trace();" >> $modInitSrc
    echo "_createTrace$trace();" >> $modInitSrc
@


1.80
log
@trace mode can be multiple now.
@
text
@d734 1
a734 1
		Do $CMK_CF90 $OPTS_F90 -freeform -I$CHARMINC -c $FILE -o $BASE.o
@


1.79
log
@add bgcharm++ as language.
@
text
@d25 2
a26 1
TRACEMODE="none"
d255 1
a255 1
		TRACEMODE="$1"
d838 1
a838 1
[ -r $CHARMLIB/libtrace-none.a ] || Abort "trace libraries not installed.  Is Charm++ built properly?"
d840 7
a846 2
[ ! -r "$CHARMLIB/libtrace-$TRACEMODE.a" ] && Abort "charmc : No such tracemode $TRACEMODE"
TRACE_OBJ="-ltrace-$TRACEMODE"
d995 10
@


1.78
log
@in moduleinit.C, remove include charm++.h, so converse program can be compiled.
@
text
@d849 5
d942 3
d1003 1
a1003 1
"charm"|"charm++"|"f90charm"|"tcharm"|"tcharmf"|"ckbluegene")
@


1.77
log
@build now take --libdir and --incdir which are user defined directories that override default ones in conv-mach-*.sh.
@
text
@a961 1
echo "#include \"charm++.h\"" >> $modInitSrc
d965 5
a977 1
    echo "  extern void Create$BALANCER();" >> $modInitSrc
d981 1
a981 1
Do $CMK_CXX $OPTSC -I$CHARMINC $OPTS_CXX -c $modInitSrc -o $modInitObj
@


1.76
log
@move moduleinit after objfiles.
@
text
@d494 5
@


1.75
log
@added verbose for -balancer.
@
text
@d983 1
a983 1
LANG_LIBS="$modInitObj -L$CHARMLIB -I$CHARMINC $BAL_OBJ $OBJECTFILES $PRE_LIBRARIES"
@


1.74
log
@add -balancer for charmc, and -balancer for runtime.
In LBDatabase, use registry table to maintain all available load balancers.
in all *LB, lbinit don't create load balancer, but register to the LBDatabase instead.
@
text
@a226 1
#		MODULES="$MODULES `echo $1 | sed -e 's/,/ /g'`"
d968 1
a968 1
    echo 
@


1.73
log
@Added direct support for link-time modules.  To make your
Charm++ library "foo" linkable with "-module foo", name the
central .ci file's module "foo" and name your output file
"libmodulefoo.a".  Your library's initcalls, readonlys, entry
points, chares, etc. will be automatically registered at
charm init time.

The registration is done by building a tiny "moduleinit.C"
file right here in charmc.  The file includes calls to all
the current "-module" initializations and gets called from
Charm++'s init.C.

This allows many of what used to be xenophobic languages
(AMPI, FEM, Mblock) to become cosmopolitan libraries.
The old -language options are still supported for backward
compatability.
@
text
@d58 1
d178 12
d227 9
a235 1
		MODULES="$MODULES `echo $1 | sed -e 's/,/ /g'`"
d958 1
d967 6
d974 1
a974 1
Do $CMK_CXX $OPTSC $OPTS_CXX -c $modInitSrc -o $modInitObj
@


1.72
log
@AMPILIB is now all capitals.
@
text
@d57 1
d84 1
d213 5
a594 9
"charm"|"charm++"|"converse"|"converse++")
	[ -z "$SEQUENTIAL" ] || Abort "Language $LANGUAGE is for parallel programs"
	;;
"fem"|"femf"|"ampi"|"ampif"|"mblock"|"mblockf"|"f90charm"|"bluegene"|"ckbluegene")
	[ -z "$SEQUENTIAL" ] || Abort "Language $LANGUAGE is for parallel programs"
	;;
*)
	Abort "Unrecognized choice of language $LANGUAGE"
	;;
d814 2
a815 3
TRACE_OBJ="$CHARMLIB/libtrace-$TRACEMODE.a"
[ ! -r $TRACE_OBJ ] && Abort "charmc : No such tracemode $TRACEMODE"

d854 1
a854 10


###############################################################################
#
#                               Finally, LINK
#
###############################################################################

Debug "About to perform final link..."

d857 1
d860 3
a862 2
        PRE_LIBRARIES="$PRE_LIBRARIES -lAMPI -lddt "
        POST_LIBRARIES="$POST_LIBRARIES -lmetis"
d865 3
a867 3
        PRE_LIBRARIES="$PRE_LIBRARIES -lAMPIF -lddt -lconv-utilf "
        POST_LIBRARIES="$POST_LIBRARIES -lmetis $CMK_F90LIBS"
	IS_F90="y"
d870 3
a872 2
        PRE_LIBRARIES="$PRE_LIBRARIES -lfem  -lcollide -lAMPILIB -lddt "
        POST_LIBRARIES="$POST_LIBRARIES -lmetis "
d875 3
a877 3
        PRE_LIBRARIES="$PRE_LIBRARIES -lfemf -lcollide -lAMPILIB -lddt -lconv-utilf"
        POST_LIBRARIES="$POST_LIBRARIES -lmetis $CMK_F90LIBS"
	IS_F90="y"
d880 3
a882 2
        PRE_LIBRARIES="$PRE_LIBRARIES -lfem -lddt "
        POST_LIBRARIES="$POST_LIBRARIES -lmetis "
d885 14
a898 2
        PRE_LIBRARIES="$PRE_LIBRARIES -lmblockf -lddt"
        POST_LIBRARIES="$POST_LIBRARIES -lmetis $CMK_F90LIBS"
d925 32
a956 1
LANG_LIBS="-L$CHARMLIB -I$CHARMINC $BAL_OBJ $OBJECTFILES $PRE_LIBRARIES"
d960 1
a960 1
"charm"|"charm++"|"f90charm"|"ampi"|"ampif"|"fem"|"femf"|"mblock"|"mblockf"|"ckbluegene")
d972 3
d993 3
d997 1
@


1.71
log
@Even C++ fem version depends on ampilib, etc.
@
text
@d880 1
a880 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lfem  -lcollide -lampilib -lddt "
@


1.70
log
@Added the proportion map object. It is a counterpart of round robin map object
for heterogeneous clusters. Also, changled al libampi*.a to libAMPI*.a,
because on myrinet clusters, a libampi.a already exists which clashes with
adaptive MPI.
@
text
@d880 1
a880 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lfem -lddt "
@


1.69
log
@Added mblock framework and Fortran debugging support.
@
text
@d871 1
a871 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lampi -lddt "
d875 1
a875 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lampif -lddt -lconv-utilf "
d884 1
a884 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lfemf -lcollide -lampilib -lddt -lconv-utilf"
@


1.68
log
@Added -lampilib and -lcollide to -language fem targets.
@
text
@d564 1
d591 1
a591 1
"fem"|"femf"|"ampi"|"ampif"|"f90charm"|"bluegene"|"ckbluegene")
d867 2
d877 1
a877 7
        if [ ! -z "$CMK_F90OBJS" ] 
        then
          for f90obj in $CMK_F90OBJS
          do
            OBJECTFILES="$OBJECTFILES $CHARMLIB/$f90obj"
          done
        fi
d886 10
a895 7
        if [ ! -z "$CMK_F90OBJS" ] 
        then
          for f90obj in $CMK_F90OBJS
          do
            OBJECTFILES="$OBJECTFILES $CHARMLIB/$f90obj"
          done
        fi
d900 1
a900 7
#        if [ ! -z "$CMK_F90OBJS" ] 
#        then
#          for f90obj in $CMK_F90OBJS
#          do
#            OBJECTFILES="$OBJECTFILES $CHARMLIB/$f90obj"
#          done
#        fi
d910 11
d925 1
a925 1
"charm"|"charm++"|"f90charm"|"ampi"|"ampif"|"fem"|"femf"|"ckbluegene")
@


1.67
log
@Added f90_modinc option, to control the flag passed to the f90 compiler
to specify the include path for modules. Also, made absoft compilers
default for linux.
@
text
@d887 1
a887 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lfemf -lddt -lconv-utilf"
@


1.66
log
@Added support for "-memory" link-time flag.
The current options are:
"-memory os": use OS-builtin malloc (which better be interrupt- and
thread- safe).

"-memory gnu": use GNU libc allocator (if it compiled)

"-memory verbose": use GNU, but print every allocation/free with CmiPrintf.

"-memory paranoid": use GNU, be extensively check everything.
@
text
@d492 7
d501 1
a501 1
    CMK_CF90="$CMK_CF90 -M$CHARMINC "
@


1.65
log
@Some f90 compilers do not recognize -D* options. In any case, they are not
needed in f90 compilation, because invoking cpp is not a standard behavior
of any f90 compiler. Now charmc does not pass -D* to f90.
@
text
@d24 3
a26 3
BALANCE=""
MEMORY=""
TRACEMODE=""
d81 4
a84 3
    echo "        -machine <mach> -seq -langage <lang> -balance"
    echo "        -tracemode <mode> -verbose -save -purify -cp"
    echo "        -use-reliable-cc -use-fastest-cc -gen-cpm <new gen>"
d222 1
a222 1
		echo "Warning: -memory currently being ignored."
d806 1
a806 1
[ -r $CHARMLIB/libtrace-none.a ] || Abort "trace libraries not installed."
d808 2
a809 3
[ -z "$TRACEMODE" ] && TRACEMODE="none"

[ ! -r $CHARMLIB/libtrace-$TRACEMODE.a ] && Abort "charmc : No such tracemode $TRACEMODE"
a812 3

[ -z "$BALANCE" ] && BALANCE=rand

d842 9
d910 1
a910 1
CORE_LIBS="-lconv-core -lconv-util -ltrace-$TRACEMODE"
@


1.64
log
@added conv-mach-opt.h and conv-mach-opt.sh.
@
text
@d345 1
a345 1
	-D*|-I*)
d349 5
d701 1
a701 1
		Do $CMK_CF90 $OPTSC $OPTS_F90 -freeform -I$CHARMINC -c $FILE -o $BASE.o
d705 1
a705 1
		Do $CMK_CF90 $OPTSC $OPTS_F90 -I$CHARMINC -c $FILE -o $BASE.o
@


1.63
log
@looks like cp -p is supported on all platforms, so make it default.
@
text
@d469 5
@


1.62
log
@reads CMK_CP which defines the CP in conv-mach.sh
@
text
@d15 1
a15 1
CP="cp"
a469 5

if [ -n "$CMK_CP" ]
then
	CP="$CMK_CP"
fi
@


1.61
log
@Merged structured dagger translator with charmxi.
@
text
@d471 5
@


1.60
log
@Merged the CDep class code from CDep.C file to CDep.h and removed CDep.C.
Thus, now all the system code needed for Structured Dagger is in header
files only. This removed the need for a separate library libsdag.a,
and thus, the Makefile target sdag and the "language" sdag recognized by
charmc are not needed as well.
@
text
@a681 3
	*.sdag)
		Do $CHARMBIN/sdagx $BASE.sdag
		;;
@


1.59
log
@Added sdag to the list of languages recognized by charmc.
@
text
@d569 1
a569 1
"charm"|"charm++"|"converse"|"converse++"|"sdag")
a893 3
"sdag")
        POST_LIBRARIES="$POST_LIBRARIES -lsdag"
	;;
d900 1
a900 1
"charm"|"charm++"|"sdag"|"f90charm"|"ampi"|"ampif"|"fem"|"femf"|"ckbluegene")
@


1.58
log
@converse bluegene has to link against conv-cplus-y, like converse++.
@
text
@d569 1
a569 1
"charm"|"charm++"|"converse"|"converse++")
d894 3
d903 1
a903 9
"charm"|"charm++")
	Do $CMK_LDXX $OPTSL $OPTS_LDXX -o $OBJECT \
		$LANG_LIBS -lck -lconv-cplus-y $CORE_LIBS -lm $CMK_LIBS $POST_LIBRARIES
	;;
"f90charm")
	Do $CMK_LDXX $OPTSL $OPTS_LDXX -o $OBJECT \
		$LANG_LIBS -lck -lconv-cplus-y $CORE_LIBS -lm $CMK_LIBS $POST_LIBRARIES
	;;
"ampi"|"ampif"|"fem"|"femf"|"ckbluegene")
@


1.57
log
@add libconv-bluegene.a in Makefile, and updated charmc with -language bluegene.
@
text
@d912 1
a912 1
"converse"|"bluegene")
d916 1
a916 1
"converse++")
@


1.56
log
@f90charm doesn't need F90_OBJS.
@
text
@d572 1
a572 1
"fem"|"femf"|"ampi"|"ampif"|"f90charm"|"bluegene")
d889 3
d908 1
a908 1
"ampi"|"ampif"|"fem"|"femf"|"bluegene")
d912 1
a912 1
"converse")
@


1.55
log
@Made paths relative for Win32 support.  Relative paths are needed
because Cygwin uses its own root directory as "/" when you type
"pwd"-- thus these paths are invalid when you call a non-Cygwin
program like the Visual C++ compiler. Relative paths, which never
refernce the root directory, work fine.
@
text
@d880 7
a886 7
        if [ ! -z "$CMK_F90OBJS" ] 
        then
          for f90obj in $CMK_F90OBJS
          do
            OBJECTFILES="$OBJECTFILES $CHARMLIB/$f90obj"
          done
        fi
@


1.54
log
@Fixed an error which caused charmc to remove base.o even for files
such as base.ci and base.M.
@
text
@d163 7
a169 7
#	echo "CHARMBIN=$CHARMBIN"
#	echo "CHARMINC=$CHARMINC"
#	echo "CHARMLIB=$CHARMLIB"
#	echo "FILES=$FILES"
#	echo "DELETE=$DELETE"
#	echo "OBJECT=$OBJECT"
#	echo "LANGUAGE=$LANGUAGE"
d418 1
a418 2
	cd $CHARMBIN
	CHARMBIN=`pwd`
d452 2
a453 23
if [ -n "$MACHTYPE" ]
then
    if [ -d $CHARMBIN/../../$MACHTYPE/bin ]
    then
		cd $CHARMBIN/../../$MACHTYPE/bin
		CHARMBIN=`pwd`
    else
        Abort "there is no installed charm for $MACHTYPE in $CHARMBIN"
    fi
fi

if [ -z "$CHARMLIB" ]
then
	cd $CHARMBIN/../lib
	CHARMLIB=`pwd`
fi
if [ -z "$CHARMINC" ]
then
	cd $CHARMBIN/../include
	CHARMINC=`pwd`
fi

cd $ORIGDIR
@


1.53
log
@Removed -lck from converse and converse++ linking.
@
text
@d689 1
a689 1
	if [ "$FILE_EXT" != ".o" ]
@


1.52
log
@incorporated f90charm into Makefile and charmc(-language f90charm)
@
text
@d591 1
a591 1
"charm"|"charm++"|"converse"|"converse++"|"idl")
a703 3
	*.idl)
		Do $CHARMBIN/charmidl $BASE.idl
		;;
d915 1
a915 1
LANG_LIBS="-L$CHARMLIB -I$CHARMINC $BAL_OBJ $OBJECTFILES $PRE_LIBRARIES -lck $POST_LIBRARIES"
d921 1
a921 1
		$LANG_LIBS -lconv-cplus-y $CORE_LIBS -lm $CMK_LIBS
d925 1
a925 5
		$LANG_LIBS -lconv-cplus-y $CORE_LIBS -lm $CMK_LIBS
	;;
"idl")
	Do $CMK_LDXX $OPTSL $OPTS_LDXX -o $OBJECT \
		$LANG_LIBS -lconv-cplus-y $CORE_LIBS -lidl -lm $CMK_LIBS
d929 1
a929 1
		$LANG_LIBS -lconv-cplus-y $CORE_LIBS -lm $CMK_LIBS
d933 1
a933 1
		$LANG_LIBS -lconv-cplus-n $CORE_LIBS -lm $CMK_LIBS
d937 1
a937 1
		$LANG_LIBS -lconv-cplus-y $CORE_LIBS -lm $CMK_LIBS
@


1.51
log
@Added bluegene emulator sources and test programs.
Added "bluegene" as a language known to charmc.
Makefile now has a target called bluegene.
Added preliminary bluegene documentation.
(copied from Arun's webpage.)
@
text
@d903 1
a903 1
        PRE_LIBRARIES="$PRE_LIBRARIES lib/libmain.a "
@


1.50
log
@some minor change to make it neat.
@
text
@d594 1
a594 1
"fem"|"femf"|"ampi"|"ampif"|"f90charm")
d913 3
d934 1
a934 1
"ampi"|"ampif"|"fem"|"femf")
@


1.49
log
@missing cygwin support in modified charmc. define CMK_POST_EXE in conv-mach.sh
fix 'ln' charmrun to conv-host program on net-sol-cc, ln -f doesn't work if conv-host exists.
@
text
@d958 1
a958 1
	if [ ! -f $conv-host ]; then Do $LN -f -s $targ $conv-host; fi
@


1.48
log
@Only "ln -s" gives an error if the file already exists. Changed
it to "ln -f -s".
@
text
@d951 2
a952 2
Postfix=
targ=charmrun$POST_EXT
d958 1
a958 1
	Do $LN -f -s $targ conv-host$POST_EXE
@


1.47
log
@Renamed conv-host charmrun; added test for script conv-host.
@
text
@d669 1
a669 1
	Do $LN -s $FILE $TMP.c
d958 1
a958 1
	Do $LN -s $targ conv-host$POST_EXE
@


1.46
log
@OSTYPE not avaible when starting a cron job, fix it.
@
text
@d65 1
a65 1
IS_WINDOWS=""
d449 2
a450 1
	IS_WINDOWS="true"
d617 3
a619 6
			if [ -n "$IS_WINDOWS" ] ; then
				if [ -r "$OBJECT.exe" ] ; then
# Object is (probably) an executable-- append
				echo "Appending .exe to object file name"
				OBJECT="$OBJECT.exe"
				fi
d952 1
a952 1
test "$OSTYPE" = cygwin && Postfix='.exe'
d954 1
a954 1
if [ -x $CHARMBIN/conv-host${Postfix} ]
d956 3
a958 2
	DoNoErrCheck $RM conv-host${Postfix}
	Do $CP $CHARMBIN/conv-host${Postfix} conv-host${Postfix}
@


1.45
log
@adding .exe in case of cygwin
@
text
@d954 1
a954 1
test $OSTYPE = cygwin && Postfix='.exe'
@


1.44
log
@Added "OPTS" variable, for things like "-g" that must be passed to every compiler.
@
text
@d953 4
a956 1
if [ -x $CHARMBIN/conv-host ]
d958 2
a959 2
	DoNoErrCheck $RM conv-host
	Do $CP $CHARMBIN/conv-host conv-host
@


1.43
log
@Better support for F90 in charmc. Also, fixed the semantics of persistent
communication in AMPI. TODO: Improve the efficiency of persistent comms in
AMPI.
@
text
@d36 7
d49 2
a50 1
OPTS_LDXX=""  
d61 1
a61 2
GENCPM=""     
DEBUG_MODE=""
d345 2
a346 12
	-D*)
		OPTS_CPP="$OPTS_CPP $arg"
		OPTS_CC="$OPTS_CC  $arg"
		OPTS_CXX="$OPTS_CXX $arg"
		OPTS_F90="$OPTS_F90 $arg"
		;;

	-I*)
		OPTS_CPP="$OPTS_CPP $arg"
		OPTS_CC="$OPTS_CC  $arg"
		OPTS_CXX="$OPTS_CXX $arg"
		OPTS_F90="$OPTS_F90 $arg"
d351 1
a351 4
		OPTS_CPP="$OPTS_CPP  $arg"
		OPTS_CC="$OPTS_CC   $arg"
		OPTS_CXX="$OPTS_CXX  $arg"
		OPTS_F90="$OPTS_F90  $arg"
d354 1
a354 3
		OPTS_LDRO="$OPTS_LDRO $arg"
		OPTS_LD="$OPTS_LD   $arg"
		OPTS_LDXX="$OPTS_LDXX $arg"
d357 2
a358 2
	"-g")
		DEBUG_MODE=true
d365 4
a372 14
	"-pg")
		OPTS_CC="$OPTS_CC $arg"
		OPTS_CXX="$OPTS_CXX $arg"
		OPTS_F90="$OPTS_F90 $arg"
		OPTS_LD="$OPTS_LD $arg"
		OPTS_LDXX="$OPTS_LDXX $arg"
		;;

	-O*)
		OPTS_CC="$OPTS_CC $arg"
		OPTS_CXX="$OPTS_CXX $arg"
		OPTS_F90="$OPTS_F90 $arg"
		;;

d383 1
a383 2
		OPTS_LD="$OPTS_LD   $arg"
		OPTS_LDXX="$OPTS_LDXX $arg"
d391 1
a391 7
		OPTS_CPP="$OPTS_CPP  $arg"
		OPTS_CC="$OPTS_CC   $arg"
		OPTS_CXX="$OPTS_CXX  $arg"
		OPTS_F90="$OPTS_F90  $arg"
		OPTS_LD="$OPTS_LD   $arg"
		OPTS_LDXX="$OPTS_LDXX $arg"
		OPTS_LDRO="$OPTS_LDRO $arg"
d554 1
a554 9
Debug "set 3"
if [ -n "$DEBUG_MODE" ]
then
    OPTS_CC="$CMK_C_DEBUG $OPTS_CC"
    OPTS_CXX="$CMK_CXX_DEBUG $OPTS_CXX"
    OPTS_F90="$CMK_F90_DEBUG $OPTS_F90"
    OPTS_LD="$CMK_C_DEBUG $OPTS_LD"
    OPTS_LDXX="$CMK_CXX_DEBUG $OPTS_LDXX"
fi
d565 3
d672 1
a672 1
	Do $CMK_CPP_C $OPTS_CPP -I$CHARMINC $TMP.c > $TMP.i
d713 1
a713 1
		Do $CMK_CC $OPTS_CC -I$CHARMINC -c $FILE -o $BASE.o
d717 1
a717 1
		Do $CMK_CXX $OPTS_CXX -I$CHARMINC -c $FILE -o $BASE.o
d721 1
a721 1
		Do $CMK_CF90 $OPTS_F90 -freeform -I$CHARMINC -c $FILE -o $BASE.o
d725 1
a725 1
		Do $CMK_CF90 $OPTS_F90 -I$CHARMINC -c $FILE -o $BASE.o
d786 1
a786 1
		Do $CMK_LDRO $OBJECT $OPTS_LDRO $OBJECTFILES
d802 1
a802 1
	Do $CMK_SEQ_LD $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
d806 1
a806 1
	Do $CMK_SEQ_LDXX $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $PRE_LIBRARIES $CMK_SEQ_LIBS $POST_LIBRARIES
d922 1
a922 1
	Do $CMK_LDXX $OPTS_LDXX -o $OBJECT \
d926 1
a926 1
	Do $CMK_LDXX $OPTS_LDXX -o $OBJECT \
d930 1
a930 1
	Do $CMK_LDXX $OPTS_LDXX -o $OBJECT \
d934 1
a934 1
	Do $CMK_LDXX $OPTS_LDXX -o $OBJECT \
d938 1
a938 1
	Do $CMK_LD $OPTS_LD -o $OBJECT \
d942 1
a942 1
	Do $CMK_LDXX $OPTS_LDXX -o $OBJECT \
@


1.42
log
@Added upcase conversion for module names.
@
text
@d33 1
d40 1
d259 5
d294 5
d342 1
d349 1
d357 1
d380 1
d388 1
d413 1
d537 1
d559 5
d584 1
d593 1
d751 1
a751 1
		Do $CMK_CF77 -I$CHARMINC -c $FILE -o $BASE.o
d754 2
a755 5
	*.f90)
		Do $CMK_CF90 -I$CHARMINC -c $BASE.f90 -o $BASE.o
		;;
	*.F90)
		Do $CMK_CF90 -I$CHARMINC -c $BASE.F90 -o $BASE.o
@


1.41
log
@Added targets for libconv-utilf.a, a fortran library for converse
utilities such as pup. Modified charmc to recognize fortran module files,
and to deal with differences among f90 compilers regarding location for modules.
@
text
@d640 3
@


1.40
log
@Added targets for libconv-util.a, which is made before converse. Also,
added it to every link command in charmc. Moved pup_*.o and ckhashtable.o
into libconv-util.a (earlier it was in ck.a)
@
text
@d46 1
d316 5
d509 5
d634 17
d737 5
d879 2
a880 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lampi -lddt"
d883 2
a884 2
        PRE_LIBRARIES="$PRE_LIBRARIES -lampif -lddt"
        POST_LIBRARIES="$POST_LIBRARIES $CMK_F90LIBS"
d894 2
a895 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lfem -lddt -lmetis"
d898 2
a899 2
        PRE_LIBRARIES="$PRE_LIBRARIES -lfemf -lddt -lmetis"
        POST_LIBRARIES="$POST_LIBRARIES $CMK_F90LIBS"
d909 1
a909 1
        PRE_LIBRARIES="$PRE_LIBRARIES lib/libmain.a"
@


1.39
log
@Added f90objs to all the fortran-based languages.
@
text
@d887 1
a887 1
CORE_LIBS="-lconv-core -ltrace-$TRACEMODE"
@


1.38
log
@chamrc is made to pass -DCMK_SEQUENTIAL=1 to all the compilers when -seq
option is given. This is so that the programs (or libraries) know which
functions (CkPrintf/printf etc.) to use.
@
text
@d851 7
d860 1
a860 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lfem -lmetis"
d863 1
a863 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lfemf -lmetis"
d865 7
d876 7
a928 14














@


1.37
log
@Added -lmetis to -language fem and femf.
@
text
@d505 1
a505 1
    CMK_CC="$CMK_SEQ_CC"
d507 1
a507 1
    CMK_CXX="$CMK_SEQ_CXX" 
@


1.36
log
@Modified the -language femf option to link in libfemf.a instead of
libfem.a.
@
text
@d853 1
a853 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lfem"
d856 1
a856 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lfemf"
@


1.35
log
@Added ability to use CMK_SEQ_AR (if specified in conv-mach.sh) for making
sequential libraries.
@
text
@d856 1
a856 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lfem"
@


1.34
log
@Added -lddt to ampi link line.
@
text
@d509 8
@


1.33
log
@Added fem and femf as "languages" in order to have cross-platform
makefile compatibility.
@
text
@d838 1
a838 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lampi"
d841 1
a841 1
        PRE_LIBRARIES="$PRE_LIBRARIES -lampif"
@


1.32
log
@Fixed a nasty bug in charmc regarding the -cp option. It used to append
the name provided to -o flag to the directory provided to the -cp flag.
Thus, -o ../pgm -cp ../bin options meant that the pgm would be copied to
../bin/.., which is not the expected behavior. This fix correctly copies
pgm to ../bin.
@
text
@d575 4
a578 1
"charm"|"charm++"|"converse"|"converse++"|"idl"|"ampi"|"ampif"|"f90charm")
d840 11
d853 1
a853 1
        POST_LIBRARIES="$POST_LIBRARIES -lfsu -lsunmath"
d873 1
a873 3
"ampi")
        echo language: $LANG_LIBS
	echo objects: $OBJECT
a875 4
	;;
"ampif")
	Do $CMK_LDXX $OPTS_LDXX -o $OBJECT \
		$LANG_LIBS -lconv-cplus-y $CORE_LIBS -lampif -lm $CMK_LIBS
@


1.31
log
@changed Makefile to compile irecvlibs
changed charmc to place the ampi properly when linking
@
text
@d597 1
a597 1
			[ -d $COPY ] && COPY="$COPY/$OBJECT"
a602 1
				COPY="$COPY.exe"
d605 1
a605 1
			DoNoErrCheck $RM $COPY 
@


1.30
log
@Added support for .F90 files.  (same as .f90 files.)
Added support for -language f90charm, the Fortran90 on Charm stuff.
@
text
@d834 10
d854 1
a854 1
		lib/libmain.a -lfsu -lsunmath $LANG_LIBS -lconv-cplus-y $CORE_LIBS -lm $CMK_LIBS
d861 2
d864 1
a864 1
		$LANG_LIBS -lconv-cplus-y $CORE_LIBS -lampi -lm $CMK_LIBS
@


1.29
log
@Added -rpath support (specifying dll load path).
@
text
@d575 1
a575 1
"charm"|"charm++"|"converse"|"converse++"|"idl"|"ampi"|"ampif")
d662 6
a667 1
		Do $CHARMBIN/charmxi $CMK_XIOPTS $BASE.ci
d690 3
d841 4
@


1.28
log
@Added support for -LANG option on Origin2000 C++ compiler.
@
text
@d296 5
@


1.27
log
@Added ampi directory in langs, ampi target to Makefile, ampi and ampif
-language options to charmc. Made thisArray protected in ArrayElement.
@
text
@d327 6
@


1.26
log
@Split user-specified libraries into pre and post libraries based on
whether they were seen before -language or after. These libraries are then
inserted before and after the CK libraries respectively.
@
text
@d564 1
a564 1
"charm"|"charm++"|"converse"|"converse++"|"idl")
d826 8
@


1.25
log
@Changed -e to -r or -x where appropriate.
@
text
@d42 3
a45 1
LIBRARIES=""    
d196 1
d358 6
a363 1
		LIBRARIES="$LIBRARIES $arg"
d744 1
a744 1
	Do $CMK_SEQ_LD $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $LIBRARIES $CMK_SEQ_LIBS
d748 1
a748 1
	Do $CMK_SEQ_LDXX $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $LIBRARIES $CMK_SEQ_LIBS
d815 1
a815 1
LANG_LIBS="-L$CHARMLIB -I$CHARMINC $BAL_OBJ $OBJECTFILES $LIBRARIES -lck"
@


1.24
log
@Added a ".exe" check to the -cp section.
Only happens if IS_WINDOWS is set.
This lets us compile under Cygwin in Windows.
@
text
@d759 1
a759 1
[ -e $CHARMLIB/libtrace-none.a ] || Abort "trace libraries not installed."
d763 1
a763 1
[ ! -e $CHARMLIB/libtrace-$TRACEMODE.a ] && Abort "charmc : No such tracemode $TRACEMODE"
d788 1
a788 1
if [ ! -e "$BAL_OBJ" ]
d835 1
a835 1
if [ -e $CHARMBIN/conv-host ]
@


1.23
log
@Fixed charmc for bourne shell that does not support -e test.
Fixed Makefile for passing absolute path to conv-mach.sh instead
of depending on . to be included in path.
@
text
@d53 1
d428 5
a432 1
Debug "Found charmbin..."
d464 1
a464 1
if [ ! -r "$CHARMINC/conv-mach.sh" ]
d579 8
d755 1
a755 1
Debug "About to check TRACEMODE=$TRACEMODE..."
d759 1
a759 3
[ -r "$CHARMLIB/libtrace-none.a" ] || Abort "trace libraries not installed."

Debug "trace libraries exist..."
d763 1
a763 3
Debug "trace $TRACEMODE selected.."

[ ! -r "$CHARMLIB/libtrace-$TRACEMODE.a" ] && Abort "charmc : No such tracemode $TRACEMODE"
a764 1
Debug "About to check BALANCE=$BALANCE..."
a775 2
Debug "About to get extension..."

a778 3

Debug "got extension=$BAL_EXT ..."

d788 1
a788 1
if [ ! -r "$BAL_OBJ" ]
d835 1
a835 1
if [ -x $CHARMBIN/conv-host ]
@


1.22
log
@Charmc is now in the Bourne Shell.
Feature change:
	No longer recursively searches soft
links for its bin directory.  This means
you cannot just soft-link charmc into
some random directory and run it from there--
it *must* be run from the platform bin directory.
@
text
@d427 2
d459 1
a459 1
if [ ! -r $CHARMINC/conv-mach.sh ]
d742 1
a742 1
Debug "About to check TRACEMODE=$TRACEMODE and BALANCE=$BALANCE..."
d746 3
a748 1
[ -e $CHARMLIB/libtrace-none.a ] || Abort "trace libraries not installed."
d752 3
a754 1
[ ! -e $CHARMLIB/libtrace-$TRACEMODE.a ] && Abort "charmc : No such tracemode $TRACEMODE"
d756 1
d768 2
d773 3
d785 1
a785 1
if [ ! -e "$BAL_OBJ" ]
d832 1
a832 1
if [ -e $CHARMBIN/conv-host ]
@


1.21
log
@Made to partyly work with mpi-exemplar. Still doesnt compile megatest because
of weird templates stuff in hpCC.
@
text
@d1 1
a1 1
#!/bin/csh -f
d3 3
a7 1
#
d12 153
a164 32
unsetenv MACHTYPE
unsetenv SEQUENTIAL
unsetenv LANGUAGE
unsetenv BALANCE
unsetenv MEMORY
unsetenv TRACEMODE
unsetenv VERBOSE
unsetenv SAVE
unsetenv PURIFY
unsetenv OVERRIDE_CC
unsetenv OVERRIDE_CXX
unsetenv OVERRIDE_LD
unsetenv OVERRIDE_LDXX
unsetenv OPTS_CPP       ; set OPTS_CPP = ()
unsetenv OPTS_LDRO      ; set OPTS_LDRO = ()
unsetenv OPTS_CC        ; set OPTS_CC = ()
unsetenv OPTS_CXX       ; set OPTS_CXX = ()
unsetenv OPTS_LD        ; set OPTS_LD = ()
unsetenv OPTS_LDXX      ; set OPTS_LDXX = ()
unsetenv OBJECT
unsetenv COPIES         ; set COPIES = ()
unsetenv LIBRARIES      ; set LIBRARIES = ()
unsetenv FILES          ; set FILES = ()
unsetenv OBJECTFILES    ; set OBJECTFILES = ()
unsetenv DELETE         ; set DELETE = ()
unsetenv MAINOBJ        ; set MAINOBJ = ()
unsetenv GENCPM         ; set GENCPM = ()
unsetenv DEBUG_MODE
unsetenv OPTIMIZE_MODE
unsetenv USE_RELIABLE_CC
unsetenv USE_FASTEST_CC
unsetenv ECHOCMD        ; set ECHOCMD=(unset echo)
d174 1
d176 208
a383 211
set argindex=1
while ($argindex <= $#argv)
    set arg=$argv[$argindex]
    @@ argindex = $argindex + 1

    switch ($arg)
        case "-machine"
            set MACHTYPE=$argv[$argindex]
            @@ argindex = $argindex + 1
            breaksw

        case "-seq"
	    set SEQUENTIAL=yes
            breaksw

        case "-language"
            set LANGUAGE=$argv[$argindex]
            @@ argindex = $argindex + 1
            breaksw

	case "-balance"
            set BALANCE=$argv[$argindex]
            @@ argindex = $argindex + 1
            breaksw

        case "-queue"
            echo "Warning: -queue currently being ignored."
            @@ argindex = $argindex + 1
            breaksw

        case "-memory"
            echo "Warning: -memory currently being ignored."
            @@ argindex = $argindex + 1
            breaksw

	case "-tracemode"
            set TRACEMODE=$argv[$argindex]
            @@ argindex = $argindex + 1
            breaksw

        case "-verbose"
            set VERBOSE=1
            set ECHOCMD=(set echo)
            breaksw

        case "-save"
            set SAVE=1
            breaksw

        case "-purify"
            set PURIFY=1
            breaksw

        case "-use-reliable-cc"
	    set USE_RELIABLE_CC=1
            breaksw

	case "-use-fastest-cc"
	    set USE_FASTEST_CC=1
            breaksw
 
        case "-cc"
            set OVERRIDE_CC=( $argv[$argindex] )
            @@ argindex = $argindex + 1
            breaksw

        case "-c++"
            set OVERRIDE_CXX=( $argv[$argindex] )
            @@ argindex = $argindex + 1
            breaksw

        case "-ld"
            set OVERRIDE_LD=( $argv[$argindex] )
            @@ argindex = $argindex + 1
            breaksw

        case "-ld++"
	    set OVERRIDE_LDXX=( $argv[$argindex] )
            @@ argindex = $argindex + 1
            breaksw

        case "-cpp-option"
	    set OPTS_CPP=( $OPTS_CPP $argv[$argindex] )
	    @@ argindex = $argindex + 1
	    breaksw

        case "-ldro-option"
	    set OPTS_LDRO=( $OPTS_LDRO $argv[$argindex] )
	    @@ argindex = $argindex + 1
            breaksw

        case "-cc-option"
            set OPTS_CC=( $OPTS_CC $argv[$argindex] )
            @@ argindex = $argindex + 1
            breaksw

        case "-c++-option"
            set OPTS_CXX=( $OPTS_CXX $argv[$argindex] )
            @@ argindex = $argindex + 1
            breaksw

        case "-ld-option"
            set OPTS_LD=( $OPTS_LD $argv[$argindex] )
            @@ argindex = $argindex + 1
            breaksw

        case "-ld++-option"
	    set OPTS_LDXX=( $OPTS_LDXX $argv[$argindex] )
            @@ argindex = $argindex + 1
            breaksw
	    
        case "-c":
            # This is ignored.
            breaksw

	case "-o":
            set OBJECT=$argv[$argindex]
            @@ argindex = $argindex + 1
            breaksw

	case "-cp"
	    set COPIES=($argv[$argindex] $COPIES)
	    @@ argindex = $argindex + 1
            breaksw

        case "-gen-cpm"
            set GENCPM=($GENCPM $argv[$argindex])
            @@ argindex = $argindex + 1
            breaksw

        case "-D*"
            set OPTS_CPP=( $OPTS_CPP "$arg" )
            set OPTS_CC= ( $OPTS_CC  "$arg" )
            set OPTS_CXX=( $OPTS_CXX "$arg" )
            breaksw

        case "-I*"
            set OPTS_CPP=( $OPTS_CPP "$arg" )
            set OPTS_CC= ( $OPTS_CC  "$arg" )
            set OPTS_CXX=( $OPTS_CXX "$arg" )
            breaksw

        case "-L*"
            set OPTS_LDRO=( $OPTS_LDRO "$arg" )
            set OPTS_LD=  ( $OPTS_LD   "$arg" )
            set OPTS_LDXX=( $OPTS_LDXX "$arg" )
            breaksw

        case "-g"
	    set DEBUG_MODE=1
            breaksw

	case "-O"
	    set OPTIMIZE_MODE=1
            breaksw

	case "-NO"
	    unset OPTIMIZE_MODE
            breaksw

	case "-pg"
	    set OPTS_CC= ( $OPTS_CC $arg )
	    set OPTS_CXX= ( $OPTS_CC $arg )
	    set OPTS_LD= ( $OPTS_CC $arg )
	    set OPTS_LDXX= ( $OPTS_CC $arg )
            breaksw

        case "-O*"
            set OPTS_CC= ( $OPTS_CC $arg )
            set OPTS_CXX=( $OPTS_CXX $arg )
            breaksw

        case "-l*"
            set LIBRARIES=( $LIBRARIES $arg )
            breaksw

        case "-s"
            set OPTS_LD=  ( $OPTS_LD   $arg )
	    set OPTS_LDXX=( $OPTS_LDXX $arg )
            breaksw

        case "-*"
            echo "passing unrecognized option $arg to all compilers and linkers"
	    set OPTS_CPP= ( $OPTS_CPP  $arg )
            set OPTS_CC=  ( $OPTS_CC   $arg )
            set OPTS_CXX= ( $OPTS_CXX  $arg )
            set OPTS_LD=  ( $OPTS_LD   $arg )
	    set OPTS_LDXX=( $OPTS_LDXX $arg )
            set OPTS_LDRO=( $OPTS_LDRO $arg )
            breaksw

        case "+*"
            echo "passing unrecognized option $arg to all compilers and linkers"
	    set OPTS_CPP= ( $OPTS_CPP  $arg )
            set OPTS_CC=  ( $OPTS_CC   $arg )
            set OPTS_CXX= ( $OPTS_CXX  $arg )
            set OPTS_LD=  ( $OPTS_LD   $arg )
	    set OPTS_LDXX=( $OPTS_LDXX $arg )
            set OPTS_LDRO=( $OPTS_LDRO $arg )
            breaksw

        case "*.*"
            set FILES=( $FILES "$arg" )
            breaksw
        
        default:
            echo "Unrecognized argument $arg"
            exit 1

    endsw
end
d391 1
a391 1
set ORIGDIR=`pwd`
d395 38
a432 5
if ($?CHARMBIN == 0) then
    set SCRIPT=$0
    if ($SCRIPT:h != $SCRIPT:t) then
        cd $SCRIPT:h
        set SCRIPT=$SCRIPT:t
d434 14
a447 36
        foreach dir ($path)
            if (-x $dir/$SCRIPT && ! -d $dir/$SCRIPT) then
                cd $dir
                break
            endif
        end
    endif
    while (x`find $SCRIPT -type l -print` == x$SCRIPT)
        set SCRIPT=`ls -al ./$SCRIPT:t | sed -e "s@@.*-> @@@@"`
        if ($SCRIPT:h != $SCRIPT:t) then
            cd $SCRIPT:h
            set SCRIPT=$SCRIPT:t
        endif
    end
    set CHARMBIN=`pwd`
endif

# Give an error message

if ($?CHARMBIN == 0) then
    echo ''
    echo 'Error - cannot find the charm binary directory.'
    echo ''
    echo 'Normally, charmc and the other charm scripts automatically'
    echo 'locate the charm binary directory, using the following strategy:'
    echo ''
    echo '  Step 1. It looks in the directory specified in $CHARMBIN'
    echo ''
    echo '  Step 2. It looks in the directory from which charmc was run.'
    echo ''
    echo 'If it searches both these places, and doesnt find the charm'
    echo 'files, it will give up.'
    echo ''
    exit 1
    endif
endif
d449 1
a449 18
if ($?MACHTYPE) then
    if (-d $CHARMBIN/../../$MACHTYPE/bin) then
        cd $CHARMBIN/../../$MACHTYPE/bin
	set CHARMBIN=`pwd`
    else
        echo 'error - there is no installed charm for "'$MACHTYPE'"'
        exit 1
    endif
endif

if ($?CHARMLIB == 0) then
    cd $CHARMBIN/../lib
    set CHARMLIB=`pwd`
endif
if ($?CHARMINC == 0) then
    cd $CHARMBIN/../include
    set CHARMINC=`pwd`
endif
d457 74
a530 57
source $CHARMINC/conv-mach.csh

if ( $?USE_RELIABLE_CC ) then
    set CMK_CC=( $CMK_CC_RELIABLE )
endif

if ( $?USE_FASTEST_CC ) then
    set CMK_CC=( $CMK_CC_FASTEST )
endif

if ($?SEQUENTIAL) then
    set CMK_CC=( $CMK_SEQ_CC )
    set CMK_LD=( $CMK_SEQ_LD )
    set CMK_CXX=( $CMK_SEQ_CXX )
    set CMK_LDXX=( $CMK_SEQ_LDXX )
endif

if ($?OVERRIDE_CC) then
    set CMK_CC[1]=""
    set CMK_CC = ( $OVERRIDE_CC $CMK_CC )
endif

if ($?OVERRIDE_CXX) then
    set CMK_CXX[1]=""
    set CMK_CXX = ( $OVERRIDE_CXX $CMK_CXX )
endif

if ($?OVERRIDE_LD) then
    set CMK_LD[1]=""
    set CMK_LD = ( $OVERRIDE_LD $CMK_LD )
endif

if ($?PURIFY == 1) then
    set CMK_LD = ( purify $CMK_LD )
    set CMK_LDXX = ( purify $CMK_LDXX )
endif

if ($?OVERRIDE_LDXX) then
    set CMK_LDXX[1]=""
    set CMK_LDXX = ( $OVERRIDE_LDXX $CMK_LDXX )
endif

if ($?DEBUG_MODE) then
    set OPTS_CC  = ( $CMK_C_DEBUG $OPTS_CC )
    set OPTS_CXX = ( $CMK_CXX_DEBUG $OPTS_CXX )
    set OPTS_LD  = ( $CMK_C_DEBUG $OPTS_LD )
    set OPTS_LDXX = ( $CMK_CXX_DEBUG $OPTS_LDXX )
endif

if ($?OPTIMIZE_MODE) then
    set OPTS_CC  = ( $CMK_C_OPTIMIZE $OPTS_CC )
    set OPTS_CXX = ( $CMK_CXX_OPTIMIZE $OPTS_CXX )
    set OPTS_LD  = ( $CMK_C_OPTIMIZE $OPTS_LD )
    set OPTS_LDXX = ( $CMK_CXX_OPTIMIZE $OPTS_LDXX )
endif

onintr failure
d537 19
d557 25
a581 29
if ($?LANGUAGE == 0) then
    set LANGUAGE=charm++
    if ($?SEQUENTIAL) set LANGUAGE=c
endif

switch ($LANGUAGE)
    case "c"
    case "C"
    case "c++"
    case "C++"
	if ($?SEQUENTIAL == 0) then
	    echo "Language $LANGUAGE is for sequential programs"
	    goto failure
	endif
	breaksw
    case "charm" 
    case "charm++" 
    case "converse"
    case "converse++"
    case "idl"
	if ($?SEQUENTIAL == 1) then
	    echo "Language $LANGUAGE is for parallel programs"
	    goto failure
	endif
        breaksw
    default:
        echo "charmc: Unrecognized choice of language $LANGUAGE"
	goto failure
endsw
a582 1
cd $ORIGDIR
d590 14
a603 12
foreach FILE ($GENCPM)
    set BASE=$FILE:r
    set TMP=$BASE:t.TMP
    set DELETE=($DELETE $TMP.c $TMP.i)
    ($ECHOCMD ; /bin/rm -f $BASE.cpm.h $TMP.c)
    ($ECHOCMD ; touch $BASE.cpm.h)
    ($ECHOCMD ; /bin/ln -s $FILE $TMP.c)
    ($ECHOCMD ; $CMK_CPP_C $OPTS_CPP -I$CHARMINC $TMP.c > $TMP.i)
    if ($status) goto failure
    ($ECHOCMD ; $CHARMBIN/conv-cpm $TMP.i $BASE.cpm.h)
    if ($status) goto failure
end
d613 57
a669 99
foreach FILE ($FILES)
  set BASE=$FILE:r
  set TMP=$BASE:t.TMP
  if (${BASE}.o != $FILE) then
      if ($?VERBOSE) echo "compiling $FILE."
      /bin/rm -f $BASE.o $BASE.f.o
  endif
  switch ($FILE)
    case "*.ci"
      ($ECHOCMD ; $CHARMBIN/charmxi $CMK_XIOPTS $BASE.ci)
      if ($status) goto failure
      breaksw
    case "*.idl"
      ($ECHOCMD ; $CHARMBIN/charmidl $BASE.idl)
      if ($status) goto failure
      breaksw
    case "*.sdag"
      ($ECHOCMD ; $CHARMBIN/sdagx $BASE.sdag)
      if ($status) goto failure
      breaksw
    case "*.c"
      ($ECHOCMD ; $CMK_CC $OPTS_CC -I$CHARMINC -c $BASE.c -o $BASE.o)
      if ($status) goto failure
      if ($?OBJECT) then
	if ($OBJECT != $BASE.o) set DELETE=( $DELETE $BASE.o )
        set OBJECTFILES=( $OBJECTFILES $BASE.o )
      endif
      breaksw
    case "*.s"
      ($ECHOCMD ; $CMK_CC $OPTS_CC -I$CHARMINC -c $BASE.s -o $BASE.o)
      if ($status) goto failure
      if ($?OBJECT) then
	if ($OBJECT != $BASE.o) set DELETE=( $DELETE $BASE.o )
        set OBJECTFILES=( $OBJECTFILES $BASE.o )
      endif
      breaksw
    case "*.C"
      ($ECHOCMD ; $CMK_CXX $OPTS_CXX -I$CHARMINC -c $BASE.C -o $BASE.o)
      if ($status) goto failure
      if ($?OBJECT) then
	if ($OBJECT != $BASE.o) set DELETE=( $DELETE $BASE.o )
        set OBJECTFILES=( $OBJECTFILES $BASE.o )
      endif
      breaksw
    case "*.cc"
      ($ECHOCMD ; $CMK_CXX $OPTS_CXX -I$CHARMINC -c $BASE.cc -o $BASE.o)
      if ($status) goto failure
      if ($?OBJECT) then
	if ($OBJECT != $BASE.o) set DELETE=( $DELETE $BASE.o )
        set OBJECTFILES=( $OBJECTFILES $BASE.o )
      endif
      breaksw
    case "*.cxx"
      ($ECHOCMD ; $CMK_CXX $OPTS_CXX -I$CHARMINC -c $BASE.cxx -o $BASE.o)
      if ($status) goto failure
      if ($?OBJECT) then
	if ($OBJECT != $BASE.o) set DELETE=( $DELETE $BASE.o )
        set OBJECTFILES=( $OBJECTFILES $BASE.o )
      endif
      breaksw
    case "*.f"
      ($ECHOCMD ; $CMK_CF77 -I$CHARMINC -c $BASE.f -o $BASE.o)
      if ($status) goto failure
      if ($?OBJECT) then
	if ($OBJECT != $BASE.o) set DELETE=( $DELETE $BASE.o )
        set OBJECTFILES=( $OBJECTFILES $BASE.o )
      endif
      breaksw
    case "*.f90"
      ($ECHOCMD ; $CMK_CF90 -I$CHARMINC -c $BASE.f90 -o $BASE.o)
      if ($status) goto failure
      if ($?OBJECT) then
	if ($OBJECT != $BASE.o) set DELETE=( $DELETE $BASE.o )
        set OBJECTFILES=( $OBJECTFILES $BASE.o )
      endif
      breaksw
    case "*.F"
      ($ECHOCMD ; $CMK_CF77 -I$CHARMINC -c $BASE.F -o $BASE.o)
      if ($status) goto failure
      if ($?OBJECT) then
	if ($OBJECT != $BASE.o) set DELETE=( $DELETE $BASE.o )
        set OBJECTFILES=( $OBJECTFILES $BASE.o )
      endif
      breaksw
    case "*.fc"
    case "*.FC"
      echo "charmc: I'm not yet smart enough to compile $FILE"
      goto failure
    case "*.o"
      set OBJECTFILES=( $OBJECTFILES $BASE.o )
      breaksw
    case "*.a"
      set OBJECTFILES=( $OBJECTFILES $BASE.a )
      breaksw
    default:
      echo "file with unrecognized extension $FILE"
      goto failure
  endsw
end
d684 45
a728 42
if ($?OBJECT == 0) goto success

switch ($OBJECT)
  case "*.o":
    if (($#FILES == 1)&&($#OBJECTFILES == 1)) then
        if ($OBJECT != $OBJECTFILES) then
            rm -f $OBJECT
            ($ECHOCMD ; /bin/mv $OBJECTFILES $OBJECT)
            if ($status) goto failure
        endif
    else
        rm -f $OBJECT
        ($ECHOCMD ; $CMK_LDRO $OBJECT $OPTS_LDRO $OBJECTFILES)
        if ($status) goto failure
    endif
    goto copyobj

  case "*.a":
    ($ECHOCMD ; rm -f $OBJECT)
    ($ECHOCMD ; $CMK_AR $OBJECT $OBJECTFILES)
    if ($status) goto failure
    ($ECHOCMD ; $CMK_RANLIB $OBJECT)
    if ($status) goto failure
    goto copyobj
endsw

switch ($LANGUAGE)
    case "c"
    case "C"
    case "f90"
    case "f77"
        ($ECHOCMD ; $CMK_SEQ_LD $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $LIBRARIES $CMK_SEQ_LIBS)
        if ($status) goto failure
        goto copyobj
        breaksw
    case "c++"
    case "C++"    
        ($ECHOCMD ; $CMK_SEQ_LDXX $OPTS_LD -o $OBJECT $OBJECTFILES -L$CHARMLIB $LIBRARIES $CMK_SEQ_LIBS)
        if ($status) goto failure
        goto copyobj
        breaksw
endsw
d740 2
d744 3
a746 1
if (($LANGUAGE == charm) || ($LANGUAGE == charm++) || ($LANGUAGE == idl) || ($LANGUAGE == converse) || ($LANGUAGE == converse++) ) then
d748 1
a748 12
    if (! -e $CHARMLIB/libtrace-none.a) then
        echo "charmc: trace libraries not installed."
        goto failure
    endif
    
    if ($?TRACEMODE == 0) set TRACEMODE=none

    if (! -e $CHARMLIB/libtrace-$TRACEMODE.a) then
       echo "charmc : No such tracemode $TRACEMODE"
       (cd $CHARMLIB ; ls -al libtrace-*)
       goto failure
    endif
a749 1
endif
d753 1
a753 9
if ($?BALANCE == 0) set BALANCE=rand

if ($TRACEMODE == replay) then
    if ($?BALANCE == 0) set BALANCE=replay
    if ($BALANCE != replay) then
        echo "Ignoring -balance $BALANCE, incompatible with -tracemode replay"
    endif
    set BALANCE=replay
endif
d755 11
a765 2
if ($BALANCE:h == $BALANCE) then
   set BAL_OBJ = $CHARMLIB/libldb-$BALANCE.o
d767 16
a782 12
   set BAL_OBJ = $BALANCE
endif
    
if (! -e $BAL_OBJ) then
    if ($BALANCE == $BAL_OBJ) then
        echo "charmc : Could not find load balancer object $BAL_OBJ"
    else
	echo "charmc : Unknown load balancer $BALANCE"
    	(cd $CHARMLIB ; ls -al libldb-*)
    endif
    goto failure
endif
d790 23
a812 29
switch ($LANGUAGE)
    case "charm"
    case "charm++"
        ($ECHOCMD ; $CMK_LDXX $OPTS_LDXX -o $OBJECT -L$CHARMLIB -I$CHARMINC \
		      $BAL_OBJ $OBJECTFILES \
                      $LIBRARIES -lck \
                      -lconv-cplus-y -lconv-core  -ltrace-$TRACEMODE \
		      -lm $CMK_LIBS)
        breaksw
    case "idl"
        ($ECHOCMD ; $CMK_LDXX $OPTS_LDXX -o $OBJECT -L$CHARMLIB \
		      $BAL_OBJ $OBJECTFILES \
                      $LIBRARIES -lck \
                      -lconv-cplus-y -lconv-core -ltrace-$TRACEMODE \
		      -lidl -lm $CMK_LIBS)
        breaksw
    case "converse"
        ($ECHOCMD ; $CMK_LD $OPTS_LD -o $OBJECT -L$CHARMLIB $BAL_OBJ \
		      $OBJECTFILES $LIBRARIES -lconv-cplus-n -lconv-core\
		      -ltrace-$TRACEMODE \
		      -lm $CMK_LIBS)
        breaksw
    case "converse++"
        ($ECHOCMD ; $CMK_LDXX $OPTS_LDXX -o $OBJECT -L$CHARMLIB $BAL_OBJ \
		      $OBJECTFILES $LIBRARIES -lconv-cplus-y -lconv-core \
		      -ltrace-$TRACEMODE \
		      -lm $CMK_LIBS)
        breaksw
endsw
d820 13
a832 4
if (-e $CHARMBIN/conv-host) then
    /bin/rm -f conv-host
    /bin/ln -s $CHARMBIN/conv-host conv-host
endif
a833 5
########################################################################
#
# copyobj: if -cp specified, copy the resulting output file.
#
########################################################################
a834 1
copyobj:
a835 7
foreach x ($COPIES)
    if ($x != $OBJECT) then
	set COPY=$x
	if (-d $COPY) set COPY=$COPY/$OBJECT
        ($ECHOCMD ; /bin/rm -f $COPY ; /bin/cp $OBJECT $COPY)
    endif
end
a836 1
goto success
a837 5
########################################################################
#
# Clean up files and exit
#
########################################################################
a838 1
success:
a839 2
    set STATUS=0
    goto end
a840 1
failure:
a841 17
    echo 'charmc: aborting.'
    set STATUS=1
    goto end

end:

    if ($?SAVE == 0) then
        foreach FILE ($FILES)
            set BASE=$FILE:r
            set TMP=$BASE:t.TMP
            /bin/rm -f $TMP.P.C $TMP.cpp $TMP.space $TMP.xlat $TMP.o
            /bin/rm -f $TMP.c $TMP.c.0.h $TMP.c.1.h $TMP.c.2.h
            /bin/rm -f $TMP.i $TMP.$CMK_CPP_SUFFIX
        end
        rm -f core $DELETE
    endif
    exit ($STATUS)
@


1.20
log
@Added a -ansi flag to charmxi, and options to enable it in conv-mach.csh
and conv-mach.h
@
text
@d687 1
a687 1
        ($ECHOCMD ; $CMK_LDXX $OPTS_LDXX -o $OBJECT -L$CHARMLIB \
@


1.19
log
@Added F77 and F90 support to charmc.
@
text
@d474 1
a474 1
      ($ECHOCMD ; $CHARMBIN/charmxi $BASE.ci)
@


1.18
log
@Integrated Partha's Debugger-related changes.
@
text
@d526 15
d542 7
d607 2
@


1.17
log
@Rewrote the Charm++ runtime system, and the ITC++ translator.
@
text
@d609 1
a609 1
if (($LANGUAGE == charm++) || ($LANGUAGE == idl) || ($LANGUAGE == converse) || ($LANGUAGE == converse++) ) then
d661 1
@


1.16
log
@Removed a small dependency on charm libs.
@
text
@a654 54
# 
# Make sure all temp-files created during linkage get deleted.
#
###############################################################################

set DELETE=(CHARMC-PRE.TMP.xxx CHARMC-PRE.TMP.nm $DELETE)
set DELETE=(CHARMC-MOD.TMP.dat CHARMC-MOD.TMP.c CHARMC-MOD.TMP.o $DELETE)
rm -f CHARMC-PRE.TMP.xxx CHARMC-PRE.TMP.nm
rm -f CHARMC-MOD.TMP.dat CHARMC-MOD.TMP.c CHARMC-MOD.TMP.o

###############################################################################
#
# 			Create CHARMC-MOD.TMP.c
#
# This file contains the function _CK_module_init_fn, which
# initializes each charm or charm++ module in turn.   Its creation
# is highly system-dependent, which is why I have all these
# nested if-statements here.
#
###############################################################################

if (($LANGUAGE == charm++) || ($LANGUAGE == idl)) then
    if ($LANGUAGE == charm++) then
	echo 'void _CK_module_init_fn() {}' > CHARMC-MOD.TMP.c
	($ECHOCMD ; $CMK_CC $OPTS_CC -c -o CHARMC-MOD.TMP.o CHARMC-MOD.TMP.c)
        ($ECHOCMD ; $CMK_LDXX $OPTS_LDXX -o CHARMC-PRE.TMP.xxx -L$CHARMLIB \
		      $BAL_OBJ $OBJECTFILES $LIBRARIES \
		      CHARMC-MOD.TMP.o -lck-core -ltrace-$TRACEMODE \
                      -lck-cplus-y -lconv-cplus-y -lconv-core \
		      -lck-defmain-cpp -lm $CMK_LIBS)
    else if ($LANGUAGE == idl) then
	echo 'void _CK_module_init_fn() {}' > CHARMC-MOD.TMP.c
	($ECHOCMD ; $CMK_CC $OPTS_CC -c -o CHARMC-MOD.TMP.o CHARMC-MOD.TMP.c)
        ($ECHOCMD ; $CMK_LDXX $OPTS_LDXX -o CHARMC-PRE.TMP.xxx -L$CHARMLIB \
		      $BAL_OBJ $OBJECTFILES $LIBRARIES \
		      CHARMC-MOD.TMP.o -lck-core -ltrace-$TRACEMODE \
                      -lck-cplus-y -lconv-cplus-y -lconv-core \
		      -lck-defmain-cpp -lidl -lm $CMK_LIBS)
    endif
    rm -f CHARMC-PRE.TMP.nm
    strings -a CHARMC-PRE.TMP.xxx | awk '/^charmc autoinit / { print $3; }' > CHARMC-PRE.TMP.nm
    sort < CHARMC-PRE.TMP.nm | uniq > CHARMC-MOD.TMP.dat
    echo 'Charm Modules: '`cat CHARMC-MOD.TMP.dat`
    rm -f CHARMC-MOD.TMP.c
    awk '{print "extern void _CK_"$1"_init();";}' < CHARMC-MOD.TMP.dat >> CHARMC-MOD.TMP.c
    echo 'void _CK_module_init_fn()' >> CHARMC-MOD.TMP.c
    echo '{' >> CHARMC-MOD.TMP.c
    awk '{print "_CK_"$1"_init();";}' < CHARMC-MOD.TMP.dat >> CHARMC-MOD.TMP.c
    echo '}' >> CHARMC-MOD.TMP.c
    ($ECHOCMD ; $CMK_CC $OPTS_CC -c CHARMC-MOD.TMP.c)
    if ($status) goto failure
endif

###############################################################################
d663 4
a666 4
		      CHARMC-MOD.TMP.o $BAL_OBJ $OBJECTFILES \
                      $LIBRARIES -lck-core -ltrace-$TRACEMODE \
                      -lck-cplus-y -lconv-cplus-y -lconv-core \
		      -lck-defmain-cpp -lm $CMK_LIBS)
d670 4
a673 4
		      CHARMC-MOD.TMP.o $BAL_OBJ $OBJECTFILES \
                      $LIBRARIES -lck-core -ltrace-$TRACEMODE \
                      -lck-cplus-y -lconv-cplus-y -lconv-core \
		      -lck-defmain-cpp -lidl -lm $CMK_LIBS)
@


1.15
log
@Removed all the charm and charm++ translator related stuff.
@
text
@d684 1
a684 1
		      -lck-defmain-cpp -lcharm -lm $CMK_LIBS)
d692 1
a692 1
		      -lck-defmain-cpp -lcharm -lidl -lm $CMK_LIBS)
d720 1
a720 1
		      -lck-defmain-cpp -lcharm -lm $CMK_LIBS)
d727 1
a727 1
		      -lck-defmain-cpp -lcharm -lidl -lm $CMK_LIBS)
@


1.14
log
@Removed RCS information.
@
text
@d407 1
a407 1
    set LANGUAGE=charm
a472 32
    case "*.p"
      set DELETE=($DELETE $BASE.headers)
      ($ECHOCMD ; $CMK_CPP_CHARM $OPTS_CPP -I$CHARMINC $BASE.p > $TMP.cpp)
      ($ECHOCMD ; $CHARMBIN/charmfilter < $TMP.cpp | $CMK_M4 > $TMP.space)
      ($ECHOCMD ; $CHARMBIN/charmxlat $TMP.space $TMP.c)
      if ($status) goto failure
      ($ECHOCMD ; $CMK_CC $OPTS_CC -I$CHARMINC -c $TMP.c -o $TMP.o)
      if ($status) goto failure
      if ($?OBJECT == 0) then
          ($ECHOCMD ; /bin/mv $TMP.o $BASE.o)
      else
          set OBJECTFILES=( $OBJECTFILES $TMP.o )
      endif
      breaksw
    case "*.P"
      # Put pgm.P into pgm.TMP.P.C because CC needs source files to end with .C
      echo '#include "charm++.h"' >> $TMP.P.C
      echo '#line 1 "'$BASE.P'"' >> $TMP.P.C
      /bin/cat $BASE.P >> $TMP.P.C
      ($ECHOCMD ; $CMK_CXXPP $OPTS_CPP -I$CHARMINC $TMP.P.C > $TMP.cpp)
      ($ECHOCMD ; $CHARMBIN/$CMK_XLATPP $TMP.cpp $TMP.xlat)
      if ($status) goto failure
      ($ECHOCMD ; /bin/cat $BASE.headers > $TMP.$CMK_CPP_SUFFIX)
      ($ECHOCMD ; /bin/cat $TMP.xlat >> $TMP.$CMK_CPP_SUFFIX)
      ($ECHOCMD ; $CMK_CXX $OPTS_CXX -I$CHARMINC -c $TMP.$CMK_CPP_SUFFIX -o $TMP.o)
      if ($status) goto failure
      if ($?OBJECT == 0) then
        ($ECHOCMD ; /bin/mv $TMP.o $BASE.o)
      else
        set OBJECTFILES=( $OBJECTFILES $TMP.o )
      endif
      breaksw
a492 8
    case "*.c"
      ($ECHOCMD ; $CMK_CC $OPTS_CC -I$CHARMINC -c $BASE.c -o $BASE.o)
      if ($status) goto failure
      if ($?OBJECT) then
	if ($OBJECT != $BASE.o) set DELETE=( $DELETE $BASE.o )
        set OBJECTFILES=( $OBJECTFILES $BASE.o )
      endif
      breaksw
d609 1
a609 1
if (($LANGUAGE == charm) || ($LANGUAGE == charm++) || ($LANGUAGE == idl) || ($LANGUAGE == converse) || ($LANGUAGE == converse++) ) then
d676 2
a677 10
if (($LANGUAGE == charm) || ($LANGUAGE == charm++) || ($LANGUAGE == idl)) then
    if ($LANGUAGE == charm) then
	echo 'void _CK_module_init_fn() {}' > CHARMC-MOD.TMP.c
	($ECHOCMD ; $CMK_CC $OPTS_CC -c -o CHARMC-MOD.TMP.o CHARMC-MOD.TMP.c)
        ($ECHOCMD ; $CMK_LD $OPTS_LD -o CHARMC-PRE.TMP.xxx -L$CHARMLIB \
                      $BAL_OBJ $OBJECTFILES $LIBRARIES \
		      CHARMC-MOD.TMP.o -lck-core -ltrace-$TRACEMODE \
                      -lck-cplus-n -lconv-cplus-n -lconv-core \
		      -lck-defmain-std -lcharm -lm $CMK_LIBS)
    else if ($LANGUAGE == charm++) then
a714 7
    case "charm"
        ($ECHOCMD ; $CMK_LD $OPTS_LD -o $OBJECT -L$CHARMLIB \
                      CHARMC-MOD.TMP.o $BAL_OBJ $OBJECTFILES \
                      $LIBRARIES -lck-core -ltrace-$TRACEMODE \
                      -lck-cplus-n -lconv-cplus-n -lconv-core \
		      -lck-defmain-std -lcharm -lm $CMK_LIBS)
        breaksw
@


1.13
log
@Made a special idl language case, so charm++ doesn't have to include -lidl.
@
text
@a1 17
############################################################################
# RCS INFORMATION:
#
#       $RCSfile: charmc,v $
#       $Author: milind $      $Locker:  $              $State: Exp $
#       $Revision: 1.12 $        $Date: 1998/08/04 03:53:38 $
#
############################################################################
# DESCRIPTION:
#
############################################################################
# REVISION HISTORY:
#
############################################################################



@


1.12
log
@Added IDL translator.
@
text
@d7 1
a7 1
#       $Revision: 1.11 $        $Date: 1998/05/25 15:21:16 $
d742 9
a750 1
    else if (($LANGUAGE == charm++) || ($LANGUAGE == idl)) then
@


1.11
log
@Added IDL Test programs
@
text
@d7 1
a7 1
#       $Revision: 1.10 $        $Date: 1998/05/22 22:05:13 $
d442 1
d666 1
a666 1
if (($LANGUAGE == charm) || ($LANGUAGE == charm++) || ($LANGUAGE == converse) || ($LANGUAGE == converse++) ) then
d733 1
a733 1
if (($LANGUAGE == charm) || ($LANGUAGE == charm++)) then
d742 1
a742 1
    else if ($LANGUAGE == charm++) then
d749 1
a749 1
		      -lck-defmain-cpp -lcharm -lm $CMK_LIBS)
d785 7
@


1.10
log
@Added Charm-IDL
@
text
@d7 1
a7 1
#       $Revision: 1.9 $        $Date: 1998/05/03 09:48:01 $
d523 4
@


1.9
log
@Fixed a bug in charmc that prevented it from passing options of type "+*"
to all the compilers and linkers.
@
text
@d7 1
a7 1
#       $Revision: 1.8 $        $Date: 1998/05/03 08:56:08 $
d555 8
@


1.8
log
@Modified charmc to accept sdag files, and call the sdag translator.
Also, removed dependency on flex during superinstall.
@
text
@d7 1
a7 1
#       $Revision: 1.7 $        $Date: 1998/04/16 16:28:44 $
d251 10
@


1.7
log
@Fixed a charmc bug detected by a CS497 student and a size_t bug.
@
text
@d6 2
a7 2
#       $Author: jyelon $      $Locker:  $              $State: Exp $
#       $Revision: 1.6 $        $Date: 1998/02/27 11:53:06 $
d513 4
@


1.6
log
@Cleaned up header files, replaced load-balancer.
@
text
@d6 2
a7 2
#       $Author: milind $      $Locker:  $              $State: Exp $
#       $Revision: 1.5 $        $Date: 1998/01/13 17:03:28 $
d562 2
d565 1
a565 1
      set OBJECTFILES=( $OBJECTFILES $BASE.o )
@


1.5
log
@Made charm++ to compile and run with Solaris 2.6.
In particular, changed INTBITS to CINTBITS, and handled EALREADY.
@
text
@d6 2
a7 2
#       $Author: jyelon $      $Locker:  $              $State: Exp $
#       $Revision: 1.4 $        $Date: 1997/12/22 22:53:02 $
d495 1
a495 3
      echo '#include "ckdefs.h"' > $TMP.P.C
      echo '#include "chare.h"' >> $TMP.P.C
      echo '#include "c++interface.h"' >> $TMP.P.C
@


1.4
log
@Restructuring LDB initialization scheme.
@
text
@d6 2
a7 2
#       $Author: milind $      $Locker:  $              $State: Exp $
#       $Revision: 1.3 $        $Date: 1997/11/26 19:17:26 $
d708 1
a708 1
	echo '_CK_module_init_fn() {}' > CHARMC-MOD.TMP.c
d716 1
a716 1
	echo '_CK_module_init_fn() {}' > CHARMC-MOD.TMP.c
d730 1
a730 1
    echo '_CK_module_init_fn()' >> CHARMC-MOD.TMP.c
@


1.3
log
@Fixed some portability bugs due to varying integer and pointer sizes.
@
text
@d7 1
a7 1
#       $Revision: 1.2 $        $Date: 1997/10/03 19:51:45 $
d641 1
a641 1
    if (! -e $CHARMLIB/libck-trace-none.a) then
d648 1
a648 1
    if (! -e $CHARMLIB/libck-trace-$TRACEMODE.a) then
d650 1
a650 1
       (cd $CHARMLIB ; ls -al libck-trace-*)
d658 1
a658 3
if (($LANGUAGE == charm) || ($LANGUAGE == charm++)) then

    if ($?BALANCE == 0) set BALANCE=rand
d660 4
a663 8
    # Check that TRACEMODE is compatible with BALANCE

    if ($TRACEMODE == replay) then
        if ($?BALANCE == 0) set BALANCE=replay
        if ($BALANCE != replay) then
            echo "Ignoring -balance $BALANCE, incompatible with -tracemode replay"
        endif
        set BALANCE=replay
d665 2
d668 4
d673 4
a676 7

# Check that the BAL_OBJ exists

if (($LANGUAGE == charm) || ($LANGUAGE == charm++)) then

    if ($BALANCE:h == $BALANCE) then
       set BAL_OBJ = $CHARMLIB/libck-ldb-$BALANCE.o
d678 2
a679 11
       set BAL_OBJ = $BALANCE
    endif
    
    if (! -e $BAL_OBJ) then
       if ($BALANCE == $BAL_OBJ) then
    	echo "charmc : Could not find load balancer object $BAL_OBJ"
       else
    	echo "charmc : Unknown load balancer $BALANCE"
    	(cd $CHARMLIB ; ls -al libck-ldb-*)
       endif
       goto failure
d681 1
a681 1

d712 1
a712 1
		      CHARMC-MOD.TMP.o -lck-core -lck-trace-$TRACEMODE \
d720 1
a720 1
		      CHARMC-MOD.TMP.o -lck-core -lck-trace-$TRACEMODE \
d748 1
a748 1
                      $LIBRARIES -lck-core -lck-trace-$TRACEMODE \
d755 1
a755 1
                      $LIBRARIES -lck-core -lck-trace-$TRACEMODE \
d760 1
a760 1
        ($ECHOCMD ; $CMK_LD $OPTS_LD -o $OBJECT -L$CHARMLIB \
d762 1
a762 1
		      -lck-trace-$TRACEMODE \
d766 1
a766 1
        ($ECHOCMD ; $CMK_LDXX $OPTS_LDXX -o $OBJECT -L$CHARMLIB \
d768 1
a768 1
		      -lck-trace-$TRACEMODE \
@


1.2
log
@Made charmc to work again, after inserting trace calls in converse part,
i.e. threads and user events.
@
text
@d6 2
a7 2
#       $Author: jyelon $      $Locker:  $              $State: Exp $
#       $Revision: 1.1 $        $Date: 1997/07/30 19:58:00 $
d726 1
a726 1
		      -lck-defmain-std -lcharm $CMK_LIBS -lm)
d734 1
a734 1
		      -lck-defmain-cpp -lcharm $CMK_LIBS -lm)
d762 1
a762 1
		      -lck-defmain-std -lcharm $CMK_LIBS -lm)
d769 1
a769 1
		      -lck-defmain-cpp -lcharm $CMK_LIBS -lm)
d775 1
a775 1
		      $CMK_LIBS -lm)
d781 1
a781 1
		      $CMK_LIBS -lm)
@


1.1
log
@*** empty log message ***
@
text
@d7 1
a7 1
#       $Revision: 2.77 $        $Date: 1997/07/30 17:30:54 $
d639 1
a639 1
if (($LANGUAGE == charm) || ($LANGUAGE == charm++)) then
d642 1
a642 1
        echo "charmc: charm libraries not installed."
d774 1
d780 1
@
