-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·156 lines (126 loc) · 3.83 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
########################
# Mike Steder
# University of Chicago
# 2005
########################
########################
# *IMPORTANT*
# Look over the following variables.
# Edit the values so that they are appropriate
# for your system.
CC=mpicc
# Debugging Options
CCOPTS=-fPIC -g -Wall -ansi #-pedantic
# Release Options
#CCOPTS=-fPIC -O2
# Libraries and Include Files:
PYTHON=python
#PYTHONLIB=$(PYTHON)
# Defaults:
#PYTHON_INCLUDES=-I/usr/include/python2.4
# Use this variable to point to your libpython2.x and libmpich
#LIBRARY_PATH=
#INCLUDES=
# Mac OS X.4:
PYTHONLIB=python
PYTHON_INCLUDES=-I/sw/include/python2.5 -I/sw/include/python2.5/numpy
LIBRARY_PATH=-L/sw/lib/python2.5
INCLUDES=-I/usr/local/include/
OS=$(shell uname -s)
ifeq ($(OS),Linux)
LD_FLAGS=-shared
endif
ifeq ($(OS),Darwin)
LD_FLAGS=-bundle -flat_namespace -undefined suppress
endif
# *OPTIONAL*
# Edit these variables to suit your taste:
RM=rm # command executed to delete make products
CP=cp -rv # copy command for building tar archive
CD=cd
MV=mv
MKDIR=mkdir # make directory command for building tar archive
TAR=tar -zcf # command for creating a tar archive
BZTAR=tar -jcf # command for creating a tar archive
ZIP=zip -rq
########################
# Do NOT edit variables below this line
# (It shouldn't be necessary).
NAME=maroonmpi
MINOR_NUMBER=$(shell svnversion .)
VERSION=1.1.$(MINOR_NUMBER)
ARCHIVE=$(NAME)-$(VERSION)
TARBALL=$(ARCHIVE).tar.gz
BZTARBALL=$(ARCHIVE).tar.bz2
ZIPFILE=$(ARCHIVE).zip
FILES=Makefile *.c *.py *.h SConstruct *.cfg *.txt
#MPI:
LIBMPI=_mpi.so
LIBMPI_SERIAL=_mpiserial.so
LIBRARIES=$(LIBRARY_PATH) -l$(PYTHONLIB)
LIBRARIES_SERIAL= $(LIBRARY_PATH) -lmpi-serial -l$(PYTHONLIB)
SRC=src/mmpi_module.c
HEADERS=$(wildcard src/mmpi_*.h)
OBJ=$(SRC:.c=.o)
PYBC=$(wildcard *.pyc) $(wildcard mpi/*.pyc)
#MPE:
LIBMPE=_mpe.so
MPESRC=$(wildcard src/mpe_*.c)
MPEHEADERS=$(wildcard src/mpe_*.h)
MPEOBJ=$(MPESRC:.c=.o)
MPELIBRARIES=$(LIBRARIES) -lmpe
#MPI-IO:
IOSRC=src/mmpi_io.c
IOHEADERS=
### Targets ###
default: lib
lib: $(LIBMPI)
mpe: $(LIBMPE)
serial: $(LIBMPI_SERIAL)
#$(CC) -Wall -g -fPIC -I$(PYTHON_INCLUDE) -c mmpi_module.c -o mmpi_module.o
$(LIBMPI): $(OBJ)
$(CC) $(LD_FLAGS) $(OBJ) -o $(LIBMPI) $(LIBRARIES)
mv $(LIBMPI) mpi/
$(LIBMPI_SERIAL): $(OBJ)
${MAKE} src/mpi-serial
$(CC) $(LD_FLAGS) $(OBJ) -o $(LIBMPI_SERIAL) -Lsrc/mpi-serial/ $(LIBRARIES_SERIAL)
mv $(LIBMPI_SERIAL) mpi/$(LIBMPI)
$(LIBMPE): $(MPEOBJ)
$(CC) $(LD_FLAGS) $(MPEOBJ) -o $(LIBMPE) $(MPELIBRARIES)
mv $(LIBMPE) mpi/
test.exe: $(OBJ)
$(CC) -o test.exe test.o $(LIBRARIES)
$(OBJ): $(HEADERS)
.SUFFIXES: .o .c
.c.o:
$(CC) $(CCOPTS) $(INCLUDES) $(PYTHON_INCLUDES) -c $< -o $@
clean:
#@echo "I will clean:" $(OBJ) $(LIBMPI) $(PYBC)
-$(RM) $(OBJ) $(PYBC) $(LIBMPI) $(LIBMPE) test.exe mpi/$(LIBMPI) mpi/$(LIBMPE) mpi/$(LIBMPI_SERIAL)
distclean:
-$(RM) dist/*
doc:
@echo running "epydoc --html --output docs/ --url http://www.penzilla.net/mmpi/ --top http://www.penzilla.net/mmpi/docs/top.shtml mpi"
@epydoc --html --output docs/ --url http://www.penzilla.net/mmpi/ --top http://www.penzilla.net/mmpi/docs/top.shtml mpi
dist: tar bztar zip
tar: clean
svn export . $(ARCHIVE)
$(TAR) $(TARBALL) $(ARCHIVE)
$(RM) -rf $(ARCHIVE)
$(MV) $(TARBALL) dist
ln -fs $(TARBALL) dist/$(NAME)-current.tar.gz
bztar: clean
svn export . $(ARCHIVE)
$(BZTAR) $(BZTARBALL) $(ARCHIVE)
$(RM) -rf $(ARCHIVE)
$(MV) $(BZTARBALL) dist
ln -fs $(BZTARBALL) dist/$(NAME)-current.tar.bz2
zip: clean
svn export . $(ARCHIVE)
$(ZIP) $(ZIPFILE) $(ARCHIVE)
$(RM) -rf $(ARCHIVE)
$(MV) $(ZIPFILE) dist
ln -fs $(ZIPFILE) dist/$(NAME)-current.zip
#windows:
#C:\Documents and Settings\steder\Desktop\mikempi>python setup.py build_ext --include-dirs="C:\Program Files\MPICH2\include" -cmingw32 --with-mpicc=gcc --library
#-dirs="C:\Program Files\MPICH2\lib" --libraries="mpi" bdist --formats=wininst