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