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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
|
# Makefile for the simulator
# Copyright 2004-2007 Nanorex, Inc. See LICENSE file for details.
# $Id: Makefile,v 1.105 2007/05/11 04:41:28 emessick Exp $
PYTHON = c:/python24/python.exe
UNAME := $(shell uname)
# dotted python version (2.3, 2.4)
PYDVER := $(shell $(PYTHON) -c "import sys; print sys.version[:3]")
# un-dotted python version (23, 24)
PYVER := $(shell $(PYTHON) -c "import sys; print sys.version[0]+sys.version[2]")
LODE=
USEODE=
#LODE=-lode
#USEODE=-DUSE_ODE
ifeq ($(OS),Windows_NT)
#---------------------------------------- Start Windows stuff
# One dollar sign for DOS and two for Cygwin
UNAME_A=$(shell ver)
# UNAME_A=$$(shell ver) # Cygwin: but in this case use 'uname -a' anyway
# Location of the MinGW compiler
CCDIR = C:/MinGW-Qt
#CCDIR = C:/Dev-Cpp
CC = "$(CCDIR)/bin/gcc.exe"
#CFLAGS=-g -I"$(CCDIR)/include" -I"C:/cygwin/usr/local/include" -I"C:/Python$(PYVER)/include" -Disnan=_isnan
#CFLAGS=-g -I"$(CCDIR)/include" -I"C:/ode-win32-0.7/include" -I"C:/Python$(PYVER)/include" -Disnan=_isnan $(USEODE)
CFLAGS=-g -I"$(CCDIR)/include" -I"C:/Python$(PYVER)/include" -Disnan=_isnan $(USEODE)
#LDFLAGS=-L"$(CCDIR)/lib" -L"C:/ode-win32-0.7/lib/releasedll" $(LODE)
LDFLAGS=-L"$(CCDIR)/lib"
PYREXTARGET=sim.dll
STDC99=
SIMTARGET=simulator.exe
PYREXC=$(PYTHON) c:/Python$(PYVER)/Scripts/pyrexc.py
#---------------------------------------- End of Windows stuff
else
#---------------------------------------- Start Unix/Mac stuff
UNAME_A=$$(uname -a)
CC=gcc
PYREXTARGET=sim.so
STDC99=-std=c99
SIMTARGET=simulator
#CFLAGS=-pthread -fno-strict-aliasing -g -I/usr/include/python2.3 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wstrict-prototypes -fPIC
CFLAGS:=$(shell $(PYTHON) distutils_compile_options.py compiler_so)
ifeq ($(strip $(UNAME)),Darwin)
#---------------------------------------- Mac
CFLAGS+=-I/System/Library/Frameworks/Python.framework/Versions/$(PYDVER)/lib/python$(PYDVER)/config \
-I/System/Library/Frameworks/Python.framework/Versions/$(PYDVER)/include/python$(PYDVER)/
LDFLAGS=-Wl,-F. -framework Python
LDSHARED=gcc -bundle
else
#---------------------------------------- Unix
PYBASE:=$(shell which python | sed "s%/bin/python%%")
CFLAGS+=-I$(PYBASE)/include/python$(PYDVER) $(USEODE)
LDFLAGS=-L$(PYBASE)/lib/python$(PYDVER)/config $(LODE) -lm -lpython$(PYDVER)
LDSHARED=gcc -shared
#---------------------------------------- End of Unix
endif
PYREXC=$(shell $(PYTHON) -c "import findpyrex; print findpyrex.find_pyrexc()")
LDFLAGS+=-L/usr/lib -lm
CFLAGS+=-fno-strict-aliasing -DNDEBUG -g -Wall -Wmissing-prototypes \
-Wstrict-prototypes -fPIC
# These CFLAGS and LDFLAGS are not used by distutils. If asked to
# compile or link, Pyrex uses distutils, and will therefore not
# use these CFLAGS and LDFLAGS.
#---------------------------------------- End of Unix/Mac stuff
endif
COMMONOBJS=\
allocate.o \
dynamics.o \
globals.o \
hashtable.o \
interpolate.o \
jigs.o \
lin-alg.o \
minimize.o \
minstructure.o \
newtables.o \
part.o \
potential.o \
printers.o \
read_amber_itp.o \
readmmp.o \
readxyz.o \
rigid.o \
rigid-ode.o \
structcompare.o \
writemovie.o
PYREXSRCS=$(COMMONOBJS:.o=.c)
SIMOBJS=$(COMMONOBJS) simulator.o
PYREXOBJS=$(COMMONOBJS) sim.o
EXE_DIRECTORY=../../cad/bin
#EXE_DIRECTORY=~/bin
ifeq ($(PROFILING),1)
CFLAGS+=-pg
LDFLAGS+=-pg
endif
ifeq ($(WWDEBUG),1)
CFLAGS+=-DWWDEBUG
endif
# It's important not to change these two targets.
all: $(SIMTARGET)
help:
echo $(DISTU)
# It's important not to change these two targets.
pyx: $(PYREXTARGET)
.PHONY: all lall noopt pyx install install-linux clean dist_clean depend depends
lall: all pyx glviewer
SUFFIXES: .c .h .o ;
.c.o:
$(CC) -c $(CFLAGS) -o $@ $(@:.o=.c)
#bruce 051230 added dependency on Makefile to some rules (not all, and not as many are
# affected as I'd hoped);
# this is desirable since Makefile defines CFLAGS (and full remake doesn't take very long);
# feel free to do this in a cleaner way, or not at all if it causes problems.
# -std-c99 gets us isnormal()
structcompare.o: structcompare.c simulator.h
$(CC) -c $(STDC99) $(CFLAGS) -o structcompare.o structcompare.c
ifeq ($(OS),Windows_NT)
# We need sim.c rule to build for Windows
sim.c: simhelp.c sim.pyx
$(PYREXC) sim.pyx
libpython$(PYVER).a: libpython$(PYVER).a.gz
gunzip < libpython$(PYVER).a.gz > libpython$(PYVER).a
sim.dll: sim.c $(PYREXOBJS) libpython$(PYVER).a version.h
$(CC) -shared -I"C:/Python$(PYVER)/include" -o sim.dll $(PYREXOBJS) \
-Wl,--output-def,sim.def -L. -lpython$(PYVER)
# -Wl,--output-def,sim.def -L. -lpython$(PYVER) -L"C:/ode-win32-0.7/lib/releasedll" $(LODE)
else
# here's the distutils version:
#sim.so: Makefile $(PYREXSRCS) version.h bends.gen bonds.gen sim.pyx simhelp.c
# python setup.py build_ext --inplace
sim.c: sim.pyx simhelp.c
$(PYREXC) sim.pyx
sim.so: $(PYREXOBJS)
$(LDSHARED) $(PYREXOBJS) -o sim.so $(LDFLAGS)
endif
tables.c: gentab.py
$(PYTHON) gentab.py > tables.c
bonds.gen: stretch.py stretch.parms
$(PYTHON) stretch.py stretch.parms > bonds.gen
bends.gen: bend.py bending.parms
$(PYTHON) bend.py bending.parms > bends.gen
# There is something about bends.gen that the compiler doesn't want to
# optimize. It's getting tripped up by the bend names; if they are all
# the same it doesn't get stuck.
newtables.o: newtables.c
$(CC) -o newtables.o -c -g newtables.c
version.h:
$(PYTHON) makehelp.py "$(CFLAGS)" "$(LDFLAGS)" "$(UNAME_A)" \
| grep -v "^running " > version.h
noopt:
make CFLAGS=-g $(SIMTARGET)
$(SIMTARGET): $(SIMOBJS) version.h
$(CC) -o $(SIMTARGET) $(LDFLAGS) $(SIMOBJS)
testminimize: minimize.c allocate.o
$(CC) -o testminimize.o $(CFLAGS) -DTEST -c minimize.c
$(CC) -o testminimize $(LDFLAGS) testminimize.o allocate.o
teststructcompare: structcompare.c minimize.o allocate.o lin-alg.o
$(CC) -o teststructcompare.o $(CFLAGS) -DTEST -c structcompare.c
$(CC) -o teststructcompare $(LDFLAGS) teststructcompare.o minimize.o allocate.o lin-alg.o
glviewer: glviewer.c allocate.o
$(CC) -o glviewer.o $(CFLAGS) -c glviewer.c
$(CC) -o glviewer $(LDFLAGS) -L/usr/X11R6/lib -lGL -lGLU glviewer.o allocate.o
install: $(SIMTARGET)
if [ ! -d $$HOME/bin ] ; then \
mkdir $$HOME/bin ;\
fi
cp -f $(SIMTARGET) $$HOME/bin
if [ ! -d $(EXE_DIRECTORY) ] ; then \
mkdir $(EXE_DIRECTORY) ;\
fi
cp $(SIMTARGET) $(EXE_DIRECTORY)
install-linux: install $(PYREXTARGET)
cp sim.so $(EXE_DIRECTORY)
clean:
rm -f version.h bonds.gen bends.gen
rm -f $(SIMTARGET) moldisp molsim physeng sim.so sim.c
rm -f glviewer
rm -f *.o *.a *.dll *.def sim.c *.so \.\#* *~ fmc.mmp dumpstruct.xyz *.pyc *.gcno
rm -rf html gmon.out build obj
rm -f tests/*/*.trcnew
rm -f tests/*/*.altout
rm -f tests/*/*.diff
rm -f tests/*/*.xyz
rm -f tests/*/*.dpb
dist_clean: clean
rm -f TAGS
TAGS:
etags *.c *.h
doxy:
doxygen Doxyfile
depend: version.h
head -`egrep -n "^# BEGIN" Makefile | sed 's/:.*//'` Makefile > tmp.mk
makedepend -f tmp.mk -Y. *.[ch]
mv -f tmp.mk Makefile
rm tmp.mk.bak
depends: depend
# BEGIN DEPENDENCIES
# DO NOT DELETE
allocate.o: allocate.h
dynamics.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
dynamics.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
dynamics.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h minstructure.h
dynamics.o: writemovie.h rigid.h globals.h
globals.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
globals.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
globals.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h minstructure.h
globals.o: writemovie.h rigid.h globals.h
glviewer.o: allocate.h
hashtable.o: allocate.h hashtable.h
interpolate.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h
interpolate.o: minimize.h structcompare.h part.h newtables.h interpolate.h
interpolate.o: readmmp.h readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h
interpolate.o: minstructure.h writemovie.h rigid.h globals.h
jigs.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
jigs.o: structcompare.h part.h newtables.h interpolate.h readmmp.h read_amber_itp.h readxyz.h
jigs.o: printers.h dynamics.h jigs.h potential.h minstructure.h writemovie.h
jigs.o: rigid.h globals.h
lin-alg.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
lin-alg.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
lin-alg.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h minstructure.h
lin-alg.o: writemovie.h rigid.h globals.h
minimize.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
minimize.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
minimize.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h minstructure.h
minimize.o: writemovie.h rigid.h globals.h
minstructure.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h
minstructure.o: minimize.h structcompare.h part.h newtables.h interpolate.h
minstructure.o: readmmp.h readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h
minstructure.o: minstructure.h writemovie.h rigid.h globals.h
newtables.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
newtables.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
newtables.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h
newtables.o: minstructure.h writemovie.h rigid.h globals.h bonds.gen
newtables.o: bends.gen
part.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
part.o: structcompare.h part.h newtables.h interpolate.h readmmp.h readxyz.h
part.o: read_amber_itp.h printers.h dynamics.h jigs.h potential.h minstructure.h writemovie.h
part.o: rigid.h globals.h
potential.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
potential.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
potential.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h
potential.o: minstructure.h writemovie.h rigid.h globals.h
printers.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
printers.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
printers.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h minstructure.h
printers.o: writemovie.h rigid.h globals.h
read_amber_itp.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h^M
read_amber_itp.o: minimize.h structcompare.h part.h newtables.h interpolate.h^M
read_amber_itp.o: readmmp.h readxyz.h read_amber_itp.h printers.h dynamics.h^M
read_amber_itp.o: jigs.h pam5_patterns.h pattern.h^M
read_amber_itp.o: potential.h minstructure.h writemovie.h rigid.h^M
read_amber_itp.o: globals.h^M
readers.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
readers.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
readers.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h minstructure.h
readers.o: writemovie.h rigid.h globals.h
readmmp.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
readmmp.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
readmmp.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h minstructure.h
readmmp.o: writemovie.h rigid.h globals.h
readxyz.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
readxyz.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
readxyz.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h minstructure.h
readxyz.o: writemovie.h rigid.h globals.h
rigid-ode.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
rigid-ode.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
rigid-ode.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h
rigid-ode.o: minstructure.h writemovie.h rigid.h globals.h rigid-ode.h
rigid.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
rigid.o: structcompare.h part.h newtables.h interpolate.h readmmp.h read_amber_itp.h readxyz.h
rigid.o: printers.h dynamics.h jigs.h potential.h minstructure.h writemovie.h
rigid.o: rigid.h globals.h rigid-ode.h
sim.o: simhelp.c simulator.h debug.h lin-alg.h allocate.h hashtable.h
sim.o: minimize.h structcompare.h part.h newtables.h interpolate.h readmmp.h
sim.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h minstructure.h
sim.o: writemovie.h rigid.h globals.h version.h
simhelp.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
simhelp.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
simhelp.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h minstructure.h
simhelp.o: writemovie.h rigid.h globals.h version.h
simulator.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
simulator.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
simulator.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h
simulator.o: minstructure.h writemovie.h rigid.h globals.h version.h
simulator.o: debug.h lin-alg.h allocate.h hashtable.h minimize.h
simulator.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
simulator.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h
simulator.o: minstructure.h writemovie.h rigid.h globals.h
structcompare.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h
structcompare.o: minimize.h structcompare.h part.h newtables.h interpolate.h
structcompare.o: readmmp.h readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h
structcompare.o: minstructure.h writemovie.h rigid.h globals.h
testminimize.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h
testminimize.o: minimize.h structcompare.h part.h newtables.h interpolate.h
testminimize.o: readmmp.h readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h
testminimize.o: minstructure.h writemovie.h rigid.h globals.h
writemovie.o: simulator.h debug.h lin-alg.h allocate.h hashtable.h minimize.h
writemovie.o: structcompare.h part.h newtables.h interpolate.h readmmp.h
writemovie.o: readxyz.h read_amber_itp.h printers.h dynamics.h jigs.h potential.h
writemovie.o: minstructure.h writemovie.h rigid.h globals.h
|