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