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