a9edf973fa81d0467729d73332de8bf3045eca64
[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=Make.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-common.h trace-bluegene.h trace-projections.h  \
171       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         3dgridrouter.h hypercuberouter.h hypercubetopology.h    \
178         routerstrategy.h convcomlibstrategy.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 cmidirectmanytomany.h \
182       controlPoints.h arrayRedistributor.h controlPoints.h pathHistory.h
183
184 # The .c files are there to be #included by clients whole
185 # This is a bit unusual, but makes client linking simpler.
186 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\
187         ckimage.h ckdll.h ckhashtable.h ckbitvector.h cklists.h ckliststring.h \
188         ckstatistics.h ckvector3d.h conv-lists.h RTH.h ckcomplex.h \
189         sockRoutines.h sockRoutines.c ckpool.h BGLTorus.h BGPTorus.h \
190         TopoManager.h XT3Torus.h XT4Torus.h cmimemcpy.h simd.h SSE-Double.h SSE-Float.h
191
192 CKHEADERS=ck.h ckstream.h envelope-path.h envelope.h envelope-path.h init.h qd.h charm.h charm++.h \
193           ckfutures.h ckIgetControl.h \
194           ckcallback.h CkCallback.decl.h ckcallback-ccs.h       \
195           ckarrayreductionmgr.h cknodegroupreduction.h cksection.h \
196           ckarray.h cklocation.h ckreduction.h ckcheckpoint.h ckmemcheckpoint.h ckevacuation.h\
197                 ckmessagelogging.h ckobjid.h\
198           ckobjQ.h readonly.h charisma.h ComlibArrayListener.h ComlibStrategy.h \
199           ComlibLearner.h $(UTILHEADERS) \
200           tempo.h waitqd.h LBDatabase.h lbdb.h lbdb++.h LBProfit.h \
201           LBDBManager.h LBComm.h LBOM.h LBObj.h LBMachineUtil.h LBAgent.h \
202           Refiner.h RefinerApprox.h RefinerComm.h ObjGraph.h heap.h \
203           elements.h CommLBHeap.h topology.h manager.h \
204           BaseLB.h CentralLB.h CentralLBMsg.h RandCentLB.h RecBisectBfLB.h \
205           RefineLB.h RefineKLB.h RefineCommLB.h OrbLB.h \
206           GreedyLB.h GreedyCommLB.h GreedyAgentLB.h Comm1LB.h MetisLB.h \
207           TopoLB.h RefineTopoLB.h  TopoCentLB.h  PhasebyArrayLB.h RotateLB.h \
208           GridCommLB.h GridCommRefineLB.h GridMetisLB.h GridHybridLB.h GridHybridSeedLB.h \
209           DummyLB.h BlockLB.h NborBaseLB.h HybridBaseLB.h HybridLB.h HybridLBMsg.h HbmLB.h \
210           NeighborLB.h NeighborCommLB.h NeighborLBMsg.h WSLB.h \
211           BlueGene.h middle.h middle-conv.h middle-blue.h \
212           CkMarshall.decl.h CkArray.decl.h CkLocation.decl.h    \
213           CkReduction.decl.h CkArrayReductionMgr.decl.h\
214           tempo.decl.h waitqd.decl.h \
215           ControlPoints.decl.h \
216           CkFutures.decl.h CkCheckpoint.decl.h CkMemCheckpoint.decl.h \
217           LBDatabase.decl.h CentralLB.decl.h ComboCentLB.decl.h NullLB.decl.h \
218           RandCentLB.decl.h RecBisectBfLB.decl.h BaseLB.decl.h MetisLB.decl.h \
219           DummyLB.decl.h RotateLB.decl.h RefineLB.decl.h RefineKLB.decl.h BlockLB.decl.h \
220           RefineCommLB.decl.h OrbLB.decl.h GreedyLB.decl.h GreedyCommLB.decl.h \
221           Comm1LB.decl.h GreedyAgentLB.decl.h \
222           GridCommLB.decl.h GridCommRefineLB.decl.h GridMetisLB.decl.h GridHybridLB.decl.h \
223           GridHybridSeedLB.decl.h PhasebyArrayLB.decl.h TopoLB.decl.h RefineTopoLB.decl.h \
224           TopoCentLB.decl.h NborBaseLB.decl.h NeighborLB.decl.h \
225           NeighborCommLB.decl.h HbmLB.decl.h \
226           HybridBaseLB.decl.h HybridLB.decl.h WSLB.decl.h EveryLB.decl.h \
227           charisma.decl.h TraceSummary.decl.h TraceProjections.decl.h \
228           TraceSimple.decl.h TraceControlPoints.decl.h TraceTau.decl.h \
229           TraceUtilization.decl.h BlueGene.decl.h \
230           comlib.decl.h ComlibManager.h DummyStrategy.h \
231           MulticastStrategy.h DirectMulticastStrategy.h RingMulticastStrategy.h \
232           OneTimeMulticastStrategy.h MultiRingMulticast.h \
233           EachToManyMulticastStrategy.h MsgPacker.h StreamingStrategy.h \
234           NodeMulticast.h PipeBroadcastStrategy.h MeshStreamingStrategy.h \
235           PrioStreaming.h MPIStrategy.h MsgPacker.h StreamingStrategy.h \
236           BroadcastStrategy.h ComlibSectionInfo.h AAPLearner.h \
237           AAMLearner.h ComlibStats.h \
238           RectMulticastStrategy.h ckdirect.h \
239           $(CVHEADERS)
240
241 ALLHEADERS=$(CKHEADERS) \
242     simplemsg.h sm.h pvmc.h pvm3.h sdag.h \
243         graph.h bitvecset.h Set.h LBSimulation.h  \
244         $(BLUE_HEADERS)
245
246 basics: headers
247         touch basics
248
249 # Headers is used only for the dependencies
250 headers: dirs+sources
251         $(MAKE) headerlinks
252
253 conv-autoconfig.h: configure
254         ./configure
255
256 headerlinks: dirs+sources Makefile $(ALLHEADERS)
257         @echo "Soft-linking headers..."
258         -@for hdr in $(ALLHEADERS) ; do test ! -f "../include/$$hdr" && ./system_ln "../tmp/$$hdr" ../include ; done
259         touch headerlinks
260
261 dirs+sources:
262 #       rm -f .gdir
263 #       (cd .. ; basename "`pwd`" | sed -e 's@-.*@@')   > .gdir
264         pwd
265         find . -type l -exec rm {} \;
266         rm -rf QuickThreads
267         rm -rf libs
268         rm -rf ../bin ; mkdir ../bin
269         rm -rf ../lib ; mkdir ../lib
270         rm -rf ../lib_so ; mkdir ../lib_so; touch ../lib_so/.charmso
271         rm -rf ../examples
272         rm -rf ../tests
273         rm -rf ../doc ; ln -s ../doc ../doc
274         ../../src/scripts/gatherflat ../../src/scripts .
275         ./gatherflat ../../src/conv-core        .
276         ./gatherflat ../../src/conv-ldb         .
277         ./gatherflat ../../src/conv-ccs         .
278         ./gatherflat ../../src/conv-perf        .
279         ./gatherflat ../../src/ck-core          .
280         ./gatherflat ../../src/util             .
281         ./gatherflat ../../src/ck-perf          .
282         ./gatherflat ../../src/ck-ldb           .
283         ./gatherflat ../../src/ck-com           .
284         ./gatherflat ../../src/ck-cp           .
285         ./gatherflat ../../src/conv-com           .
286         ./gatherflat ../../src/langs/simplemsg  .
287         ./gatherflat ../../src/langs/pvmc       .
288         ./gatherflat ../../src/langs/bluegene   .
289         ./gatherflat ../../src/langs/f90charm   .
290         ./gatherflat ../../src/xlat-i           .
291         ./gatherflat ../../src/xlatcpm          .
292         ./gathertree ../../src/QuickThreads QuickThreads
293         ./gathertree ../../src/libs libs
294         ./gathertree ../../src/arch/util      .
295         ./gathertree ../../src/langs langs
296         ./gathertree ../../src/langs/jade langs/jade
297         ./gathertree ../../src/arch/common           .
298         ./gathertree ../../src/arch/`cat .gdir`      .
299         test -f ../../src/arch/`cat .gdir`/gdir_link && cat ../../src/arch/`cat .gdir`/gdir_link > .gdir.new && ./gathertree ../../src/arch/`cat .gdir.new`      . || true
300         ./gatherflat ../../src/arch/`cat .vdir`      .
301         ./gathertree ../../examples ../examples
302         ./gathertree ../../tests ../tests
303         rm -f ../bin/dep.pl ; cp dep.pl ../bin/
304         chmod +x charmc
305         -./system_ln  ../tmp/charmc ../bin/
306         -ln -s ../../java/bin charmjavabin
307         -ln -s ../../java/bin ../bin/charmjavabin
308         -ln -s charmjavabin/* ../bin/
309         -ln -s ../java ..
310 #       rm -f .gdir
311         rm -rf ../include ; mkdir ../include
312         -./system_ln  ../tmp/conv-*.*h ../include
313         -./system_ln  ../tmp/cc-*.*h ../include
314         if [ -x ./special.sh ] ; then ./special.sh ; fi
315         if [ ! -f conv-common.h ] ; then ( touch conv-common.h ) ; fi
316         touch dirs+sources
317
318 ###############################################################################
319 #
320 # Converse Libraries
321
322 ###############################################################################
323 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
324 TRACELIBS=$(L)/libtrace-projections.a  $(L)/libtrace-summary.a   $(L)/libtrace-utilization.a \
325           $(L)/libtrace-simple.a $(L)/libtrace-controlPoints.a\
326           $(L)/libtrace-counter.a $(L)/libtrace-bluegene.a \
327           $(L)/libtrace-projector.a $(L)/libtrace-all.a $(L)/libtrace-converse.a \
328           $(L)/libtrace-recordreplay.a  $(L)/libtracef_f.a $(L)/libtrace-memory.a
329 MEMLIBS=$(L)/libmemory-default.o $(L)/libmemory-os.o $(L)/libmemory-gnu.o \
330           $(L)/libmemory-gnuold.o $(L)/libmemory-verbose.o      \
331           $(L)/libmemory-paranoid.o \
332           $(L)/libmemory-leak.o $(L)/libmemory-isomalloc.o \
333           $(L)/libmemory-charmdebug.o \
334           $(L)/libmemory-os-verbose.o $(L)/libmemory-os-isomalloc.o \
335           $(L)/libmemory-os-leak.o $(L)/libmemory-os-paranoid.o \
336           $(L)/libmemory-os-lock.o \
337           $(L)/libmemory-os-charmdebug.o $(L)/libmemory-os-wrapper.o \
338           $(L)/libmemory-hooks-charmdebug.o
339 THREADLIBS=$(L)/libthreads-default.o $(L)/libthreads-qt.o       \
340           $(L)/libthreads-context.o $(L)/libthreads-uJcontext.o \
341           $(L)/libthreads-pthreads.o $(L)/libthreads-fibers.o \
342           $(L)/libthreads-stackcopy.o $(L)/libthreads-memoryalias.o \
343           $(L)/libthreads-qt-memoryalias.o      \
344           $(L)/libthreads-context-memoryalias.o \
345           $(L)/libthreads-uJcontext-memoryalias.o
346
347 CVLIBS=$(L)/libconv-core.a \
348         $(L)/libconv-cplus-y.a $(L)/libconv-cplus-n.a \
349         $(L)/libconv-util.a $(L)/libconv-utilf.a \
350         $(CLBLIBS) $(TRACELIBS) $(MEMLIBS) $(THREADLIBS) \
351         $(L)/libccs-client.a
352
353 LIBCONV_CORE= convcore.o conv-conds.o queueing.o msgmgr.o \
354         cpm.o cpthreads.o futures.o cldb.o topology.o random.o \
355         debug-conv.o generate.o edgelist.o conv-ccs.o ccs-builtins.o \
356         traceCore.o traceCoreCommon.o tracec.o \
357         converseProjections.o machineProjections.o \
358         quiescence.o isomalloc.o conv-counter.o \
359         global-nop.o cmipool.o cpuaffinity.o cputopology.o
360
361 #############################################
362 #Comlib Core objects that go into libck.a
363 COMLIB_CORE_OBJS = ComlibModuleInterface.o 
364 ##############################################
365
366 LIBCONV_UTIL=pup_util.o pup_toNetwork.o pup_toNetwork4.o                \
367         pup_xlater.o pup_c.o pup_paged.o pup_cmialloc.o                 \
368         ckimage.o ckdll.o ckhashtable.o sockRoutines.o                  \
369         conv-lists.o RTH.o persist-comm.o \
370         ckbitvector.o TopoManager.o CrayNid.o
371
372 LIBCONV_UTILF=pup_f.o
373
374 converse: fmain-ok charmrun-target swapglobal-target conv-cpm
375
376 charmrun-target: sockRoutines.c sockRoutines.h ccs-server.c ccs-server.h sockRoutines-seq.o $(L)/libck.a $(CVLIBS)
377         if [ -d charmrun ] ; then ( cd charmrun ; $(MAKE) OPTS='$(OPTS)' -j1 ) ; fi
378         if [ -f charmrun ] ; then ( cp -f charmrun ../bin ) ; fi
379
380 fmain-ok: fmain.f90
381         -@$(CHARMC) -c fmain.f90
382         -@cp fmain.o ../lib
383         -@touch fmain-ok
384
385 QUICK_THREADS: $(CVHEADERS)
386         -( cd QuickThreads && $(MAKE) clean )
387         ( cd QuickThreads;./configure )
388         ( cd QuickThreads ; $(MAKE) qt  OPTS='$(OPTS)' )
389         cp -f QuickThreads/libqt.a ../lib/libckqt.a
390         -(CHARMINC=.; . ./conv-config.sh; \
391           test -d ../lib_so && \
392           cp -f QuickThreads/libqt.$$CMK_SHARED_SUF ../lib_so && \
393           cp -f QuickThreads/libqt.$$CMK_SHARED_SUF ../lib_so/libckqt.$$CMK_SHARED_SUF)
394         touch QUICK_THREADS
395
396 METIS:  charm++
397         cd libs/ck-libs/parmetis/METISLib && $(MAKE) OPTS='$(OPTS)'
398
399 CONVLIBS: converse
400         cd libs; $(MAKE) convlibs OPTS='$(OPTS)'
401
402 $(L)/libconv-core.a: $(LIBCONV_CORE)
403         $(CHARMC) $(TAU_LIBS) -o $@ $(LIBCONV_CORE) 
404
405 $(L)/libconv-cplus-y.a: $(L)/libconv-cplus-n.a
406
407 include Makefile.machine
408
409 $(L)/libconv-cplus-n.a: machine.c $(CVHEADERS)
410         @-test -f $(INC)/mpi.h && mv -f $(INC)/mpi.h $(INC)/mpi.BAK || true
411         $(CHARMC) -o machine.o  -DFOR_CPLUS=1 machine.c
412         @-test -f ./bglmachine.C && $(CHARMC) -o machine.o  -DFOR_CPLUS=1 bglmachine.C || true
413         $(CHARMC) -o $(L)/libconv-cplus-y.a machine.o
414         $(CHARMC) -o $(L)/libconv-cplus-n.a -DFOR_CPLUS=0 machine.c
415         @-test -f $(INC)/mpi.BAK && mv -f $(INC)/mpi.BAK $(INC)/mpi.h || true
416
417 $(L)/libconv-util.a: $(LIBCONV_UTIL)
418         $(CHARMC) -o $@ $(LIBCONV_UTIL)
419
420 $(L)/libconv-utilf.a: $(LIBCONV_UTILF)
421         -$(CHARMC) -o $@ $(LIBCONV_UTILF) || touch $@
422
423 $(L)/libccs-client.a: ccs-client.o
424         $(CHARMC) -o $@ ccs-client.o
425
426 ccs-client.o: ccs-client.c $(CVHEADERS)
427         $(CHARMC) ccs-client.c
428
429 sockRoutines.o: sockRoutines.c $(CVHEADERS) $(UTILHEADERS)
430         $(CHARMC) -DCMK_USE_CONVERSE=1 sockRoutines.c
431
432 sockRoutines-seq.o: sockRoutines.c $(CVHEADERS) $(UTILHEADERS)
433         $(SEQCHARMC) -o sockRoutines-seq.o sockRoutines.c
434
435 pup_util.o: pup_util.C $(CVHEADERS) $(UTILHEADERS)
436         $(CHARMC) -o pup_util.o pup_util.C
437
438 pup_toNetwork.o: pup_toNetwork.C $(CVHEADERS) $(UTILHEADERS)
439         $(CHARMC) -I. -o pup_toNetwork.o pup_toNetwork.C
440
441 pup_toNetwork4.o: pup_toNetwork4.C $(CVHEADERS) $(UTILHEADERS)
442         $(CHARMC) -I. -o pup_toNetwork4.o pup_toNetwork4.C
443
444 pup_xlater.o: pup_xlater.C $(CVHEADERS) $(UTILHEADERS)
445         $(CHARMC) -I. -o pup_xlater.o pup_xlater.C
446
447 pup_c.o: pup_c.C $(CVHEADERS) $(UTILHEADERS)
448         $(CHARMC) -o pup_c.o pup_c.C
449
450 pup_paged.o: pup_paged.C $(CVHEADERS) $(UTILHEADERS)
451         $(CHARMC) -o pup_paged.o pup_paged.C
452
453 pup_f.o: pup_f.f90 $(CVHEADERS)
454         -$(CHARMC) -c pup_f.f90 && $(CHARMC) -cpmod ../include pupmod.M || touch pup_f.o
455
456 pup_cmialloc.o: pup_cmialloc.C $(CVHEADERS) $(UTILHEADERS)
457         $(CHARMC) -o pup_cmialloc.o pup_cmialloc.C
458
459 ckhashtable.o: ckhashtable.C ckhashtable.h $(CVHEADERS)
460         $(CHARMC) -o ckhashtable.o ckhashtable.C
461
462 TopoManager.o: TopoManager.C TopoManager.h BGLTorus.h BGPTorus.h XT3Torus.h XT4Torus.h CrayNid.c $(CVHEADERS) $(UTILHEADERS)
463         $(CHARMC) -o TopoManager.o TopoManager.C
464
465 CrayNid.o: CrayNid.c $(CVHEADERS) $(UTILHEADERS)
466         $(CHARMC) -c -o CrayNid.o CrayNid.c
467
468 ckbitvector.o: ckbitvector.C ckbitvector.h $(CVHEADERS)
469         $(CHARMC) -I. -o ckbitvector.o ckbitvector.C
470
471 ckdll.o: ckdll.C ckdll.h $(CVHEADERS)
472         $(CHARMC) -o ckdll.o ckdll.C
473
474 ckimage.o: ckimage.C ckimage.h $(CVHEADERS)
475         $(CHARMC) -o ckimage.o ckimage.C
476
477 RTH.o: RTH.C RTH.h $(CVHEADERS)
478         $(CHARMC) -o RTH.o RTH.C
479
480 persist-comm.o: persist-comm.c persist_impl.h $(CVHEADERS)
481         $(CHARMC) -o persist-comm.o persist-comm.c
482
483 conv-lists.o: conv-lists.C $(UTILHEADERS) $(CVHEADERS)
484         $(CHARMC) -o conv-lists.o conv-lists.C
485
486 ## Converse load balancers (seed balancers, -balance)
487 $(L)/libldb-none.o: cldb.none.c $(CVHEADERS)
488         $(CHARMC) -o $@ cldb.none.c
489
490 $(L)/libldb-rand.o: cldb.rand.c cldb.h $(CVHEADERS)
491         $(CHARMC) -o $@ cldb.rand.c
492
493 $(L)/libldb-neighbor.o: cldb.neighbor.c cldb.neighbor.h graph.h $(CVHEADERS)
494         $(CHARMC) -o $@ cldb.neighbor.c
495
496 $(L)/libldb-spray.o: cldb.spray.c $(CVHEADERS)
497         $(CHARMC) -o $@ cldb.spray.c
498
499 $(L)/libldb-test.o: cldb.test.c $(CVHEADERS)
500         $(CHARMC) -o $@ cldb.test.c
501
502 $(L)/libldb-bluegene.o: cldb.bluegene.c $(CVHEADERS)
503         $(CHARMC) -o $@ cldb.bluegene.c
504
505 ## Memory allocation libraries (-memory)
506 MEM_DEPS=memory.c memory-gnu.c memory-gnuold.c converse.h conv-mach.h $(CVHEADERS)
507 $(L)/libmemory-default.o: $(MEM_DEPS)
508         $(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_DEFAULT memory.c
509
510 $(L)/libmemory-os.o: $(MEM_DEPS)
511         $(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_OS memory.c
512
513 $(L)/libmemory-os-verbose.o: memory-verbose.c $(MEM_DEPS)
514         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_VERBOSE memory.c || touch $@
515
516 $(L)/libmemory-os-paranoid.o: memory-paranoid.c $(MEM_DEPS)
517         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_PARANOID memory.c || touch $@
518
519 $(L)/libmemory-os-leak.o: $(MEM_DEPS)
520         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_LEAK memory.c || touch $@
521
522 $(L)/libmemory-os-isomalloc.o: memory-isomalloc.c $(MEM_DEPS)
523         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_ISOMALLOC memory.c || touch $@
524
525 $(L)/libmemory-os-lock.o: memory-lock.c $(MEM_DEPS)
526         -$(CHARMC) -I. -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_LOCK memory.c || touch $@
527
528 $(L)/libmemory-os-charmdebug.o: memory-charmdebug.c $(MEM_DEPS)
529         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_OS_WRAPPED -DCMK_MEMORY_BUILD_CHARMDEBUG memory.c || touch $@
530
531 $(L)/libmemory-os-wrapper.o: memory-os-wrapper.C $(MEM_DEPS)
532         -$(CHARMC) -o $@ memory-os-wrapper.C || touch $@
533
534 $(L)/libmemory-hooks-charmdebug.o: memory-charmdebug.c $(MEM_DEPS)
535         -$(CHARMC) -o $@ -DCMK_MEMORY_BUILD_GNU_HOOKS -DCMK_MEMORY_BUILD_CHARMDEBUG memory.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) QUICK_THREADS
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 ckmessagelogging.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  
681 TraceUtilization.def.h: TraceUtilization.decl.h
682
683 TraceUtilization.decl.h: trace-utilization.ci charmxi
684         $(CHARMXI) trace-utilization.ci 
685
686 TraceSimple.def.h: TraceSimple.decl.h
687
688 TraceSimple.decl.h: trace-simple.ci charmxi
689         $(CHARMXI) trace-simple.ci
690
691 TraceTau.def.h: TraceTau.decl.h
692
693 TraceTau.decl.h: trace-Tau.ci charmxi
694         $(CHARMXI) trace-Tau.ci
695
696 TraceControlPoints.def.h: TraceControlPoints.decl.h
697
698 TraceControlPoints.decl.h: trace-controlPoints.ci charmxi
699         $(CHARMXI) trace-controlPoints.ci
700
701 CkReduction.def.h: CkReduction.decl.h
702
703 CkReduction.decl.h: ckreduction.ci charmxi
704         $(CHARMXI) ckreduction.ci
705
706 CkCheckpoint.def.h: CkCheckpoint.decl.h
707
708 CkCheckpoint.decl.h: ckcheckpoint.ci charmxi
709         $(CHARMXI) ckcheckpoint.ci
710
711 CkMemCheckpoint.def.h: CkMemCheckpoint.decl.h
712
713 CkMemCheckpoint.decl.h: ckmemcheckpoint.ci charmxi
714         $(CHARMXI) ckmemcheckpoint.ci
715
716 CkMarshall.def.h: CkMarshall.decl.h
717
718 CkMarshall.decl.h: ckmarshall.ci charmxi
719         $(CHARMXI) ckmarshall.ci
720
721 CkArrayReductionMgr.def.h: CkArrayReductionMgr.decl.h
722
723 CkArrayReductionMgr.decl.h: ckarrayreductionmgr.ci charmxi
724         $(CHARMXI) ckarrayreductionmgr.ci
725
726 CkArray.def.h: CkArray.decl.h
727
728 CkArray.decl.h : ckarray.ci charmxi
729         $(CHARMXI) ckarray.ci
730
731 CkLocation.def.h: CkLocation.decl.h
732
733 CkLocation.decl.h: cklocation.ci charmxi
734         $(CHARMXI) cklocation.ci
735
736 CkCallback.def.h: CkCallback.decl.h
737
738 CkCallback.decl.h: ckcallback.ci charmxi
739         $(CHARMXI) ckcallback.ci
740
741 charisma.def.h: charisma.decl.h
742
743 charisma.decl.h: charisma.ci charmxi
744         $(CHARMXI) charisma.ci
745
746 ## Charm++ Load balancer (Dynamic load balancer)
747
748 CentralLB.def.h: CentralLB.decl.h
749
750 CentralLB.decl.h: CentralLB.ci charmxi
751         $(CHARMXI) CentralLB.ci
752
753 NborBaseLB.def.h: NborBaseLB.decl.h
754
755 NborBaseLB.decl.h: NborBaseLB.ci charmxi
756         $(CHARMXI) NborBaseLB.ci
757
758 HybridBaseLB.def.h: HybridBaseLB.decl.h
759
760 HybridBaseLB.decl.h: HybridBaseLB.ci charmxi
761         $(CHARMXI) HybridBaseLB.ci
762
763 ## Charm fortran AMPI
764
765 CK_FOR_LIBS_CORE=$(L)/libckf.a
766
767 LIBCKF_CORE=charmf.o charmmod.o
768
769 $(L)/libckf.a: $(LIBCKF_CORE)
770         -$(CHARMC) -o $@ $(LIBCKF_CORE) || touch $@
771
772 charmf.o:  charmf.C $(CKHEADERS) charmf.h
773         $(CHARMC) -c -I. charmf.C
774
775 charmmod.o: charmmod.f90
776         -$(CHARMC) -c charmmod.f90 || touch $@
777         -$(CHARMC) -cpmod ../include charm.M
778
779 ## Tracing libraries (profiling, -tracemode)
780 LIBTRACE_PROJ=trace-projections.o
781 $(L)/libtrace-projections.a: $(LIBTRACE_PROJ)
782         $(CHARMC) -o $@ $(LIBTRACE_PROJ)
783
784 LIBTRACE_SUMM=trace-summary.o
785 $(L)/libtrace-summary.a: $(LIBTRACE_SUMM)
786         $(CHARMC) -o $@ $(LIBTRACE_SUMM)
787  
788 LIBTRACE_UTIL=trace-utilization.o
789 $(L)/libtrace-utilization.a: $(LIBTRACE_UTIL)
790         $(CHARMC) -o $@ $(LIBTRACE_UTIL)           
791
792 LIBTRACE_SIMPLE=trace-simple.o
793 $(L)/libtrace-simple.a: $(LIBTRACE_SIMPLE)
794         $(CHARMC) -o $@ $(LIBTRACE_SIMPLE)
795
796 libtrace-Tau.o: trace-Tau.C charm++.h charm.h converse.h conv-config.h \
797   conv-autoconfig.h conv-common.h conv-mach.h conv-mach-opt.h \
798   conv-mach-ifort.h pup_c.h conv-cpm.h conv-cpath.h conv-qd.h \
799   conv-random.h conv-lists.h conv-trace.h persistent.h debug-conv.h pup.h \
800   middle.h middle-conv.h cklists.h ckbitvector.h ckstream.h init.h \
801   ckhashtable.h debug-charm.h CkMarshall.decl.h cksection.h ckcallback.h \
802   conv-ccs.h sockRoutines.h ccs-server.h ckobjQ.h ckreduction.h \
803   CkReduction.decl.h cknodegroupreduction.h CkArrayReductionMgr.decl.h \
804   ckmemcheckpoint.h CkMemCheckpoint.decl.h readonly.h ckarray.h \
805   cklocation.h LBDatabase.h lbdb.h LBDBManager.h LBObj.h LBOM.h LBComm.h \
806   LBMachineUtil.h lbdb++.h LBDatabase.decl.h NullLB.decl.h BaseLB.decl.h \
807   CkLocation.decl.h CkArray.decl.h ComlibArrayListener.h ComlibStrategy.h \
808   convcomlibstrategy.h ComlibLearner.h envelope.h envelope-path.h CkFutures.decl.h \
809   charisma.h charisma.decl.h tempo.h tempo.decl.h waitqd.h waitqd.decl.h \
810   sdag.h ckcheckpoint.h CkCheckpoint.decl.h ckevacuation.h \
811   ckarrayreductionmgr.h trace.h trace-bluegene.h trace-simple.h \
812   register.h trace-common.h trace-simpleBOC.h TraceSimple.decl.h \
813   TraceSimple.def.h
814         $(CHARMC) -c -I. $(TAU_INCLUDE) $(TAU_DEFS) trace-Tau.C -o libtrace-Tau.o
815
816 tau_selective.o: $(TAUROOT)/utils/tau_selective.cpp 
817         $(CHARMC) -I$(TAUROOT)/utils -DTAU_DYNINST $(TAUROOT)/utils/tau_selective.cpp
818
819 $(L)/libtrace-Tau.a: $(TAU_TRACE_OBJ) tau_selective.o
820         $(CHARMC) $(TAU_LIBS) -o $@ $(TAU_TRACE_OBJ) tau_selective.o $(TAU_TRACE_OBJ)
821
822 LIBTRACE_CONTROLPOINTS=trace-controlPoints.o
823 $(L)/libtrace-controlPoints.a: $(LIBTRACE_CONTROLPOINTS)
824         $(CHARMC) -o $@ $(LIBTRACE_CONTROLPOINTS)
825
826 LIBTRACE_RECREP=trace-recordreplay.o
827 $(L)/libtrace-recordreplay.a: $(LIBTRACE_RECREP)
828         $(CHARMC) -o $@ $(LIBTRACE_RECREP)
829
830 LIBTRACE_COUNT=trace-counter.o
831 $(L)/libtrace-counter.a: $(LIBTRACE_COUNT)
832         $(CHARMC) -o $@ $(LIBTRACE_COUNT)
833
834 LIBTRACE_BG=trace-bluegene.o
835 $(L)/libtrace-bluegene.a:$(LIBTRACE_BG)
836         $(CHARMC) -o $@ $(LIBTRACE_BG)
837
838 LIBTRACE_MEMORY=trace-memory.o
839 $(L)/libtrace-memory.a: $(LIBTRACE_MEMORY)
840         $(CHARMC) -o $@ $(LIBTRACE_MEMORY)
841
842 LIBTRACE_ALL=trace-all.o trace-projections.o trace-summary.o trace-simple.o \
843 $(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 trace-utilization.o
844
845 $(L)/libtrace-all.a: $(LIBTRACE_ALL)
846         $(CHARMC) -o $@ $(LIBTRACE_ALL)
847
848 LIBTRACE_PROJECTOR=trace-projector.o traceCore.o traceCoreCommon.o charmProjections.o converseProjections.o machineProjections.o
849 $(L)/libtrace-projector.a: $(LIBTRACE_PROJECTOR)
850         $(CHARMC) -o  $@ $(LIBTRACE_PROJECTOR)
851
852 LIBTRACE_CONVERSE=trace-converse.o
853 $(L)/libtrace-converse.a: $(LIBTRACE_CONVERSE)
854         $(CHARMC) -o  $@ $(LIBTRACE_CONVERSE)
855
856 LIBTRACE_FOR=tracef_f.o
857 $(L)/libtracef_f.a: $(LIBTRACE_FOR)
858         -$(CHARMC) -o $@ $(LIBTRACE_FOR) || touch $@
859
860 tracef_f.o: tracef_f.f90
861         -$(CHARMC) -o $@ -c tracef_f.f90 && $(CHARMC) -cpmod ../include tracemod.M  || touch $@
862
863 # used for make depends
864 TRACE_OBJS =  trace-projections.o  trace-summary.o  trace-simple.o \
865               trace-counter.o trace-controlPoints.o trace-utilization.o \
866               trace-bluegene.o trace-projector.o trace-converse.o trace-all.o \
867               trace-recordreplay.o trace-memory.o
868
869 ######################################################################
870 #
871 #Control Point Library
872 #
873 ######################################################################
874
875
876 CONTROLPOINTS_OBJS = controlPoints.o arrayRedistributor.o pathHistory.o
877
878 ControlPoints.def.h: ControlPoints.decl.h
879
880 ControlPoints.decl.h : controlPoints.ci charmxi
881         $(CHARMXI) controlPoints.ci
882
883 controlPoints_objs: $(L)/libmoduleControlPoints.a
884
885 $(L)/libmoduleControlPoints.a: $(CONTROLPOINTS_OBJS)
886         $(CHARMC) -o $(L)/libmoduleControlPoints.a $(CONTROLPOINTS_OBJS)
887
888
889 ###############################################################################
890 #
891 # Dynamic Load Balancers
892 #
893 ###############################################################################
894
895
896 # Automatically generated by script Makefile_lb.sh
897 include Make.lb
898
899 loadbalancers: $(LOADBALANCERS) $(L)/libmoduleEveryLB.a
900 ######################################################################
901 #
902 #Communication Optimization Library
903 #
904 ######################################################################
905
906 STRATEGY_OBJS = MPIStrategy.o StreamingStrategy.o \
907                 DummyStrategy.o NodeMulticast.o OneTimeMulticastStrategy.o \
908                 EachToManyMulticastStrategy.o ComlibSectionInfo.o \
909                 AAPLearner.o ComlibStats.o AAMLearner.o \
910                 MsgPacker.o MulticastStrategy.o DirectMulticastStrategy.o \
911                 RingMulticastStrategy.o MultiRingMulticast.o\
912                 PipeBroadcastStrategy.o MeshStreamingStrategy.o \
913                 PrioStreaming.o BroadcastStrategy.o RectMulticastStrategy.o \
914                 convcomlibstrategy.o ComlibManager.o ComlibStrategy.o 
915
916 CONVERSE_COM_OBJS = gridrouter.o hypercuberouter.o treerouter.o petable.o \
917                 3dgridrouter.o graphrouter.o hypercubetopology.o \
918                 routerstrategy.o convcomlibmanager.o pipebroadcastconverse.o \
919                 pipelinestrategy.o prefixrouter.o
920
921
922 comlib.def.h: comlib.decl.h
923
924 comlib.decl.h : ComlibManager.ci charmxi
925         $(CHARMXI) ComlibManager.ci
926
927 COMLIB_OBJS = $(STRATEGY_OBJS) $(CONVERSE_COM_OBJS)
928
929 comlib_objs: $(L)/libmodulecomlib.a $(L)/libconvcom.a
930
931 $(L)/libconvcom.a: $(COMLIB_OBJS)
932         $(CHARMC) -o $(L)/libconvcom.a $(CONVERSE_COM_OBJS)
933
934 #for backward compatibility, keep libmodulecommlib.a with double m.
935 $(L)/libmodulecomlib.a: $(COMLIB_OBJS)
936         $(CHARMC) -o $(L)/libmodulecomlib.a $(COMLIB_OBJS)
937         $(CHARMC) -o $(L)/libmodulecommlib.a $(COMLIB_OBJS)
938
939
940 ###############################################################################
941 #
942 # BlueGene Emulator
943 #
944 ###############################################################################
945
946 bigsim:  bigsim-target
947
948 bigemulator: bigsim
949
950 bigsim-target: charm++ $(L)/libconv-bigsim.a $(L)/libconv-bigsim-logs.a $(L)/libconv-bluegene-stub.a $(L)/libblue-standalone.a METIS
951
952 # old (Charm++) Blue Gene emulator
953 BlueGene.decl.h BlueGene.def.h : BlueGene.ci charmxi
954         $(CHARMXI) BlueGene.ci
955
956 $(L)/libbluegene.a: BlueGene.C BlueGene.h BlueGene.decl.h BlueGene.def.h
957         $(CHARMC) -c BlueGene.C
958         $(CHARMC) -o $@ BlueGene.o
959
960 # (Converse) Blue Gene emulator
961 BLUE_HEADERS = blue_types.h bigsim_timing.h blue_defs.h bigsim_logs.h blue.h blue_impl.h bigsim_network.h bigsim_record.h bigism_ooc.h bigsim_debug.h shared-alloc.h
962 BLUE_OBJS = blue.o bigsim_node.o bigsim_proc.o bigsim_init.o bigsim_timing.o bigsim_record.o bigsim_ooc.o shared_alloc.o
963 BIGSIM_IO_OBJS = bigsim_read.o bigsim_logs.o bigsim_api.o
964
965 LIBBLUE_OBJS = $(BLUE_OBJS) $(BIGSIM_IO_OBJS) blue_stub.o blue_standalone.o
966
967 $(L)/libconv-bigsim.a: $(BLUE_OBJS)
968         $(CHARMC) -o $@  $(BLUE_OBJS)
969
970 $(L)/libconv-bigsim-logs.a: $(BIGSIM_IO_OBJS)
971         $(CHARMC) -o $@  $(BIGSIM_IO_OBJS)
972
973 $(L)/libconv-bluegene-stub.a:  blue_stub.o
974         $(CHARMC) -o $@  blue_stub.o
975
976 $(L)/libblue-standalone.a: blue_standalone.o
977         $(CHARMC) -o $@  blue_standalone.o
978
979 ###############################################################################
980 #
981 # The CPM scanner
982 #
983 ###############################################################################
984
985 conv-cpm: conv-cpm.o
986         $(NATIVECHARMC) -language c -o conv-cpm -cp ../bin/ conv-cpm.o
987
988 conv-cpm.o: conv-cpm.c $(CVHEADERS)
989         $(NATIVECHARMC) conv-cpm.c
990
991 ###############################################################################
992 #
993 # The interface translator
994 #
995 ###############################################################################
996
997 XIHEADERS=conv-autoconfig.h xi-symbol.h xi-util.h xi-grammar.tab.h
998 CHARMXIOBJ=xi-main.o xi-symbol.o xi-grammar.tab.o xi-scan.o xi-util.o
999 SDAGOBJ=sdag-globals.o CSdagConstruct.o CEntry.o
1000 SDAGHEADERS= CToken.h EToken.h CParsedFile.h \
1001         sdag-globals.h CEntry.h
1002
1003 charmxi: ../bin/charmxi
1004
1005 ../bin/charmxi: $(CHARMXIOBJ) $(SDAGOBJ)
1006         $(NATIVECHARMC) -language c++ -cp ../bin/ -o charmxi $(CHARMXIOBJ) $(SDAGOBJ)
1007
1008 xi-main.o: xi-main.C $(XIHEADERS) $(SDAGHEADERS)
1009         $(NATIVECHARMC) xi-main.C
1010
1011 xi-symbol.o: xi-symbol.C $(XIHEADERS) $(SDAGHEADERS)
1012         $(NATIVECHARMC) xi-symbol.C
1013
1014 xi-util.o: xi-util.C $(XIHEADERS) $(SDAGHEADERS)
1015         $(NATIVECHARMC) xi-util.C
1016
1017 xi-grammar.tab.o: xi-grammar.tab.C $(XIHEADERS) $(SDAGHEADERS)
1018         $(NATIVECHARMC) xi-grammar.tab.C
1019
1020 xi-scan.o: xi-scan.C $(XIHEADERS) $(SDAGHEADERS)
1021         $(NATIVECHARMC) -I. -DYY_NEVER_INTERACTIVE xi-scan.C
1022
1023 sdag-globals.o: sdag-globals.C $(XIHEADERS) $(SDAGHEADERS)
1024         $(NATIVECHARMC) -c sdag-globals.C
1025
1026 CSdagConstruct.o: CSdagConstruct.C $(XIHEADERS) $(SDAGHEADERS)
1027         $(NATIVECHARMC) -c CSdagConstruct.C
1028
1029 CEntry.o: CEntry.C $(XIHEADERS) $(SDAGHEADERS)
1030         $(NATIVECHARMC) -c CEntry.C
1031
1032 ###############################################################################
1033 #
1034 # Simple Messaging
1035 #
1036 ###############################################################################
1037
1038 $(L)/libtsm.a: converse simplemsg.c simplemsg.h
1039         $(CHARMC) -o $@ simplemsg.c
1040
1041 $(L)/libsm.a: converse sm.c sm.h
1042         $(CHARMC) -o $@ sm.c
1043
1044 ###############################################################################
1045 #
1046 # PVM
1047 #
1048 ###############################################################################
1049
1050 PVMC=pvmc_buf.o pvmc_comm.o pvmc_conv.o pvmc_main.o pvmc_pack.o pvmc_groups.o
1051
1052 $(L)/libpvmc.a: $(PVMC)
1053         $(CHARMC) -o $@ $(PVMC)
1054
1055 pvmc_buf.o: pvmc_buf.c pvmc.h pvm3.h converse.h
1056         $(CHARMC) -o $@ pvmc_buf.c
1057
1058 pvmc_conv.o: pvmc_conv.c pvmc.h pvm3.h converse.h
1059         $(CHARMC) -o $@ pvmc_conv.c
1060
1061 pvmc_pack.o: pvmc_pack.c pvmc.h pvm3.h converse.h
1062         $(CHARMC) -o $@ pvmc_pack.c
1063
1064 pvmc_comm.o: pvmc_comm.c pvmc.h pvm3.h converse.h
1065         $(CHARMC) -o $@ pvmc_comm.c
1066
1067 pvmc_groups.o: pvmc_groups.c pvmc.h pvm3.h converse.h
1068         $(CHARMC) -o $@ pvmc_groups.c
1069
1070 pvmc_main.o: pvmc_main.c pvmc.h pvm3.h converse.h
1071         $(CHARMC) -o $@ pvmc_main.c
1072
1073 $(L)/libf90charm.a: charmxi f90main.ci f90main.h f90main.C futil.f90
1074         $(CHARMC) f90main.ci
1075         $(CHARMC) -c -DAMPI_FORTRAN=1 f90main.C
1076         -$(CHARMC) -c futil.f90
1077         -$(CHARMC) -o $@ f90main.o futil.o
1078
1079 ###############################################################################
1080 #
1081 # Make clean
1082 #
1083 ###############################################################################
1084
1085 install:
1086         @test ! -d $(DESTDIR)/include && mkdir -p $(DESTDIR)/include || true
1087         @test ! -d $(DESTDIR)/lib && mkdir -p $(DESTDIR)/lib || true
1088         @test ! -d $(DESTDIR)/lib_so && mkdir -p $(DESTDIR)/lib_so || true
1089         @test ! -d $(DESTDIR)/bin && mkdir -p $(DESTDIR)/bin || true
1090         cp -f ../include/*   $(DESTDIR)/include
1091         cp -f ../lib/*       $(DESTDIR)/lib
1092         cp -f ../lib_so/*    $(DESTDIR)/lib_so
1093 #       cp -f ../bin/*       $(DESTDIR)/bin
1094         for f in ../bin/*; do if test -f $$f; then cp -f $$f $(DESTDIR)/bin; fi; done
1095
1096
1097 clean:
1098         rm -f conv-autoconfig.h config.cache
1099         rm -f QuickThreads/libqt.a
1100         rm -f charmxi conv-cpm
1101         rm -f TAGS basics cmk_extras core
1102         rm -f core *.a
1103         rm -f core *.o
1104         rm -f core #*#
1105         rm -f core *~
1106         if [ -d charmrun ] ; then ( cd charmrun; make clean ) ; fi
1107         -( cd doc && make clean )
1108         ( cd libs; make clean )
1109         ( cd ../examples && make clean )
1110         ( cd ../tests && make clean )
1111
1112 veryclean:
1113         rm -rf ../bin
1114         rm -rf ../lib
1115         rm -rf ../src
1116         rm -rf ../examples
1117         rm -rf ../tests
1118         rm -rf ../include
1119         rm -rf ../doc
1120         mv Makefile .Makefile
1121         mv Make.depends .Make.depends
1122         rm -rf [a-z]* [A-Z]*
1123         mv .Make.depends Make.depends
1124         rm -rf .[a-z]* .[A-Z]*
1125
1126
1127 config: configure.in
1128         autoconf && autoheader
1129
1130 depends: basics
1131         echo "Creating " $(DEPENDFILE) " ...";
1132         if [ -f $(DEPENDFILE) ]; then \
1133            /bin/cp -f $(DEPENDFILE) $(DEPENDFILE).old; \
1134         fi; \
1135         echo '#generated by make depends' > $(DEPENDFILE); \
1136         processFiles='';        \
1137         for i in $(LIBCONV_CORE) $(TRACE_OBJS) $(LIBCK_CORE) $(LB_OBJ) $(LIBBLUE_OBJS) $(COMLIB_OBJS) $(CONTROLPOINTS_OBJS); do \
1138               processed='false';        \
1139               for f in $$processFiles; do       \
1140                 if test $$i = $$f ; then        \
1141                   processed=true;  break;       \
1142                 fi;     \
1143               done;     \
1144               test $$processed = 'true'  && continue;   \
1145               processFiles="$$processFiles $$i";        \
1146               SRCFILE=`basename $$i .o`.C ; \
1147               [ ! -f $$SRCFILE ] && SRCFILE=`basename $$i .o`.c ;       \
1148               echo "checking dependencies for $$SRCFILE" ; \
1149               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;  \
1150               echo '' >> $(DEPENDFILE) ; \
1151         done;
1152
1153
1154 dependsCaseSensitive: basics
1155         echo "Creating " $(DEPENDFILE) " ...";
1156         if [ -f $(DEPENDFILE) ]; then \
1157            /bin/cp -f $(DEPENDFILE) $(DEPENDFILE).old; \
1158         fi; \
1159         echo '#generated by make depends' > $(DEPENDFILE); \
1160         processFiles='';        \
1161         for i in $(LIBCONV_CORE) $(TRACE_OBJS) $(LIBCK_CORE) $(LB_OBJ) $(LIBBLUE_OBJS) $(COMLIB_OBJS) $(CONTROLPOINTS_OBJS); do \
1162               processed='false';        \
1163               for f in $$processFiles; do       \
1164                 if test $$i = $$f ; then        \
1165                   processed=true;  break;       \
1166                 fi;     \
1167               done;     \
1168               test $$processed = 'true'  && continue;   \
1169               processFiles="$$processFiles $$i";        \
1170               SRCFILE=`basename $$i .o`.C ; \
1171               SRCDIR=`dirname $$i` ; \
1172               found=`/usr/bin/find $$SRCDIR -depth 1 -name $$SRCFILE`; \
1173               [ ! $$found ] && SRCFILE=`basename $$i .o`.c ; \
1174               echo "checking dependencies for $$SRCFILE" ; \
1175               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;  \
1176               echo '' >> $(DEPENDFILE) ; \
1177         done;
1178
1179
1180