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