forked from xavierleroy/ocamlmpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (50 loc) · 1.46 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLDEP=ocamldep
MPIINCDIR=/usr/include/mpi
MPILIBDIR=/usr/lib
MPICC=mpicc
MPIRUN=mpirun
CFLAGS=-I`$(OCAMLC) -where` -I$(MPIINCDIR) -O2 -g -Wall -DCAML_NAME_SPACE
COBJS=init.o comm.o msgs.o collcomm.o groups.o utils.o
OBJS=mpi.cmo
all: libcamlmpi.a byte
install:
ocamlfind install mpi META mpi.mli mpi.cmi \
$(wildcard mpi*.cmx) $(wildcard mpi.cm*a) $(wildcard *mpi.a)
uninstall:
ocamlfind remove mpi
libcamlmpi.a: $(COBJS)
rm -f $@
ar rc $@ $(COBJS)
byte: $(OBJS)
$(OCAMLC) -a -o mpi.cma -custom $(OBJS) -cclib -lcamlmpi -ccopt -L$(MPILIBDIR) -cclib -lmpi
opt: $(OBJS:.cmo=.cmx)
$(OCAMLOPT) -a -o mpi.cmxa $(OBJS:.cmo=.cmx) -cclib -lcamlmpi -ccopt -L$(MPILIBDIR) -cclib -lmpi
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.ml.cmo:
$(OCAMLC) -c $<
.mli.cmi:
$(OCAMLC) -c $<
.ml.cmx:
$(OCAMLOPT) -c $<
testmpi: test.ml mpi.cma libcamlmpi.a
ocamlc -g -o testmpi unix.cma mpi.cma test.ml -ccopt -L$(MPILIBDIR) -ccopt -L.
testmpinb: testnb.ml mpi.cma libcamlmpi.a
ocamlc -cc $(CC) -g -o testmpinb unix.cma mpi.cma testnb.ml -ccopt -L$(MPILIBDIR) -ccopt -L.
clean::
rm -f testmpi
test: testmpi
$(MPIRUN) -np 5 ./testmpi
test_mandel: test_mandel.ml mpi.cmxa libcamlmpi.a
ocamlfind ocamlopt -package graphics -linkpkg -o test_mandel mpi.cmxa test_mandel.ml -ccopt -L.
clean::
rm -f test_mandel
clean::
rm -f *.cm* *.o *.a
depend:
$(OCAMLDEP) *.ml > .depend
gcc -MM $(CFLAGS) *.c >> .depend
include .depend
clean::
$(MAKE) -C test clean