Task: Shared bulk data in emulation
[charm.git] / src / scripts / Makefile
1 #############################################################################"
2 #
3 # This one Makefile serves all of converse and charm.  It includes
4 # rules for building:
5 #
6 #     * The CONVERSE libraries
7 #     * Charm++ runtime
8 #     * ITC++ Translator
9 #     * Languages
10 #     * Documentation
11 #
12 # This Makefile is common to all machines.  This works because the charmc
13 # is smart enough to "conceal" the differences between machines.  charmc
14 # gets its smarts by reading the conv-mach.sh configuration file.
15 #
16 # If you wish to compile with debugging, optimization, or some other charm
17 # option, you can do so by setting OPTS.  For example, if you need a lot
18 # of debugging information, you could type:
19 #
20 #     make charm++ OPTS="-g -save -verbose"
21 #
22 ###############################################################################
23
24 SHELL=/bin/sh
25 L=../lib
26 INC=../include
27
28 all: charm++ bigsim LIBS AMPI f90charm TSM SM PVM doc
29
30 all-test: bigsim AMPI
31         cd ../tests ; $(MAKE) all OPTS='$(OPTS)'
32         cd ../examples ; $(MAKE) all OPTS='$(OPTS)'
33
34 charm++: charm-target
35         @echo "$(OPTS)" > OPTS
36         touch charm++
37
38 bgampi: bigsim AMPI
39
40 TSM: converse $(L)/libtsm.a
41
42 SM: converse $(L)/libsm.a
43
44 PVM: converse $(L)/libpvmc.a
45
46 AMR: charm++ LIBS
47         cd libs/ck-libs/amr; make all OPTS='$(OPTS)'
48
49 FEM: charm++ LIBS
50 FEMC: FEM
51 FEMF: FEM
52 ParFUM: FEM
53
54 MBLOCK: AMPI MBLOCKC MBLOCKF
55
56 MBLOCKC: charm++ LIBS
57
58 MBLOCKF: MBLOCKC
59
60 AMPI:  charm++ LIBS
61 AMPIC AMPIF: AMPI
62
63 ARMCI: charm++ LIBS
64
65
66 f90charm: charm++ $(L)/libf90charm.a
67
68 default_libs: multicast pythonCCS
69
70 ChaNGa: charm++ cache
71
72 cache: charm++
73         cd libs/ck-libs/cache && $(MAKE)
74
75 multicast: charmxi
76         cd libs/ck-libs/multicast && $(MAKE)
77
78 pythonCCS: charmxi
79         cd libs/ck-libs/pythonCCS && $(MAKE)
80
81 translators: charmxi conv-cpm
82
83 pose:  charm++
84         cd libs/ck-libs/pose && $(MAKE)
85
86 msa: charm++
87         cd libs/ck-libs/multiphaseSharedArrays && $(MAKE)
88
89 jade: charm++ msa
90 #       make the lib, include
91         cd langs/jade && $(MAKE)
92
93 fftlib: charm++
94         cd libs/ck-libs/fftlib && $(MAKE)
95
96 # This should be done offline, since the user does not need to compile
97 # parser files, etc.  All they need is the libjade + include files,
98 # antlr.jar, jade.jar, and a few scripts which the jade target takes
99 # care of.
100 jadeall: jade
101 #       make parser.g -> .java files
102         cd langs/jade && $(MAKE) p
103 #       make the jade.jar file
104         cd ../java/charm/jade && $(MAKE)
105
106 #include TAU defs
107 TAU_MAKEFILE=
108
109 include $(TAU_MAKEFILE) #stub-makefile
110
111 #builds TAU's trace library
112 Tau: 
113         echo "buliding charm trace library with support for TAU."
114         $(MAKE) $(L)/libtrace-Tau.a $(L)/libtrace-all.a TAU_TRACE_OBJ=libtrace-Tau.o
115
116 LIBS: CONVLIBS CHARMLIBS
117         cd libs; $(MAKE) otherlibs
118
119 bgtest: bigsim AMPI
120         cd ../tests ; $(MAKE) bgtest OPTS='$(OPTS)'
121         cd ../examples ; $(MAKE) bgtest OPTS='$(OPTS)'
122
123 test: bigsim AMPI
124         cd ../tests ; $(MAKE) test OPTS='$(OPTS)'
125         cd ../examples ; $(MAKE) test OPTS='$(OPTS)'
126
127 test-converse: converse
128         cd ../tests ; $(MAKE) test-converse  OPTS='$(OPTS)'
129
130 test-charm: charm++ METIS
131         cd ../tests ; $(MAKE) test-charm  OPTS='$(OPTS)'
132
133 test-AMPI: AMPI
134         cd ../tests ; $(MAKE) test-AMPI  OPTS='$(OPTS)'
135
136 test-fem: FEM
137         cd ../tests ; $(MAKE) test-fem  OPTS='$(OPTS)'
138
139 ps-doc: basics
140         cd ../doc ; make ps
141
142 pdf-doc: basics
143         cd ../doc ; make pdf
144
145 html-doc: basics
146         cd ../doc ; make html
147
148 doc: basics
149         cd ../doc ; make doc
150
151 CHARMC=../bin/charmc $(CHARMOPTS) $(OPTS)
152
153 SEQCHARMC=../bin/charmc -seq $(CHARMOPTS)
154
155 NATIVECHARMC=../bin/charmc -host $(CHARMOPTS)
156
157 CHARMXI=../bin/charmc -intrinsic $(OPTS)
158
159 DEPENDFILE = Make.depends
160
161 include $(DEPENDFILE)
162
163 ###############################################################################
164 #
165 # The basics (bin, lib, include, headers, charmc, conv-mach.sh)
166 #
167 ###############################################################################
168
169 CVHEADERS=cpthreads.h converse.h conv-trace.h conv-random.h conv-qd.h \
170       queueing.h conv-cpath.h conv-cpm.h persistent.h\
171       trace.h trace-bluegene.h trace-projections.h trace-simple.h trace-controlPoints.h charm-api.h \
172       conv-ccs.h ccs-client.c ccs-client.h \
173       ccs-server.h ccs-auth.c ccs-auth.h \
174       memory-isomalloc.h debug-conv.h debug-charm.h conv-autoconfig.h \
175       conv-common.h conv-config.sh conv-config.h conv-mach.h conv-mach.sh \
176       blue.h blue-conv.h bgconverse.h \
177         convcomlibstrategy.h 3dgridrouter.h de.h hypercubetopology.h    \
178         routerstrategy.h convcomlib.h dummyconversestrategy.h  treerouter.h \
179         convcomlibmanager.h graphrouter.h petable.h gridrouter.h router.h \
180         prefixrouter.h pipebroadcastconverse.h pipelinestrategy.h cmipool.h \
181         comlib.h cmidirect.h controlPoints.h
182
183 # The .c files are there to be #included by clients whole
184 # This is a bit unusual, but makes client linking simpler.
185 UTILHEADERS=pup.h pupf.h pup_c.h pup_stl.h pup_mpi.h pup_toNetwork.h pup_toNetwork4.h pup_paged.h pup_cmialloc.h\
186         ckimage.h ckdll.h ckhashtable.h ckbitvector.h cklists.h ckliststring.h \
187         ckstatistics.h ckvector3d.h conv-lists.h RTH.h ckcomplex.h \
188         sockRoutines.h sockRoutines.c ckpool.h BGLTorus.h BGPTorus.h \
189         TopoManager.h XT3Torus.h XT4Torus.h cmimemcpy.h
190
191 CKHEADERS=ck.h ckstream.h envelope.h init.h qd.h charm.h charm++.h \
192           ckfutures.h ckIgetControl.h \
193           ckcallback.h CkCallback.decl.h ckcallback-ccs.h       \
194           ckarrayreductionmgr.h cknodegroupreduction.h cksection.h \
195           ckarray.h cklocation.h ckreduction.h ckcheckpoint.h ckmemcheckpoint.h ckevacuation.h\
196           ckobjQ.h readonly.h charisma.h ComlibArrayListener.h ComlibStrategy.h \
197           ComlibLearner.h $(UTILHEADERS) \
198           tempo.h waitqd.h LBDatabase.h lbdb.h lbdb++.h LBProfit.h \
199           LBDBManager.h LBComm.h LBOM.h LBObj.h LBMachineUtil.h LBAgent.h \
200           Refiner.h RefinerApprox.h RefinerComm.h ObjGraph.h heap.h \
201           elements.h CommLBHeap.h topology.h manager.h \
202           BaseLB.h CentralLB.h CentralLBMsg.h RandCentLB.h RecBisectBfLB.h \
203           RefineLB.h RefineKLB.h RefineCommLB.h OrbLB.h \
204           GreedyLB.h GreedyCommLB.h GreedyAgentLB.h Comm1LB.h MetisLB.h \
205           TopoLB.h RefineTopoLB.h  TopoCentLB.h  PhasebyArrayLB.h RotateLB.h \
206           GridCommLB.h GridCommRefineLB.h GridMetisLB.h GridHybridLB.h GridHybridSeedLB.h \
207           DummyLB.h BlockLB.h NborBaseLB.h HybridBaseLB.h HybridLB.h HybridLBMsg.h HbmLB.h \
208           NeighborLB.h NeighborCommLB.h NeighborLBMsg.h WSLB.h \
209           BlueGene.h middle.h middle-conv.h middle-blue.h \
210           CkMarshall.decl.h CkArray.decl.h CkLocation.decl.h    \
211           CkReduction.decl.h CkArrayReductionMgr.decl.h\
212           tempo.decl.h waitqd.decl.h \
213           ControlPoints.decl.h \
214           CkFutures.decl.h CkCheckpoint.decl.h CkMemCheckpoint.decl.h \
215           LBDatabase.decl.h CentralLB.decl.h ComboCentLB.decl.h NullLB.decl.h \
216           RandCentLB.decl.h RecBisectBfLB.decl.h BaseLB.decl.h MetisLB.decl.h \
217           DummyLB.decl.h RotateLB.decl.h RefineLB.decl.h RefineKLB.decl.h BlockLB.decl.h \
218           RefineCommLB.decl.h OrbLB.decl.h GreedyLB.decl.h GreedyCommLB.decl.h \
219           Comm1LB.decl.h GreedyAgentLB.decl.h \
220           GridCommLB.decl.h GridCommRefineLB.decl.h GridMetisLB.decl.h GridHybridLB.decl.h \
221           GridHybridSeedLB.decl.h PhasebyArrayLB.decl.h TopoLB.decl.h RefineTopoLB.decl.h \
222           TopoCentLB.decl.h NborBaseLB.decl.h NeighborLB.decl.h \
223           NeighborCommLB.decl.h HbmLB.decl.h \
224           HybridBaseLB.decl.h HybridLB.decl.h WSLB.decl.h EveryLB.decl.h \
225           charisma.decl.h TraceSummary.decl.h TraceProjections.decl.h \
226           TraceSimple.decl.h TraceControlPoints.decl.h TraceTau.decl.h \
227           BlueGene.decl.h \
228           comlib.decl.h ComlibManager.h DummyStrategy.h \
229           DirectMulticastStrategy.h RingMulticastStrategy.h     \
230           MultiRingMulticast.h \
231           EachToManyMulticastStrategy.h MsgPacker.h StreamingStrategy.h \
232           NodeMulticast.h PipeBroadcastStrategy.h MeshStreamingStrategy.h \
233           PrioStreaming.h MPIStrategy.h MsgPacker.h StreamingStrategy.h \
234           BroadcastStrategy.h ComlibSectionInfo.h AAPLearner.h \
235           AAMLearner.h ComlibStats.h \
236           RectMulticastStrategy.h ckdirect.h \
237           $(CVHEADERS)
238
239 ALLHEADERS=$(CKHEADERS) \
240     simplemsg.h sm.h pvmc.h pvm3.h sdag.h \
241         graph.h bitvecset.h Set.h LBSimulation.h  \
242         $(BLUE_HEADERS)
243
244 basics: headers
245         touch basics
246
247 # Headers is used only for the dependencies
248 headers: dirs+sources
249         $(MAKE) headerlinks
250
251 conv-autoconfig.h: configure
252         ./configure
253
254 headerlinks: dirs+sources Makefile $(ALLHEADERS)
255         @echo "Soft-linking headers..."
256         -@for hdr in $(ALLHEADERS) ; do test ! -f "../include/$$hdr" && ./system_ln "../tmp/$$hdr" ../include ; done
257         touch headerlinks
258
259 dirs+sources:
260 #       rm -f .gdir
261 #       (cd .. ; basename "`pwd`" | sed -e 's@-.*@@')   > .gdir
262         pwd
263         find . -type l -exec rm {} \;
264         rm -rf QuickThreads
265         rm -rf libs
266         rm -rf ../bin ; mkdir ../bin
267         rm -rf ../lib ; mkdir ../lib
268         rm -rf ../lib_so ; mkdir ../lib_so; touch ../lib_so/.charmso
269         rm -rf ../examples
270         rm -rf ../tests
271         rm -rf ../doc ; ln -s ../doc ../doc
272         ../../src/scripts/gatherflat ../../src/scripts .
273         ./gatherflat ../../src/conv-core        .
274         ./gatherflat ../../src/conv-ldb         .
275         ./gatherflat ../../src/conv-ccs         .
276         ./gatherflat ../../src/conv-perf        .
277         ./gatherflat ../../src/ck-core          .
278         ./gatherflat ../../src/util             .
279         ./gatherflat ../../src/ck-perf          .
280         ./gatherflat ../../src/ck-ldb           .
281         ./gatherflat ../../src/ck-com           .
282         ./gatherflat ../../src/ck-cp           .
283         ./gatherflat ../../src/conv-com           .
284         ./gatherflat ../../src/langs/simplemsg  .
285         ./gatherflat ../../src/langs/pvmc       .
286         ./gatherflat ../../src/langs/bluegene   .
287         ./gatherflat ../../src/langs/f90charm   .
288         ./gatherflat ../../src/xlat-i           .
289         ./gatherflat ../../src/xlatcpm          .
290         ./gathertree ../../src/QuickThreads QuickThreads
291         ./gathertree ../../src/libs libs
292         ./gathertree ../../src/arch/util      .
293         ./gathertree ../../src/langs langs
294         ./gathertree ../../src/langs/jade langs/jade
295         ./gathertree ../../src/arch/common           .
296         ./gathertree ../../src/arch/`cat .gdir`      .
297         test -f ../../src/arch/`cat .gdir`/gdir_link && cat ../../src/arch/`cat .gdir`/gdir_link > .gdir.new && ./gathertree ../../src/arch/`cat .gdir.new`      . || true
298         ./gatherflat ../../src/arch/`cat .vdir`      .
299         ./gathertree ../../examples ../examples
300         ./gathertree ../../tests ../tests
301         rm -f ../bin/dep.pl ; cp dep.pl ../bin/
302         chmod +x charmc
303         -./system_ln  ../tmp/charmc ../bin/
304         -ln -s ../../java/bin charmjavabin
305         -ln -s ../../java/bin ../bin/charmjavabin
306         -ln -s charmjavabin/* ../bin/
307         -ln -s ../java ..
308 #       rm -f .gdir
309         rm -rf ../include ; mkdir ../include
310         -./system_ln  ../tmp/conv-*.*h ../include
311         -./system_ln  ../tmp/cc-*.*h ../include
312         if [ -x ./special.sh ] ; then ./special.sh ; fi
313         if [ ! -f conv-common.h ] ; then ( touch conv-common.h ) ; fi
314         touch dirs+sources
315
316 ###############################################################################
317 #
318 # Converse Libraries
319 #
320 ###############################################################################
321 CLBLIBS=$(L)/libldb-rand.o $(L)/libldb-spray.o $(L)/libldb-neighbor.o $(L)/libldb-none.o $(L)/libldb-test.o $(L)/libldb-bluegene.o
322 TRACELIBS=$(L)/libtrace-projections.a  $(L)/libtrace-summary.a \
323           $(L)/libtrace-simple.a $(L)/libtrace-controlPoints.a\
324           $(L)/libtrace-counter.a $(L)/libtrace-bluegene.a \
325           $(L)/libtrace-projector.a $(L)/libtrace-all.a $(L)/libtrace-converse.a \
326           $(L)/libtrace-recordreplay.a  $(L)/libtracef_f.a $(L)/libtrace-memory.a
327 MEMLIBS=$(L)/libmemory-default.o $(L)/libmemory-os.o $(L)/libmemory-gnu.o \
328           $(L)/libmemory-gnuold.o $(L)/libmemory-verbose.o      \
329           $(L)/libmemory-paranoid.o \
330           $(L)/libmemory-leak.o $(L)/libmemory-isomalloc.o \
331           $(L)/libmemory-charmdebug.o \
332           $(L)/libmemory-os-verbose.o $(L)/libmemory-os-isomalloc.o \
333           $(L)/libmemory-os-leak.o $(L)/libmemory-os-paranoid.o \
334           $(L)/libmemory-os-lock.o \
335           $(L)/libmemory-os-charmdebug.o $(L)/libmemory-os-wrapper.o
336 THREADLIBS=$(L)/libthreads-default.o $(L)/libthreads-qt.o       \
337           $(L)/libthreads-context.o $(L)/libthreads-uJcontext.o \
338           $(L)/libthreads-pthreads.o $(L)/libthreads-fibers.o \
339           $(L)/libthreads-stackcopy.o $(L)/libthreads-memoryalias.o \
340           $(L)/libthreads-qt-memoryalias.o      \
341           $(L)/libthreads-context-memoryalias.o \
342           $(L)/libthreads-uJcontext-memoryalias.o
343
344 CVLIBS=$(L)/libconv-core.a \
345         $(L)/libconv-cplus-y.a $(L)/libconv-cplus-n.a \
346         $(L)/libconv-util.a $(L)/libconv-utilf.a \
347         $(CLBLIBS) $(TRACELIBS) $(MEMLIBS) $(THREADLIBS) \
348         $(L)/libccs-client.a
349
350 LIBCONV_CORE= convcore.o conv-conds.o queueing.o msgmgr.o \
351         cpm.o cpthreads.o futures.o cldb.o topology.o random.o \
352         debug-conv.o generate.o edgelist.o conv-ccs.o ccs-builtins.o \
353         traceCore.o traceCoreCommon.o tracec.o \
354         converseProjections.o machineProjections.o \
355         quiescence.o isomalloc.o conv-counter.o \
356         global-nop.o cmipool.o cpuaffinity.o cputopology.o
357
358 #############################################
359 #
360 #Comlib Core objects
361 #
362 #############################################
363 #These go into libconv-util.a and are always linked
364 CONVERSE_COM_CORE_OBJS = convcomlibstrategy.o
365
366 #These go into libck.a
367 COMLIB_CORE_OBJS = ComlibStrategy.o ComlibArrayListener.o
368 ##############################################
369
370 LIBCONV_UTIL=pup_util.o pup_toNetwork.o pup_toNetwork4.o                \
371         pup_xlater.o pup_c.o pup_paged.o pup_cmialloc.o                 \
372         ckimage.o ckdll.o ckhashtable.o sockRoutines.o                  \
373         conv-lists.o RTH.o persist-comm.o $(CONVERSE_COM_CORE_OBJS) \
374         ckbitvector.o TopoManager.o CrayNid.o
375
376 LIBCONV_UTILF=pup_f.o
377
378 converse: fmain-ok charmrun-target swapglobal-target conv-cpm
379
380 charmrun-target: sockRoutines.c sockRoutines.h ccs-server.c ccs-server.h sockRoutines-seq.o $(L)/libck.a $(CVLIBS)
381         if [ -d charmrun ] ; then ( cd charmrun ; $(MAKE) OPTS='$(OPTS)' -j1 ) ; fi
382         if [ -f charmrun ] ; then ( cp -f charmrun ../bin ) ; fi
383
384 fmain-ok: fmain.f90
385         -@$(CHARMC) -c fmain.f90
386         -@cp fmain.o ../lib
387         -@touch fmain-ok
388
389 QUICKTHREADS: $(CVHEADERS)
390         -cd QuickThreads && make clean
391         cd QuickThreads;./configure
392         cd QuickThreads ; $(MAKE) qt  OPTS='$(OPTS)'
393         cp -f QuickThreads/libqt.a ../lib/libckqt.a
394         -(CHARMINC=.; . ./conv-config.sh; \
395           test -d ../lib_so && \
396           cp -f QuickThreads/libqt.$$CMK_SHARED_SUF ../lib_so && \
397           cp -f QuickThreads/libqt.$$CMK_SHARED_SUF ../lib_so/libckqt.$$CMK_SHARED_SUF)
398         touch QUICKTHREADS
399
400 METIS:  charm++
401         cd libs/ck-libs/parmetis/METISLib && $(MAKE) OPTS='$(OPTS)'
402
403 CONVLIBS: converse
404         cd libs; $(MAKE) convlibs OPTS='$(OPTS)'
405
406 $(L)/libconv-core.a: $(LIBCONV_CORE)
407         $(CHARMC) $(TAU_LIBS) -o $@ $(LIBCONV_CORE) 
408
409 $(L)/libconv-cplus-y.a: $(L)/libconv-cplus-n.a
410
411 include Makefile.machine
412
413 $(L)/libconv-cplus-n.a: machine.c $(CVHEADERS)
414         @-test -f $(INC)/mpi.h && mv -f $(INC)/mpi.h $(INC)/mpi.BAK || true
415         $(CHARMC) -o machine.o  -DFOR_CPLUS=1 machine.c
416         @-test -f ./bglmachine.C && $(CHARMC) -o machine.o  -DFOR_CPLUS=1 bglmachine.C || true
417         $(CHARMC) -o $(L)/libconv-cplus-y.a machine.o
418         $(CHARMC) -o $(L)/libconv-cplus-n.a -DFOR_CPLUS=0 machine.c
419         @-test -f $(INC)/mpi.BAK && mv -f $(INC)/mpi.BAK $(INC)/mpi.h || true
420
421 $(L)/libconv-util.a: $(LIBCONV_UTIL)
422         $(CHARMC) -o $@ $(LIBCONV_UTIL)
423
424 $(L)/libconv-utilf.a: $(LIBCONV_UTILF)
425         -$(CHARMC) -o $@ $(LIBCONV_UTILF) || touch $@
426
427 $(L)/libccs-client.a: ccs-client.o
428         $(CHARMC) -o $@ ccs-client.o
429
430 ccs-client.o: ccs-client.c $(CVHEADERS)
431         $(CHARMC) ccs-client.c
432
433 sockRoutines.o: sockRoutines.c $(CVHEADERS) $(UTILHEADERS)
434         $(CHARMC) -DCMK_USE_CONVERSE=1 sockRoutines.c
435
436 sockRoutines-seq.o: sockRoutines.c $(CVHEADERS) $(UTILHEADERS)
437         $(SEQCHARMC) -o sockRoutines-seq.o sockRoutines.c
438
439 pup_util.o: pup_util.C $(CVHEADERS) $(UTILHEADERS)
440         $(CHARMC) -o pup_util.o pup_util.C
441
442 pup_toNetwork.o: pup_toNetwork.C $(CVHEADERS) $(UTILHEADERS)
443         $(CHARMC) -o pup_toNetwork.o pup_toNetwork.C
444
445 pup_toNetwork4.o: pup_toNetwork4.C $(CVHEADERS) $(UTILHEADERS)
446         $(CHARMC) -o pup_toNetwork4.o pup_toNetwork4.C
447
448 pup_xlater.o: pup_xlater.C $(CVHEADERS) $(UTILHEADERS)
449         $(CHARMC) -o pup_xlater.o pup_xlater.C
450
451 pup_c.o: pup_c.C $(CVHEADERS) $(UTILHEADERS)
452         $(CHARMC) -o pup_c.o pup_c.C
453
454 pup_paged.o: pup_paged.C $(CVHEADERS) $(UTILHEADERS)
455         $(CHARMC) -o pup_paged.o pup_paged.C
456
457 pup_f.o: pup_f.f90 $(CVHEADERS)
458         -$(CHARMC) -c pup_f.f90 && $(CHARMC) -cpmod ../include pupmod.M || touch pup_f.o
459
460 pup_cmialloc.o: pup_cmialloc.C $(CVHEADERS) $(UTILHEADERS)
461         $(CHARMC) -o pup_cmialloc.o pup_cmialloc.C
462
463 ckhashtable.o: ckhashtable.C ckhashtable.h $(CVHEADERS)
464         $(CHARMC) -o ckhashtable.o ckhashtable.C
465
466 TopoManager.o: TopoManager.C TopoManager.h BGLTorus.h BGPTorus.h XT3Torus.h XT4Torus.h CrayNid.c $(CVHEADERS) $(UTILHEADERS)
467         $(CHARMC) -o TopoManager.o TopoManager.C
468
469 CrayNid.o: CrayNid.c $(CVHEADERS) $(UTILHEADERS)
470         $(CHARMC) -c -o CrayNid.o CrayNid.c
471
472 ckbitvector.o: ckbitvector.C ckbitvector.h $(CVHEADERS)
473         $(CHARMC) -o ckbitvector.o ckbitvector.C
474
475 ckdll.o: ckdll.C ckdll.h $(CVHEADERS)
476         $(CHARMC) -o ckdll.o ckdll.C
477
478 ckimage.o: ckimage.C ckimage.h $(CVHEADERS)
479         $(CHARMC) -o ckimage.o ckimage.C
480
481 RTH.o: RTH.C RTH.h $(CVHEADERS)
482         $(CHARMC) -o RTH.o RTH.C
483
484 persist-comm.o: persist-comm.c persist_impl.h $(CVHEADERS)
485         $(CHARMC) -o persist-comm.o persist-comm.c
486
487 conv-lists.o: conv-lists.C $(UTILHEADERS) $(CVHEADERS)
488         $(CHARMC) -o conv-lists.o conv-lists.C
489
490 ## Converse load balancers (seed balancers, -balance)
491 $(L)/libldb-none.o: cldb.none.c $(CVHEADERS)
492         $(CHARMC) -o $@ cldb.none.c
493
494 $(L)/libldb-rand.o: cldb.rand.c cldb.h $(CVHEADERS)
495         $(CHARMC) -o $@ cldb.rand.c
496
497 $(L)/libldb-neighbor.o: cldb.neighbor.c cldb.neighbor.h graph.h $(CVHEADERS)
498         $(CHARMC) -o $@ cldb.neighbor.c
499
500 $(L)/libldb-spray.o: cldb.spray.c $(CVHEADERS)
501         $(CHARMC) -o $@ cldb.spray.c
502
503 $(L)/libldb-test.o: cldb.test.c $(CVHEADERS)
504         $(CHARMC) -o $@ cldb.test.c
505
506 $(L)/libldb-bluegene.o: cldb.bluegene.c $(CVHEADERS)
507         $(CHARMC) -o $@ cldb.bluegene.c
508
509 ## Memory allocation libraries (-memory)
510 MEM_DEPS=memory.c memory-gnu.c memory-gnuold.c converse.h conv-mach.h $(CVHEADERS)
511 $(L)/libmemory-default.o: $(MEM_DEPS)
512         $(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_DEFAULT memory.c
513
514 $(L)/libmemory-os.o: $(MEM_DEPS)
515         $(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_OS memory.c
516
517 $(L)/libmemory-os-verbose.o: memory-verbose.c $(MEM_DEPS)
518         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_VERBOSE memory.c || touch $@
519
520 $(L)/libmemory-os-paranoid.o: memory-paranoid.c $(MEM_DEPS)
521         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_PARANOID memory.c || touch $@
522
523 $(L)/libmemory-os-leak.o: $(MEM_DEPS)
524         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_LEAK memory.c || touch $@
525
526 $(L)/libmemory-os-isomalloc.o: memory-isomalloc.c $(MEM_DEPS)
527         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_ISOMALLOC memory.c || touch $@
528
529 $(L)/libmemory-os-lock.o: memory-lock.c $(MEM_DEPS)
530         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_LOCK memory.c || touch $@
531
532 $(L)/libmemory-os-charmdebug.o: memory-charmdebug.c $(MEM_DEPS)
533         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_CHARMDEBUG memory.c || touch $@
534
535 $(L)/libmemory-os-wrapper.o: memory-os-wrapper.C $(MEM_DEPS)
536         -$(CHARMC) -o $@ memory-os-wrapper.C || touch $@
537
538 # If the system doesn't have sbrk, these compilations may fail.
539 #  This is OK, but then we can't use "-memory gnu" or friends.
540 $(L)/libmemory-gnu.o: $(MEM_DEPS)
541         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_GNU memory.c || touch $@
542
543 $(L)/libmemory-gnuold.o: $(MEM_DEPS)
544         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_GNUOLD memory.c || touch $@
545
546 $(L)/libmemory-verbose.o: memory-verbose.c $(MEM_DEPS)
547         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_VERBOSE memory.c || touch $@
548
549 $(L)/libmemory-paranoid.o: memory-paranoid.c $(MEM_DEPS)
550         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_PARANOID memory.c || touch $@
551
552 $(L)/libmemory-leak.o: memory-leak.c $(MEM_DEPS)
553         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_LEAK memory.c || touch $@
554
555 $(L)/libmemory-cache.o: memory-cache.c $(MEM_DEPS)
556         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_CACHE memory.c || touch $@
557
558 $(L)/libmemory-isomalloc.o: memory-isomalloc.c $(MEM_DEPS)
559         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_ISOMALLOC memory.c || touch $@
560
561 $(L)/libmemory-charmdebug.o: memory-charmdebug.c $(MEM_DEPS)
562         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_CHARMDEBUG memory.c || touch $@
563
564 ## Thread libraries (-thread)
565
566 LIBTHREADSDEPS := threads.c $(CVHEADERS) QUICKTHREADS
567
568 $(L)/libthreads-default.o: $(LIBTHREADSDEPS)
569         $(CHARMC) -o $@ -DCMK_THREADS_BUILD_DEFAULT=1 -IQuickThreads -I. threads.c
570
571 $(L)/libthreads-qt.o: $(LIBTHREADSDEPS) 
572         $(CHARMC) -o $@ -DCMK_THREADS_BUILD_QT=1 -IQuickThreads threads.c
573
574 $(L)/libthreads-context.o: $(LIBTHREADSDEPS) 
575         -$(CHARMC) -o $@ -DCMK_THREADS_BUILD_CONTEXT=1 -IQuickThreads threads.c || touch $@
576
577 $(L)/libthreads-uJcontext.o: $(LIBTHREADSDEPS) uJcontext.c
578         -$(CHARMC) -o $@ -DCMK_THREADS_BUILD_JCONTEXT=1 -IQuickThreads -I. threads.c || touch $@
579
580 $(L)/libthreads-pthreads.o: $(LIBTHREADSDEPS) 
581         -$(CHARMC) -o $@ -DCMK_THREADS_BUILD_PTHREADS=1 -IQuickThreads threads.c || touch $@
582
583 $(L)/libthreads-fibers.o: $(LIBTHREADSDEPS)
584         -$(CHARMC) -o $@ -DCMK_THREADS_BUILD_FIBERS=1 -IQuickThreads threads.c 2> /dev/null || touch $@
585
586 $(L)/libthreads-stackcopy.o: $(LIBTHREADSDEPS) 
587         -$(CHARMC) -o $@ -DCMK_THREADS_BUILD_STACKCOPY=1 -IQuickThreads threads.c || touch $@
588
589 $(L)/libthreads-memoryalias.o: $(LIBTHREADSDEPS) 
590         -$(CHARMC) -o $@ -DCMK_THREADS_ALIAS_STACK=1 -DCMK_THREADS_BUILD_DEFAULT=1 -IQuickThreads threads.c || touch $@
591
592 $(L)/libthreads-qt-memoryalias.o: $(LIBTHREADSDEPS) 
593         -$(CHARMC) -o $@ -DCMK_THREADS_ALIAS_STACK=1 -DCMK_THREADS_BUILD_QT=1 -IQuickThreads threads.c || touch $@
594
595 $(L)/libthreads-context-memoryalias.o: $(LIBTHREADSDEPS) 
596         -$(CHARMC) -o $@ -DCMK_THREADS_ALIAS_STACK=1 -DCMK_THREADS_BUILD_CONTEXT=1 -IQuickThreads threads.c || touch $@
597
598 $(L)/libthreads-uJcontext-memoryalias.o: $(LIBTHREADSDEPS) 
599         -$(CHARMC) -o $@ -DCMK_THREADS_ALIAS_STACK=1 -DCMK_THREADS_BUILD_JCONTEXT=1 -IQuickThreads -I. threads.c || touch $@
600
601 ## Global swapping (-swapglobal)
602 swapglobal-target: $(L)/libglobal-swap.o $(L)/libglobal-copy.o $(L)/loadsym.o
603
604 $(L)/libglobal-swap.o: global-elfgot.C $(CVHEADERS)
605         -$(CHARMC) -c global-elfgot.C -o $@ || touch $@
606
607 $(L)/libglobal-copy.o: global-elfcopy.C  $(CVHEADERS)
608         -$(CHARMC) -c global-elfcopy.C -o $@ || touch $@
609
610 $(L)/loadsym.o: loadsym.c  $(CVHEADERS)
611         -$(CHARMC) -c loadsym.c -o $@ || touch $@
612
613 ###############################################################################
614 #
615 # Charm Libraries
616 #
617 ###############################################################################
618
619 CK_LIBS_CORE=$(L)/libck.a
620
621 LIBCK_CORE=trace-common.o tracef.o init.o register.o qd.o ck.o main.o  \
622            msgalloc.o ckfutures.o ckIgetControl.o debug-message.o debug-charm.o ckcallback.o \
623            cklocation.o ckarray.o ckreduction.o ckarrayreductionmgr.o\
624            tempo.o waitqd.o LBDatabase.o lbdb.o lbdbf.o charisma.o ckobjQ.o  \
625            LBAgent.o LBProfit.o ckcheckpoint.o ckmemcheckpoint.o ckevacuation.o\
626            LBDBManager.o LBComm.o LBObj.o LBMachineUtil.o CentralPredictor.o \
627            BaseLB.o CentralLB.o HybridBaseLB.o NborBaseLB.o WSLB.o \
628            ObjGraph.o graph.o LButil.o Refiner.o RefinerApprox.o  \
629            RefinerComm.o bitvecset.o Set.o heap.o CommLBHeap.o \
630            NullLB.o LBSimulation.o $(COMLIB_CORE_OBJS) \
631            charmProjections.o
632
633 charm-target: converse $(L)/libck.a $(L)/libckf.a loadbalancers default_libs comlib_objs controlPoints_objs
634
635 CHARMLIBS: charm++ CONVLIBS
636         cd libs; $(MAKE) charmlibs OPTS='$(OPTS)'
637
638 $(L)/libck.a: $(LIBCK_CORE)
639         $(CHARMC) -o $@ $(LIBCK_CORE)
640
641 CkFutures.def.h: CkFutures.decl.h
642
643 CkFutures.decl.h: ckfutures.ci charmxi
644         $(CHARMXI) ckfutures.ci
645
646 tempo.def.h: tempo.decl.h
647
648 tempo.decl.h: tempo.ci charmxi
649         $(CHARMXI) tempo.ci
650
651 waitqd.def.h: waitqd.decl.h
652
653 waitqd.decl.h: waitqd.ci charmxi
654         $(CHARMXI) waitqd.ci
655
656 LBDatabase.def.h: LBDatabase.decl.h
657
658 LBDatabase.decl.h: LBDatabase.ci charmxi
659         $(CHARMXI) LBDatabase.ci
660
661 NullLB.def.h: NullLB.decl.h
662
663 NullLB.decl.h: NullLB.ci charmxi
664         $(CHARMXI) NullLB.ci
665
666 BaseLB.def.h: BaseLB.decl.h
667
668 BaseLB.decl.h: BaseLB.ci charmxi
669         $(CHARMXI) BaseLB.ci
670
671 TraceProjections.def.h: TraceProjections.decl.h
672
673 TraceProjections.decl.h: trace-projections.ci charmxi
674         $(CHARMXI) trace-projections.ci
675
676 TraceSummary.def.h: TraceSummary.decl.h
677
678 TraceSummary.decl.h: trace-summary.ci charmxi
679         $(CHARMXI) trace-summary.ci
680
681 TraceSimple.def.h: TraceSimple.decl.h
682
683 TraceSimple.decl.h: trace-simple.ci charmxi
684         $(CHARMXI) trace-simple.ci
685
686 TraceTau.def.h: TraceTau.decl.h
687
688 TraceTau.decl.h: trace-Tau.ci charmxi
689         $(CHARMXI) trace-Tau.ci
690
691 TraceControlPoints.def.h: TraceControlPoints.decl.h
692
693 TraceControlPoints.decl.h: trace-controlPoints.ci charmxi
694         $(CHARMXI) trace-controlPoints.ci
695
696 CkReduction.def.h: CkReduction.decl.h
697
698 CkReduction.decl.h: ckreduction.ci charmxi
699         $(CHARMXI) ckreduction.ci
700
701 CkCheckpoint.def.h: CkCheckpoint.decl.h
702
703 CkCheckpoint.decl.h: ckcheckpoint.ci charmxi
704         $(CHARMXI) ckcheckpoint.ci
705
706 CkMemCheckpoint.def.h: CkMemCheckpoint.decl.h
707
708 CkMemCheckpoint.decl.h: ckmemcheckpoint.ci charmxi
709         $(CHARMXI) ckmemcheckpoint.ci
710
711 CkMarshall.def.h: CkMarshall.decl.h
712
713 CkMarshall.decl.h: ckmarshall.ci charmxi
714         $(CHARMXI) ckmarshall.ci
715
716 CkArrayReductionMgr.def.h: CkArrayReductionMgr.decl.h
717
718 CkArrayReductionMgr.decl.h: ckarrayreductionmgr.ci charmxi
719         $(CHARMXI) ckarrayreductionmgr.ci
720
721 CkArray.def.h: CkArray.decl.h
722
723 CkArray.decl.h : ckarray.ci charmxi
724         $(CHARMXI) ckarray.ci
725
726 CkLocation.def.h: CkLocation.decl.h
727
728 CkLocation.decl.h: cklocation.ci charmxi
729         $(CHARMXI) cklocation.ci
730
731 CkCallback.def.h: CkCallback.decl.h
732
733 CkCallback.decl.h: ckcallback.ci charmxi
734         $(CHARMXI) ckcallback.ci
735
736 charisma.def.h: charisma.decl.h
737
738 charisma.decl.h: charisma.ci charmxi
739         $(CHARMXI) charisma.ci
740
741 ## Charm++ Load balancer (Dynamic load balancer)
742
743 CentralLB.def.h: CentralLB.decl.h
744
745 CentralLB.decl.h: CentralLB.ci charmxi
746         $(CHARMXI) CentralLB.ci
747
748 NborBaseLB.def.h: NborBaseLB.decl.h
749
750 NborBaseLB.decl.h: NborBaseLB.ci charmxi
751         $(CHARMXI) NborBaseLB.ci
752
753 HybridBaseLB.def.h: HybridBaseLB.decl.h
754
755 HybridBaseLB.decl.h: HybridBaseLB.ci charmxi
756         $(CHARMXI) HybridBaseLB.ci
757
758 ## Charm fortran AMPI
759
760 CK_FOR_LIBS_CORE=$(L)/libckf.a
761
762 LIBCKF_CORE=charmf.o charmmod.o
763
764 $(L)/libckf.a: $(LIBCKF_CORE)
765         -$(CHARMC) -o $@ $(LIBCKF_CORE) || touch $@
766
767 charmf.o:  charmf.C $(CKHEADERS) charmf.h
768         $(CHARMC) -c -I. charmf.C
769
770 charmmod.o: charmmod.f90
771         -$(CHARMC) -c charmmod.f90 || touch $@
772         -$(CHARMC) -cpmod ../include charm.M
773
774 ## Tracing libraries (profiling, -tracemode)
775 LIBTRACE_PROJ=trace-projections.o
776 $(L)/libtrace-projections.a: $(LIBTRACE_PROJ)
777         $(CHARMC) -o $@ $(LIBTRACE_PROJ)
778
779 LIBTRACE_SUMM=trace-summary.o
780 $(L)/libtrace-summary.a: $(LIBTRACE_SUMM)
781         $(CHARMC) -o $@ $(LIBTRACE_SUMM)
782
783 LIBTRACE_SIMPLE=trace-simple.o
784 $(L)/libtrace-simple.a: $(LIBTRACE_SIMPLE)
785         $(CHARMC) -o $@ $(LIBTRACE_SIMPLE)
786
787 libtrace-Tau.o: trace-Tau.C charm++.h charm.h converse.h conv-config.h \
788   conv-autoconfig.h conv-common.h conv-mach.h conv-mach-opt.h \
789   conv-mach-ifort.h pup_c.h conv-cpm.h conv-cpath.h conv-qd.h \
790   conv-random.h conv-lists.h conv-trace.h persistent.h debug-conv.h pup.h \
791   middle.h middle-conv.h cklists.h ckbitvector.h ckstream.h init.h \
792   ckhashtable.h debug-charm.h CkMarshall.decl.h cksection.h ckcallback.h \
793   conv-ccs.h sockRoutines.h ccs-server.h ckobjQ.h ckreduction.h \
794   CkReduction.decl.h cknodegroupreduction.h CkArrayReductionMgr.decl.h \
795   ckmemcheckpoint.h CkMemCheckpoint.decl.h readonly.h ckarray.h \
796   cklocation.h LBDatabase.h lbdb.h LBDBManager.h LBObj.h LBOM.h LBComm.h \
797   LBMachineUtil.h lbdb++.h LBDatabase.decl.h NullLB.decl.h BaseLB.decl.h \
798   CkLocation.decl.h CkArray.decl.h ComlibArrayListener.h ComlibStrategy.h \
799   convcomlibstrategy.h ComlibLearner.h envelope.h CkFutures.decl.h \
800   charisma.h charisma.decl.h tempo.h tempo.decl.h waitqd.h waitqd.decl.h \
801   sdag.h ckcheckpoint.h CkCheckpoint.decl.h ckevacuation.h \
802   ckarrayreductionmgr.h trace.h trace-bluegene.h trace-simple.h \
803   register.h trace-common.h trace-simpleBOC.h TraceSimple.decl.h \
804   TraceSimple.def.h
805         $(CHARMC) -c -I. $(TAU_INCLUDE) $(TAU_DEFS) trace-Tau.C -o libtrace-Tau.o
806
807 tau_selective.o: $(TAUROOT)/utils/tau_selective.cpp 
808         $(CHARMC) -I$(TAUROOT)/utils -DTAU_DYNINST $(TAUROOT)/utils/tau_selective.cpp
809
810 $(L)/libtrace-Tau.a: $(TAU_TRACE_OBJ) tau_selective.o
811         $(CHARMC) $(TAU_LIBS) -o $@ $(TAU_TRACE_OBJ) tau_selective.o $(TAU_TRACE_OBJ)
812
813 LIBTRACE_CONTROLPOINTS=trace-controlPoints.o
814 $(L)/libtrace-controlPoints.a: $(LIBTRACE_CONTROLPOINTS)
815         $(CHARMC) -o $@ $(LIBTRACE_CONTROLPOINTS)
816
817 LIBTRACE_RECREP=trace-recordreplay.o
818 $(L)/libtrace-recordreplay.a: $(LIBTRACE_RECREP)
819         $(CHARMC) -o $@ $(LIBTRACE_RECREP)
820
821 LIBTRACE_COUNT=trace-counter.o
822 $(L)/libtrace-counter.a: $(LIBTRACE_COUNT)
823         $(CHARMC) -o $@ $(LIBTRACE_COUNT)
824
825 LIBTRACE_BG=trace-bluegene.o
826 $(L)/libtrace-bluegene.a:$(LIBTRACE_BG)
827         $(CHARMC) -o $@ $(LIBTRACE_BG)
828
829 LIBTRACE_MEMORY=trace-memory.o
830 $(L)/libtrace-memory.a: $(LIBTRACE_MEMORY)
831         $(CHARMC) -o $@ $(LIBTRACE_MEMORY)
832
833 LIBTRACE_ALL=trace-all.o trace-projections.o trace-summary.o trace-simple.o \
834 $(TAU_TRACE_OBJ) trace-recordreplay.o trace-projector.o traceCore.o traceCoreCommon.o charmProjections.o converseProjections.o machineProjections.o trace-memory.o trace-controlPoints.o
835
836 $(L)/libtrace-all.a: $(LIBTRACE_ALL)
837         $(CHARMC) -o $@ $(LIBTRACE_ALL)
838
839 LIBTRACE_PROJECTOR=trace-projector.o traceCore.o traceCoreCommon.o charmProjections.o converseProjections.o machineProjections.o
840 $(L)/libtrace-projector.a: $(LIBTRACE_PROJECTOR)
841         $(CHARMC) -o  $@ $(LIBTRACE_PROJECTOR)
842
843 LIBTRACE_CONVERSE=trace-converse.o
844 $(L)/libtrace-converse.a: $(LIBTRACE_CONVERSE)
845         $(CHARMC) -o  $@ $(LIBTRACE_CONVERSE)
846
847 LIBTRACE_FOR=tracef_f.o
848 $(L)/libtracef_f.a: $(LIBTRACE_FOR)
849         -$(CHARMC) -o $@ $(LIBTRACE_FOR) || touch $@
850
851 tracef_f.o: tracef_f.f90
852         -$(CHARMC) -o $@ -c tracef_f.f90 && $(CHARMC) -cpmod ../include tracemod.M  || touch $@
853
854 # used for make depends
855 TRACE_OBJS =  trace-projections.o  trace-summary.o  trace-simple.o \
856               trace-counter.o trace-controlPoints.o     \
857               trace-bluegene.o trace-projector.o trace-converse.o trace-all.o \
858               trace-recordreplay.o trace-memory.o
859
860 ######################################################################
861 #
862 #Control Point Library
863 #
864 ######################################################################
865
866
867 CONTROLPOINTS_OBJS = controlPoints.o
868
869 ControlPoints.def.h: ControlPoints.decl.h
870
871 ControlPoints.decl.h : controlPoints.ci charmxi
872         $(CHARMXI) controlPoints.ci
873
874 controlPoints_objs: $(L)/libmoduleControlPoints.a
875
876 $(L)/libmoduleControlPoints.a: $(CONTROLPOINTS_OBJS)
877         $(CHARMC) -o $(L)/libmoduleControlPoints.a $(CONTROLPOINTS_OBJS)
878
879
880 ###############################################################################
881 #
882 # Dynamic Load Balancers
883 #
884 ###############################################################################
885
886
887 # Automatically generated by script Makefile_lb.sh
888 include Make.lb
889
890 loadbalancers: $(LOADBALANCERS) $(L)/libmoduleEveryLB.a
891
892
893 ######################################################################
894 #
895 #Communication Optimization Library
896 #
897 ######################################################################
898
899 STRATEGY_OBJS = MPIStrategy.o StreamingStrategy.o \
900                 DummyStrategy.o NodeMulticast.o \
901                 EachToManyMulticastStrategy.o ComlibSectionInfo.o \
902                 AAPLearner.o ComlibStats.o AAMLearner.o \
903                 MsgPacker.o DirectMulticastStrategy.o \
904                 RingMulticastStrategy.o MultiRingMulticast.o\
905                 PipeBroadcastStrategy.o MeshStreamingStrategy.o \
906                 PrioStreaming.o BroadcastStrategy.o RectMulticastStrategy.o
907
908 CONVERSE_COM_OBJS = gridrouter.o de.o treerouter.o petable.o \
909         3dgridrouter.o graphrouter.o hypercubetopology.o \
910         routerstrategy.o convcomlibmanager.o pipebroadcastconverse.o \
911         pipelinestrategy.o prefixrouter.o
912
913 comlib.def.h: comlib.decl.h
914
915 comlib.decl.h : ComlibManager.ci charmxi
916         $(CHARMXI) ComlibManager.ci
917
918 COMLIB_OBJS = ComlibManager.o $(STRATEGY_OBJS) $(CONVERSE_COM_OBJS)
919
920 comlib_objs: $(L)/libmodulecomlib.a $(L)/libconvcom.a
921
922 $(L)/libconvcom.a: $(COMLIB_OBJS)
923         $(CHARMC) -o $(L)/libconvcom.a $(CONVERSE_COM_OBJS)
924
925 #for backward compatibility, keep libmodulecommlib.a with double m.
926 $(L)/libmodulecomlib.a: $(COMLIB_OBJS)
927         $(CHARMC) -o $(L)/libmodulecomlib.a $(COMLIB_OBJS)
928         $(CHARMC) -o $(L)/libmodulecommlib.a $(COMLIB_OBJS)
929
930 ###############################################################################
931 #
932 # BlueGene Emulator
933 #
934 ###############################################################################
935
936 bigsim:  bigsim-target
937
938 bigemulator: bigsim
939
940 bigsim-target: charm++ $(L)/libconv-bigsim.a $(L)/libconv-bigsim-logs.a $(L)/libconv-bluegene-stub.a $(L)/libblue-standalone.a METIS
941
942 # old (Charm++) Blue Gene emulator
943 BlueGene.decl.h BlueGene.def.h : BlueGene.ci charmxi
944         $(CHARMXI) BlueGene.ci
945
946 $(L)/libbluegene.a: BlueGene.C BlueGene.h BlueGene.decl.h BlueGene.def.h
947         $(CHARMC) -c BlueGene.C
948         $(CHARMC) -o $@ BlueGene.o
949
950 # (Converse) Blue Gene emulator
951 BLUE_HEADERS = blue_types.h bigsim_timing.h blue_defs.h bigsim_logs.h blue.h blue_impl.h bigsim_network.h shared-alloc.h
952 BLUE_OBJS = blue.o bigsim_node.o bigsim_proc.o bigsim_init.o bigsim_timing.o shared_alloc.o
953 BIGSIM_IO_OBJS = bigsim_read.o bigsim_logs.o bigsim_api.o
954
955 LIBBLUE_OBJS = $(BLUE_OBJS) $(BIGSIM_IO_OBJS) blue_stub.o blue_standalone.o
956
957 $(L)/libconv-bigsim.a: $(BLUE_OBJS)
958         $(CHARMC) -o $@  $(BLUE_OBJS)
959
960 $(L)/libconv-bigsim-logs.a: $(BIGSIM_IO_OBJS)
961         $(CHARMC) -o $@  $(BIGSIM_IO_OBJS)
962
963 $(L)/libconv-bluegene-stub.a:  blue_stub.o
964         $(CHARMC) -o $@  blue_stub.o
965
966 $(L)/libblue-standalone.a: blue_standalone.o
967         $(CHARMC) -o $@  blue_standalone.o
968
969 ###############################################################################
970 #
971 # The CPM scanner
972 #
973 ###############################################################################
974
975 conv-cpm: conv-cpm.o
976         $(NATIVECHARMC) -language c -o conv-cpm -cp ../bin/ conv-cpm.o
977
978 conv-cpm.o: conv-cpm.c $(CVHEADERS)
979         $(NATIVECHARMC) conv-cpm.c
980
981 ###############################################################################
982 #
983 # The interface translator
984 #
985 ###############################################################################
986
987 XIHEADERS=conv-autoconfig.h xi-symbol.h xi-util.h xi-grammar.tab.h
988 CHARMXIOBJ=xi-main.o xi-symbol.o xi-grammar.tab.o xi-scan.o xi-util.o
989 SDAGOBJ=sdag-globals.o CSdagConstruct.o CEntry.o
990 SDAGHEADERS= CToken.h EToken.h CParsedFile.h \
991         sdag-globals.h CEntry.h
992
993 charmxi: ../bin/charmxi
994
995 ../bin/charmxi: $(CHARMXIOBJ) $(SDAGOBJ)
996         $(NATIVECHARMC) -language c++ -cp ../bin/ -o charmxi $(CHARMXIOBJ) $(SDAGOBJ)
997
998 xi-main.o: xi-main.C $(XIHEADERS) $(SDAGHEADERS)
999         $(NATIVECHARMC) xi-main.C
1000
1001 xi-symbol.o: xi-symbol.C $(XIHEADERS) $(SDAGHEADERS)
1002         $(NATIVECHARMC) xi-symbol.C
1003
1004 xi-util.o: xi-util.C $(XIHEADERS) $(SDAGHEADERS)
1005         $(NATIVECHARMC) xi-util.C
1006
1007 xi-grammar.tab.o: xi-grammar.tab.C $(XIHEADERS) $(SDAGHEADERS)
1008         $(NATIVECHARMC) xi-grammar.tab.C
1009
1010 xi-scan.o: xi-scan.C $(XIHEADERS) $(SDAGHEADERS)
1011         $(NATIVECHARMC) -I. -DYY_NEVER_INTERACTIVE xi-scan.C
1012
1013 sdag-globals.o: sdag-globals.C $(XIHEADERS) $(SDAGHEADERS)
1014         $(NATIVECHARMC) -c sdag-globals.C
1015
1016 CSdagConstruct.o: CSdagConstruct.C $(XIHEADERS) $(SDAGHEADERS)
1017         $(NATIVECHARMC) -c CSdagConstruct.C
1018
1019 CEntry.o: CEntry.C $(XIHEADERS) $(SDAGHEADERS)
1020         $(NATIVECHARMC) -c CEntry.C
1021
1022 ###############################################################################
1023 #
1024 # Simple Messaging
1025 #
1026 ###############################################################################
1027
1028 $(L)/libtsm.a: converse simplemsg.c simplemsg.h
1029         $(CHARMC) -o $@ simplemsg.c
1030
1031 $(L)/libsm.a: converse sm.c sm.h
1032         $(CHARMC) -o $@ sm.c
1033
1034 ###############################################################################
1035 #
1036 # PVM
1037 #
1038 ###############################################################################
1039
1040 PVMC=pvmc_buf.o pvmc_comm.o pvmc_conv.o pvmc_main.o pvmc_pack.o pvmc_groups.o
1041
1042 $(L)/libpvmc.a: $(PVMC)
1043         $(CHARMC) -o $@ $(PVMC)
1044
1045 pvmc_buf.o: pvmc_buf.c pvmc.h pvm3.h converse.h
1046         $(CHARMC) -o $@ pvmc_buf.c
1047
1048 pvmc_conv.o: pvmc_conv.c pvmc.h pvm3.h converse.h
1049         $(CHARMC) -o $@ pvmc_conv.c
1050
1051 pvmc_pack.o: pvmc_pack.c pvmc.h pvm3.h converse.h
1052         $(CHARMC) -o $@ pvmc_pack.c
1053
1054 pvmc_comm.o: pvmc_comm.c pvmc.h pvm3.h converse.h
1055         $(CHARMC) -o $@ pvmc_comm.c
1056
1057 pvmc_groups.o: pvmc_groups.c pvmc.h pvm3.h converse.h
1058         $(CHARMC) -o $@ pvmc_groups.c
1059
1060 pvmc_main.o: pvmc_main.c pvmc.h pvm3.h converse.h
1061         $(CHARMC) -o $@ pvmc_main.c
1062
1063 $(L)/libf90charm.a: charmxi f90main.ci f90main.h f90main.C futil.f90
1064         $(CHARMC) f90main.ci
1065         $(CHARMC) -c -DAMPI_FORTRAN=1 f90main.C
1066         -$(CHARMC) -c futil.f90
1067         -$(CHARMC) -o $@ f90main.o futil.o
1068
1069 ###############################################################################
1070 #
1071 # Make clean
1072 #
1073 ###############################################################################
1074
1075 install:
1076         @test ! -d $(DESTDIR)/include && mkdir -p $(DESTDIR)/include || true
1077         @test ! -d $(DESTDIR)/lib && mkdir -p $(DESTDIR)/lib || true
1078         @test ! -d $(DESTDIR)/lib_so && mkdir -p $(DESTDIR)/lib_so || true
1079         @test ! -d $(DESTDIR)/bin && mkdir -p $(DESTDIR)/bin || true
1080         cp -f ../include/*   $(DESTDIR)/include
1081         cp -f ../lib/*       $(DESTDIR)/lib
1082         cp -f ../lib_so/*    $(DESTDIR)/lib_so
1083 #       cp -f ../bin/*       $(DESTDIR)/bin
1084         for f in ../bin/*; do if test -f $$f; then cp -f $$f $(DESTDIR)/bin; fi; done
1085
1086
1087 clean:
1088         rm -f conv-autoconfig.h config.cache
1089         rm -f QuickThreads/libqt.a
1090         rm -f charmxi conv-cpm
1091         rm -f TAGS basics cmk_extras core
1092         rm -f core *.a
1093         rm -f core *.o
1094         rm -f core #*#
1095         rm -f core *~
1096         if [ -d charmrun ] ; then ( cd charmrun; make clean ) ; fi
1097         -( cd doc && make clean )
1098         ( cd libs; make clean )
1099         ( cd ../examples && make clean )
1100         ( cd ../tests && make clean )
1101
1102 veryclean:
1103         rm -rf ../bin
1104         rm -rf ../lib
1105         rm -rf ../src
1106         rm -rf ../examples
1107         rm -rf ../tests
1108         rm -rf ../include
1109         rm -rf ../doc
1110         mv Makefile .Makefile
1111         mv Make.depends .Make.depends
1112         rm -rf [a-z]* [A-Z]*
1113         mv .Make.depends Make.depends
1114         rm -rf .[a-z]* .[A-Z]*
1115
1116
1117 config: configure.in
1118         autoconf && autoheader
1119
1120 depends: basics
1121         echo "Creating " $(DEPENDFILE) " ...";
1122         if [ -f $(DEPENDFILE) ]; then \
1123            /bin/cp -f $(DEPENDFILE) $(DEPENDFILE).old; \
1124         fi; \
1125         echo '#generated by make depends' > $(DEPENDFILE); \
1126         processFiles='';        \
1127         for i in $(LIBCONV_CORE) $(TRACE_OBJS) $(LIBCK_CORE) $(LB_OBJ) $(LIBBLUE_OBJS) $(CONVERSE_COM_CORE_OBJS) $(COMLIB_OBJS) $(CONTROLPOINTS_OBJS); do \
1128               processed='false';        \
1129               for f in $$processFiles; do       \
1130                 if test $$i = $$f ; then        \
1131                   processed=true;  break;       \
1132                 fi;     \
1133               done;     \
1134               test $$processed = 'true'  && continue;   \
1135               processFiles="$$processFiles $$i";        \
1136               SRCFILE=`basename $$i .o`.C ; \
1137               [ ! -f $$SRCFILE ] && SRCFILE=`basename $$i .o`.c ;       \
1138               echo "checking dependencies for $$SRCFILE" ; \
1139               if g++ -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE  >> $(DEPENDFILE); then   echo '        $$(CHARMC) -c -I. '$$SRCFILE >> $(DEPENDFILE) ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi;  \
1140               echo '' >> $(DEPENDFILE) ; \
1141         done;
1142
1143
1144 dependsCaseSensitive: basics
1145         echo "Creating " $(DEPENDFILE) " ...";
1146         if [ -f $(DEPENDFILE) ]; then \
1147            /bin/cp -f $(DEPENDFILE) $(DEPENDFILE).old; \
1148         fi; \
1149         echo '#generated by make depends' > $(DEPENDFILE); \
1150         processFiles='';        \
1151         for i in $(LIBCONV_CORE) $(TRACE_OBJS) $(LIBCK_CORE) $(LB_OBJ) $(LIBBLUE_OBJS) $(CONVERSE_COM_CORE_OBJS) $(COMLIB_OBJS) $(CONTROLPOINTS_OBJS); do \
1152               processed='false';        \
1153               for f in $$processFiles; do       \
1154                 if test $$i = $$f ; then        \
1155                   processed=true;  break;       \
1156                 fi;     \
1157               done;     \
1158               test $$processed = 'true'  && continue;   \
1159               processFiles="$$processFiles $$i";        \
1160               SRCFILE=`basename $$i .o`.C ; \
1161               SRCDIR=`dirname $$i` ; \
1162               found=`/usr/bin/find $$SRCDIR -depth 1 -name $$SRCFILE`; \
1163               [ ! $$found ] && SRCFILE=`basename $$i .o`.c ; \
1164               echo "checking dependencies for $$SRCFILE" ; \
1165               if g++ -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE  >> $(DEPENDFILE); then   echo '        $$(CHARMC) -c -I. '$$SRCFILE >> $(DEPENDFILE) ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi;  \
1166               echo '' >> $(DEPENDFILE) ; \
1167         done;
1168