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