-
Notifications
You must be signed in to change notification settings - Fork 0
/
obit.rb.patch
386 lines (315 loc) · 12.9 KB
/
obit.rb.patch
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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
diff --git a/Obit/lib/Makefile b/Obit/lib/Makefile
index 40d2e7d..f8e4248 100644
--- a/Obit/lib/Makefile
+++ b/Obit/lib/Makefile
@@ -34,18 +34,22 @@
#
#------------------------------------------------------------------------
# targets to build
-TARGETS = libObit.a
+TARGETS = libObit.a libObit.dylib
# list of object modules
OBJECTS := $(wildcard *.o)
all: $(TARGETS)
-# build Obit library
+# build Obit static library
libObit.a: ${OBJECTS}
ar rv libObit.a ${OBJECTS}
${RANLIB} libObit.a
+# build Obit shared library
+libObit.dylib: $(OBJECTS)
+ $(CC) -dynamiclib -flat_namespace -undefined dynamic_lookup -o $@ $^
+
clean:
rm -f $(TARGETS)
diff --git a/Obit/tasks/Makefile.in b/Obit/tasks/Makefile.in
index 798645f..be4db7d 100644
--- a/Obit/tasks/Makefile.in
+++ b/Obit/tasks/Makefile.in
@@ -63,10 +63,16 @@ ALL_LDFLAGS = $(LDFLAGS) @CFITSIO_LDFLAGS@ @FFTW_LDFLAGS@ @FFTW3_LDFLAGS@ \
@GSL_LDFLAGS@ @PLPLOT_LDFLAGS@ @PGPLOT_LDFLAGS@ @WVR_LDFLAGS@ \
$(CLIENT_LDFLAGS) $(SERVER_LDFLAGS)
-LIBS = ../lib/libObit.a @CFITSIO_LIBS@ @FFTW_LIBS@ @FFTW3_LIBS@ @GLIB_LIBS@ \
- @GSL_LIBS@ @PLPLOT_LIBS@ @PGPLOT_LIBS@ $(CLIENT_LIBS) $(SERVER_LIBS) \
- @LIBS@ @FLIBS@ @GTHREAD_LIBS@ @WVR_LIBS@
+# Static library option
+# OBIT_LIB_TARGET = ../lib/libObit.a
+# OBIT_LIB = ../lib/libObit.a
+# Shared library option
+OBIT_LIB_TARGET = ../lib/libObit.dylib
+OBIT_LIB = -L../lib -lObit
+LIBS = $(OBIT_LIB) @CFITSIO_LIBS@ @FFTW_LIBS@ @FFTW3_LIBS@ @GLIB_LIBS@ \
+ @GSL_LIBS@ @PLPLOT_LIBS@ @PGPLOT_LIBS@ $(CLIENT_LIBS) $(SERVER_LIBS) \
+ @LIBS@ @FLIBS@ @GTHREAD_LIBS@ @WVR_LIBS@
# get list of all c source files (*.c) files
AllC := $(wildcard *.c)
@@ -76,17 +82,18 @@ TARGETS := $(addprefix $(BINDIR),$(EXECU))
all: $(TARGETS)
# generic C compile/link
-$(TARGETS): $(BINDIR)% : %.c ../lib/libObit.a
+$(TARGETS): $(BINDIR)% : %.c $(OBIT_LIB_TARGET)
echo "compile $*.c"
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(ALL_LDFLAGS) $*.c -o $* $(LIBS)
mv $* $(BINDIR)
# For specific executables
-$(EXECU): % : %.c ../lib/libObit.a
+$(EXECU): % : %.c $(OBIT_LIB_TARGET)
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(ALL_LDFLAGS) $< -o $* $(LIBS)
mv $* $(BINDIR)
clean:
rm -f $(TARGETS)
rm -f *.o
+ rm -rf *.dSYM
diff --git a/Obit/python/Makefile.in b/Obit/python/Makefile.in
index 5cf25a4..5dac1d6 100644
--- a/Obit/python/Makefile.in
+++ b/Obit/python/Makefile.in
@@ -54,7 +54,12 @@ ALL_CFLAGS = $(CFLAGS) @GLIB_CFLAGS@ @GSL_CFLAGS@ @PLPLOT_CFLAGS@ \
ALL_LDFLAGS = $(LDFLAGS) @CFITSIO_LDFLAGS@ @FFTW_LDFLAGS@ @FFTW3_LDFLAGS@ @GSL_LDFLAGS@ \
@PLPLOT_LDFLAGS@ @PGPLOT_LDFLAGS@ @PYTHON_LDFLAGS@
-LIBS = ../lib/libObit.a @CFITSIO_LIBS@ @FFTW_LIBS@ @FFTW3_LIBS@ @GLIB_LIBS@ \
+# Static library option
+# OBIT_LIB = ../lib/libObit.a
+# Shared library option
+OBIT_LIB = -L../lib -lObit
+
+LIBS = $(OBIT_LIB) @CFITSIO_LIBS@ @FFTW_LIBS@ @FFTW3_LIBS@ @GLIB_LIBS@ \
@GSL_LIBS@ @PLPLOT_LIBS@ @PGPLOT_LIBS@ @LIBS@ @FLIBS@ @GTHREAD_LIBS@
CLIENT_CPPFLAGS = $(ALL_CPPFLAGS) @XMLRPC_CLIENT_CPPFLAGS@
@@ -71,12 +76,13 @@ SERVER_LIBS = @XMLRPC_SERVER_LIBS@
SWIG = @SWIG@
# Libraries in case they've changed
-MYLIBS := $(wildcard ../lib/lib*.a)
+# MYLIBS := $(wildcard ../lib/lib*.a)
+MYLIBS := $(wildcard ../lib/lib*.dylib)
# Do everything in one big module
-TARGETS := Obit.so
+TARGETS := Obit.so
-all: $(TARGETS)
+all: install
# Build shared library for python interface
$(TARGETS): setupdata.py $(MYLIBS)
@@ -84,6 +90,10 @@ $(TARGETS): setupdata.py $(MYLIBS)
python makesetup.py
python setup.py build install --install-lib=.
+install: $(TARGETS)
+ mkdir -p build/site-packages
+ cp *.py $(TARGETS) build/site-packages
+
# Build python/Obit interface
interface: Obit_wrap.c
echo "rebuild Obit/python interface"
diff --git a/Obit/Makefile.in b/Obit/Makefile.in
index b76a1a4..d2667ac 100644
--- a/Obit/Makefile.in
+++ b/Obit/Makefile.in
@@ -87,7 +87,7 @@ srcupdate:
# update library directory
libupdate:
- cd lib; $(MAKE) RANLIB="$(RANLIB)"
+ cd lib; $(MAKE) RANLIB="$(RANLIB)" CC="$(CC)"
# update test software directory
testupdate:
diff --git a/ObitTalk/python/Makefile.in b/ObitTalk/python/Makefile.in
index d2a2b26..e479a41 100644
--- a/ObitTalk/python/Makefile.in
+++ b/ObitTalk/python/Makefile.in
@@ -76,8 +76,8 @@ PROXYTAR:= $(DESTDIR)$(PYTHONDIR)/Proxy/AIPSData.py \
WIZTAR:= $(DESTDIR)$(PYTHONDIR)/Wizardry/AIPSData.py \
$(DESTDIR)$(PYTHONDIR)/Wizardry/__init__.py
-# make all = directories
-all: $(DESTDIR)$(PREFIX)/share $(DESTDIR)$(PREFIX)/share/obittalk
+all:
+ echo "Nothing to make."
install: $(PYTHONTAR) $(PROXYTAR) $(WIZTAR)
diff --git a/Obit/Makefile.in b/Obit/Makefile.in
index d2667ac..bf2c392 100644
--- a/Obit/Makefile.in
+++ b/Obit/Makefile.in
@@ -56,7 +56,7 @@ DISTRIB = @PACKAGE_TARNAME@@PACKAGE_VERSION@
DIRN = @PACKAGE_NAME@
#------------------------------------------------------------------------
-TARGETS = versionupdate cfitsioupdate xmlrpcupdate srcupdate libupdate \
+TARGETS = cfitsioupdate xmlrpcupdate srcupdate libupdate \
pythonupdate taskupdate
all: $(TARGETS)
diff --git a/Obit/Makefile.in b/Obit/Makefile.in
index bf2c392..2b27f6e 100644
--- a/Obit/Makefile.in
+++ b/Obit/Makefile.in
@@ -86,15 +86,15 @@ srcupdate:
cd src; $(MAKE)
# update library directory
-libupdate:
+libupdate: srcupdate
cd lib; $(MAKE) RANLIB="$(RANLIB)" CC="$(CC)"
# update test software directory
-testupdate:
+testupdate: libupdate
cd test; $(MAKE)
# update task software directory
-taskupdate:
+taskupdate: libupdate
cd tasks; $(MAKE)
# update work directory
@@ -102,7 +102,7 @@ work:
cd src/work; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" LIB="$(LIB)"
# update python directory
-pythonupdate:
+pythonupdate: libupdate
cd python; $(MAKE)
# update from cvs repository
diff --git a/ObitTalk/python/Makefile.in b/ObitTalk/python/Makefile.in
index e479a41..b5eb152 100644
--- a/ObitTalk/python/Makefile.in
+++ b/ObitTalk/python/Makefile.in
@@ -95,7 +95,7 @@ $(DESTDIR)$(PREFIX)/share: $(DESTDIR)$(PREFIX)
$(DESTDIR)$(PREFIX)/share/obittalk: $(DESTDIR)$(PREFIX)/share
if test ! -d $(DESTDIR)$(PREFIX)/share/obittalk; then mkdir $(DESTDIR)$(PREFIX)/share/obittalk; fi
-$(DESTDIR)$(PYTHONDIR):$(DESTDIR)$(PREFIX)/share/obittalk
+$(DESTDIR)$(PYTHONDIR):
if test ! -d $(DESTDIR)$(PYTHONDIR); then mkdir $(DESTDIR)$(PYTHONDIR); fi
$(DESTDIR)$(PROXYDIR):$(DESTDIR)$(PYTHONDIR)
@@ -107,49 +107,49 @@ $(DESTDIR)$(WIZDIR):$(DESTDIR)$(PYTHONDIR)
$(DESTDIR)$(PYTHONDIR)/AIPSData.py: AIPSData.py $(DESTDIR)$(PYTHONDIR)
cp AIPSData.py $@
-$(DESTDIR)$(PYTHONDIR)/AIPS.py: AIPS.py
+$(DESTDIR)$(PYTHONDIR)/AIPS.py: AIPS.py $(DESTDIR)$(PYTHONDIR)
cp AIPS.py $@
-$(DESTDIR)$(PYTHONDIR)/AIPSTask.py: AIPSTask.py
+$(DESTDIR)$(PYTHONDIR)/AIPSTask.py: AIPSTask.py $(DESTDIR)$(PYTHONDIR)
cp AIPSTask.py $@
-$(DESTDIR)$(PYTHONDIR)/AIPSTV.py: AIPSTV.py
+$(DESTDIR)$(PYTHONDIR)/AIPSTV.py: AIPSTV.py $(DESTDIR)$(PYTHONDIR)
cp AIPSTV.py $@
-$(DESTDIR)$(PYTHONDIR)/AIPSUtil.py: AIPSUtil.py
+$(DESTDIR)$(PYTHONDIR)/AIPSUtil.py: AIPSUtil.py $(DESTDIR)$(PYTHONDIR)
cp AIPSUtil.py $@
-$(DESTDIR)$(PYTHONDIR)/FITSData.py: FITSData.py
+$(DESTDIR)$(PYTHONDIR)/FITSData.py: FITSData.py $(DESTDIR)$(PYTHONDIR)
cp FITSData.py $@
-$(DESTDIR)$(PYTHONDIR)/FITS.py: FITS.py
+$(DESTDIR)$(PYTHONDIR)/FITS.py: FITS.py $(DESTDIR)$(PYTHONDIR)
cp FITS.py $@
-$(DESTDIR)$(PYTHONDIR)/LocalProxy.py: LocalProxy.py
+$(DESTDIR)$(PYTHONDIR)/LocalProxy.py: LocalProxy.py $(DESTDIR)$(PYTHONDIR)
cp LocalProxy.py $@
-$(DESTDIR)$(PYTHONDIR)/MinimalMatch.py: MinimalMatch.py
+$(DESTDIR)$(PYTHONDIR)/MinimalMatch.py: MinimalMatch.py $(DESTDIR)$(PYTHONDIR)
cp MinimalMatch.py $@
-$(DESTDIR)$(PYTHONDIR)/ObitTalk.py: ObitTalk.py
+$(DESTDIR)$(PYTHONDIR)/ObitTalk.py: ObitTalk.py $(DESTDIR)$(PYTHONDIR)
cp ObitTalk.py $@
-$(DESTDIR)$(PYTHONDIR)/ObitTalkUtil.py: ObitTalkUtil.py
+$(DESTDIR)$(PYTHONDIR)/ObitTalkUtil.py: ObitTalkUtil.py $(DESTDIR)$(PYTHONDIR)
cp ObitTalkUtil.py $@
-$(DESTDIR)$(PYTHONDIR)/ObitTask.py: ObitTask.py
+$(DESTDIR)$(PYTHONDIR)/ObitTask.py: ObitTask.py $(DESTDIR)$(PYTHONDIR)
cp ObitTask.py $@
-$(DESTDIR)$(PYTHONDIR)/ObitScript.py: ObitScript.py
+$(DESTDIR)$(PYTHONDIR)/ObitScript.py: ObitScript.py $(DESTDIR)$(PYTHONDIR)
cp ObitScript.py $@
-$(DESTDIR)$(PYTHONDIR)/otcompleter.py: otcompleter.py
+$(DESTDIR)$(PYTHONDIR)/otcompleter.py: otcompleter.py $(DESTDIR)$(PYTHONDIR)
cp otcompleter.py $@
-$(DESTDIR)$(PYTHONDIR)/Task.py: Task.py
+$(DESTDIR)$(PYTHONDIR)/Task.py: Task.py $(DESTDIR)$(PYTHONDIR)
cp Task.py $@
-$(DESTDIR)$(PYTHONDIR)/XMLRPCServer.py: XMLRPCServer.py
+$(DESTDIR)$(PYTHONDIR)/XMLRPCServer.py: XMLRPCServer.py $(DESTDIR)$(PYTHONDIR)
cp XMLRPCServer.py $@
@@ -160,32 +160,32 @@ $(DESTDIR)$(PYTHONDIR)/Proxy/AIPSData.py: Proxy/AIPSData.py $(DESTDIR)$(PROXYDIR
$(DESTDIR)$(PYTHONDIR)/Proxy/FITSData.py: Proxy/FITSData.py $(DESTDIR)$(PROXYDIR)
cp ./Proxy/FITSData.py $@
-$(DESTDIR)$(PYTHONDIR)/Proxy/AIPS.py: Proxy/AIPS.py
+$(DESTDIR)$(PYTHONDIR)/Proxy/AIPS.py: Proxy/AIPS.py $(DESTDIR)$(PROXYDIR)
cp ./Proxy/AIPS.py $@
-$(DESTDIR)$(PYTHONDIR)/Proxy/AIPSTask.py: Proxy/AIPSTask.py
+$(DESTDIR)$(PYTHONDIR)/Proxy/AIPSTask.py: Proxy/AIPSTask.py $(DESTDIR)$(PROXYDIR)
cp ./Proxy/AIPSTask.py $@
-$(DESTDIR)$(PYTHONDIR)/Proxy/__init__.py: Proxy/__init__.py
+$(DESTDIR)$(PYTHONDIR)/Proxy/__init__.py: Proxy/__init__.py $(DESTDIR)$(PROXYDIR)
cp ./Proxy/__init__.py $@
-$(DESTDIR)$(PYTHONDIR)/Proxy/ObitTask.py: Proxy/ObitTask.py
+$(DESTDIR)$(PYTHONDIR)/Proxy/ObitTask.py: Proxy/ObitTask.py $(DESTDIR)$(PROXYDIR)
cp ./Proxy/ObitTask.py $@
-$(DESTDIR)$(PYTHONDIR)/Proxy/ObitScriptP.py: Proxy/ObitScriptP.py
+$(DESTDIR)$(PYTHONDIR)/Proxy/ObitScriptP.py: Proxy/ObitScriptP.py $(DESTDIR)$(PROXYDIR)
cp ./Proxy/ObitScriptP.py $@
-$(DESTDIR)$(PYTHONDIR)/Proxy/Popsdat.py: Proxy/Popsdat.py
+$(DESTDIR)$(PYTHONDIR)/Proxy/Popsdat.py: Proxy/Popsdat.py $(DESTDIR)$(PROXYDIR)
cp ./Proxy/Popsdat.py $@
-$(DESTDIR)$(PYTHONDIR)/Proxy/Task.py: Proxy/Task.py
+$(DESTDIR)$(PYTHONDIR)/Proxy/Task.py: Proxy/Task.py $(DESTDIR)$(PROXYDIR)
cp ./Proxy/Task.py $@
# Wizardry
$(DESTDIR)$(PYTHONDIR)/Wizardry/AIPSData.py: Wizardry/AIPSData.py $(DESTDIR)$(WIZDIR)
cp ./Wizardry/AIPSData.py $@
-$(DESTDIR)$(PYTHONDIR)/Wizardry/__init__.py: Wizardry/__init__.py
+$(DESTDIR)$(PYTHONDIR)/Wizardry/__init__.py: Wizardry/__init__.py $(DESTDIR)$(WIZDIR)
cp ./Wizardry/__init__.py $@
clean:
diff --git a/ObitView/Makefile.in b/ObitView/Makefile.in
index fbfa6cb..ec98c8a 100644
--- a/ObitView/Makefile.in
+++ b/ObitView/Makefile.in
@@ -88,47 +88,47 @@ CLIENT_LIBS = lib/libObitView.a @MOTIF_LIBS@ @X_LIBS@ @OBIT_LIBS@ @GLIB_LIBS@ \
all: $(TARGETS)
# update source/object directory
-srcupdate:
+srcupdate: src/*.c
cd src; $(MAKE)
# update library directory
-libupdate:
+libupdate: srcupdate
cd lib; $(MAKE) RANLIB="$(RANLIB)"
# Link ObitView
-ObitView: src/*.c srcupdate ObitView.c
+ObitView: libupdate ObitView.c
$(CC) ObitView.c -o ObitView $(SERVER_CFLAGS) $(SERVER_CPPFLAGS) \
$(SERVER_LDFLAGS) $(SERVER_LIBS) $(CLIENT_LIBS)
# Link ObitMess
-ObitMess: src/*.c srcupdate ObitMess.c
+ObitMess: libupdate ObitMess.c
$(CC) ObitMess.c -o ObitMess $(SERVER_CFLAGS) $(SERVER_CPPFLAGS) \
$(SERVER_LDFLAGS) $(SERVER_LIBS) $(CLIENT_LIBS)
# Link clientTest
-clientTest: clientTest.c
+clientTest: libupdate clientTest.c
$(CC) clientTest.c -o clientTest -Iinclude $(CLIENT_CFLAGS) \
$(CLIENT_CPPFLAGS) $(CLIENT_LDFLAGS) \
$(CLIENT_LIBS)
# Link clientFCopy
-clientFCopy: clientFCopy.c
+clientFCopy: libupdate clientFCopy.c
$(CC) clientFCopy.c -o clientFCopy -Iinclude $(CLIENT_CFLAGS) \
$(CLIENT_CPPFLAGS) $(CLIENT_LDFLAGS) \
$(CLIENT_LIBS)
# test run ObitView
-testObitView:
+testObitView: ObitView
ObitView aaaSomeFile.fits
# test run ObitMess
-testObitMess:
+testObitMess: ObitMess
ObitMess &
# Need to wait to start
python testObitMess.py
# Copy to where it should go
-install: @exec_prefix@/bin
+install: @exec_prefix@/bin ObitView ObitMess
@install_sh@ -s ObitView @exec_prefix@/bin/
@install_sh@ -s ObitMess @exec_prefix@/bin/
diff --git a/Obit/python/makesetup.py b/Obit/python/makesetup.py
index 58740a0..5e9e2c2 100644
--- a/Obit/python/makesetup.py
+++ b/Obit/python/makesetup.py
@@ -109,6 +109,6 @@ outfile.write(' [\''+packageName+'_wrap.c\'],'+os.l
outfile.write(' extra_compile_args='+str(compileArgs)+','+os.linesep)
outfile.write(' library_dirs='+str(libDirs)+','+os.linesep)
outfile.write(' libraries='+str(libs)+','+os.linesep)
-outfile.write(' runtime_library_dirs='+str(runtimeLibDirs)+')],'+os.linesep)
-outfile.write(' include_dirs='+str(incDirs)+os.linesep)
+outfile.write(' runtime_library_dirs='+str(runtimeLibDirs)+','+os.linesep)
+outfile.write(' include_dirs='+str(incDirs)+')]'+os.linesep)
outfile.write(')')