-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
618 lines (504 loc) · 18.2 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
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
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
# Nmag micromagnetic simulator
# Copyright (C) 2011 University of Southampton
# Hans Fangohr, Thomas Fischbacher, Matteo Franchin and others
#
# WEB: http://nmag.soton.ac.uk
# CONTACT: [email protected]
#
# AUTHOR(S) OF THIS FILE: Matteo Franchin
# LICENSE: GNU General Public License 2.0
# (see <http://www.gnu.org/licenses/>)
# We want bash to be our shell!
SHELL=bash
PATCH=patch
# Where to find the newest nsim 0.1 core tarball
NSIMCORETARBALL=http://nmag.soton.ac.uk/nmag/0.1/download/nmag-0.1-core.tar.gz
# List of packages we are using at the moment
ATLAS_PKG=pkgs/atlas3.6.0.tar.gz
LAPACK_PKG=pkgs/lapack.tgz
OCAML_PKG=pkgs/ocaml-3.12.0.tar.bz2
OCAMLFINDLIB_PKG=pkgs/findlib-1.2.1.tar.gz
CRYPTOKIT_PKG=pkgs/cryptokit-1.2.tar.gz
QHULL_PKG=pkgs/qhull-2003.1.tar.gz
GSL_PKG=pkgs/gsl-1.14.tar.gz
OCAMLGSL_PKG=pkgs/ocamlgsl-0.6.0.tar.gz
MPICH2_PKG=pkgs/mpich2-1.2.1p1.tar.gz
PETSC_PKG=pkgs/petsc-lite-3.1-p5.tar.gz
PARMETIS_PKG=pkgs/ParMetis-3.1.1.tar.gz
PYTHON_PKG=pkgs/Python-2.7.2.tar.bz2
IPYTHON_PKG=pkgs/ipython-0.10.tar.gz
PYTHON_NUMPY_PKG=pkgs/numpy-1.5.0.tar.gz
PYTHON_PYVTK_PKG=pkgs/PyVTK-0.latest.tar.gz
PYTHON_NUMARRAY_PKG=pkgs/numarray-1.5.2.tar.gz
PYTHON_PYTABLES_PKG=pkgs/tables-2.1.2.tar.gz
PYTHON_SCIPY_PKG=pkgs/scipy-0.7.2.tar.gz
PYTHON_PY_PKG=pkgs/py-0.9.1.tar.gz
PYTHON_PLY_PKG=pkgs/ply-3.3.tar.gz
SUNDIALS_PKG=pkgs/sundials-2.3.0.tar.gz
HDF5_PKG=pkgs/hdf5-1.8.7.tar.bz2
EXPECTED_HLIB_PKG=HLib-1.3p19.tar.gz
EXPECTED_HLIB_VER="1.3p19"
LOCAL_PATH=${PWD}
LOCAL_BIN=$(LOCAL_PATH)/bin
LOCAL_LIB=$(LOCAL_PATH)/lib
LOCAL_INCLUDE=$(LOCAL_PATH)/include
PYTHON=$(LOCAL_BIN)/python
FINDLIB_DESTDIR=$(LOCAL_PATH)/lib/ocaml
MPICH2_PATH=$(LOCAL_PATH)/lib/mpich2
MPICH2_LIB_PATH=$(MPICH2_PATH)/lib
MPICH2_BIN_PATH=$(MPICH2_PATH)/bin
PETSC_LIB_PATH=$(LOCAL_PATH)/lib/petsc
PETSC_INCLUDE_PATH=$(PETSC_LIB_PATH)/include
PETSC_VERSION=2.3.1
PETSC_DEFINE=PETSC230
EXPORT_PATHS=./export_paths.sh
NSIM_LDFLAGS_FILE=nsim/bin/ldflags.bash
COPTFLAGS=-O3 #-m32 -march=athlon64 -msse2 -m3dnow -mfpmath=sse"
PETSC_MORE_CONFIG_OPTS=-COPTFLAGS=$(COPTFLAGS) -CXXOPTFLAGS=$(COPTFLAGS)
# --with-blas-lapack-dir=$(LOCAL_PATH)/atlas/lib/Linux_HAMMER32SSE2_2
DIST_FILES=README INSTALL TODO patches/nsimconfigure Makefile bin etc include \
info lib man share patches nsim pkgs
.PHONY: all anyway uninstall clean dist python_tools create-bin-links \
check checkall check-all hints update hlib-check deps-check hierarchy \
rebuild
all: hlib-check deps-check anyway
anyway: .deps_nsim_install python_tools create-bin-links hints
hlib-check: nsim/interface/extra/lib/libhmatrix-1.3.so
deps-check:
@$(SHELL) ./patches/check-deps.sh
nsim/interface/extra/lib/libhmatrix-1.3.so:
@$(SHELL) ./patches/hlib/hlib-untar.sh ./hlib-pkg $(EXPECTED_HLIB_PKG); \
if [ $$? -eq 0 ]; \
then rm -f .deps_hlib_patch; $(MAKE) .deps_hlib_install; \
else true; fi
.deps_hlib_patch:
cp nsim/config/hlibpatch.diff.gz hlib/ && \
(cd hlib && gunzip -c hlibpatch.diff.gz | $(PATCH) -p1) && \
touch .deps_hlib_patch
.deps_hlib_configure: .deps_hlib_patch
cd hlib && \
./configure --prefix=$(LOCAL_PATH)/nsim/interface/extra \
--enable-shared && cd ..
touch .deps_hlib_configure
.deps_hlib_build: .deps_hlib_configure
cd hlib && make && cd ..
touch .deps_hlib_build
.deps_hlib_install: .deps_hlib_build
cd hlib && make install && cd ..
touch .deps_hlib_install
$(EXPORT_PATHS):
export PATH=$(LOCAL_BIN):$(MPICH2_BIN_PATH):\$$PATH > $(EXPORT_PATHS)
echo export PETSC_DIR=$(PETSC_LIB_PATH) >> $(EXPORT_PATHS)
echo export LD_LIBRARY_PATH=$(LOCAL_LIB):$(MPICH2_LIB_PATH):\$$LD_LIBRARY_PATH >> $(EXPORT_PATHS)
config.status: patches/nsimconfigure
$(SHELL) patches/nsimconfigure
.deps_atlas_untar:
tar xzvf $(ATLAS_PKG)
[ -d atlas ] || mv ATLAS* atlas
touch .deps_atlas_untar
.deps_lapack_untar:
tar xzvf $(LAPACK_PKG)
mv lapack* lapack
touch .deps_lapack_untar
.deps_ocaml_untar:
tar xjvf $(OCAML_PKG)
mv ocaml* ocaml
touch .deps_ocaml_untar
.deps_ocaml_patch: .deps_ocaml_untar
cd ocaml && ../patches/ocaml/patches.sh
touch .deps_ocaml_patch
.deps_ocaml_configure: .deps_ocaml_patch
cd ocaml && ./configure -prefix $(LOCAL_PATH) && cd ..
touch .deps_ocaml_configure
.deps_ocaml_build: .deps_ocaml_configure
cd ocaml && make world.opt && cd ..
touch .deps_ocaml_build
.deps_ocaml_install: .deps_ocaml_build
cd ocaml && make install && cd ..
touch .deps_ocaml_install
.deps_findlib_untar: .deps_ocaml_install
tar xzvf $(OCAMLFINDLIB_PKG)
mv findlib* findlib
touch .deps_findlib_untar
.deps_findlib_configure: .deps_findlib_untar
export PATH=$(LOCAL_BIN):$$PATH && cd findlib && \
./configure -sitelib $(FINDLIB_DESTDIR)/site-lib && cd ..
touch .deps_findlib_configure
.deps_findlib_build: .deps_findlib_configure
export PATH=$(LOCAL_BIN):$$PATH && cd findlib && make all && cd ..
touch .deps_findlib_build
.deps_findlib_install: .deps_findlib_build
export PATH=$(LOCAL_BIN):$$PATH && cd findlib && make install && cd ..
touch .deps_findlib_install
.deps_findlib_setup: .deps_findlib_install
sed "s,__DESTDIR,$(FINDLIB_DESTDIR),g" patches/findlib/findlib.conf > etc/findlib.conf
touch .deps_findlib_setup
.deps_ocaml_all: .deps_findlib_setup
touch .deps_ocaml_all
.deps_cryptokit_untar: .deps_ocaml_all
tar xzvf $(CRYPTOKIT_PKG)
mv cryptokit* cryptokit
touch .deps_cryptokit_untar
.deps_cryptokit_patch: .deps_cryptokit_untar
cp patches/cryptokit/* cryptokit
sh patches/cryptokit/patch.sh $(LOCAL_PATH)/cryptokit
touch .deps_cryptokit_patch
.deps_cryptokit_build: .deps_cryptokit_patch
export PATH=$(LOCAL_BIN):$$PATH && cd cryptokit && make all allopt && cd ..
touch .deps_cryptokit_build
.deps_cryptokit_install: .deps_cryptokit_build
export PATH=$(LOCAL_BIN):$$PATH && cd cryptokit && \
make -f Makefile.CED install && cd ..
touch .deps_cryptokit_install
.deps_qhull_untar:
tar xzvf $(QHULL_PKG)
mv qhull* qhull
touch .deps_qhull_untar
.deps_qhull_configure: .deps_qhull_untar
cd qhull && ./configure --prefix=$(LOCAL_PATH) && cd ..
touch .deps_qhull_configure
.deps_qhull_build: .deps_qhull_configure
cd qhull && make && cd ..
touch .deps_qhull_build
.deps_qhull_install: .deps_qhull_build
cd qhull && make install && cd ..
touch .deps_qhull_install
.deps_gsl_untar:
tar xzvf $(GSL_PKG)
mv gsl* gsl
touch .deps_gsl_untar
.deps_gsl_configure: .deps_gsl_untar
cd gsl && ./configure --prefix=$(LOCAL_PATH) && cd ..
touch .deps_gsl_configure
.deps_gsl_build: .deps_gsl_configure
cd gsl && make && cd ..
touch .deps_gsl_build
.deps_gsl_install: .deps_gsl_build
cd gsl && make install && cd ..
touch .deps_gsl_install
.deps_ocamlgsl_untar: .deps_gsl_install
tar xzvf $(OCAMLGSL_PKG)
mv ocamlgsl* ocamlgsl
touch .deps_ocamlgsl_untar
.deps_ocamlgsl_patch: .deps_ocamlgsl_untar
cp patches/ocamlgsl/* ocamlgsl/
touch .deps_ocamlgsl_patch
.deps_ocamlgsl_build: .deps_ocamlgsl_patch
export PATH=$(LOCAL_BIN):$$PATH && cd ocamlgsl && make && cd ..
touch .deps_ocamlgsl_build
.deps_ocamlgsl_install: .deps_ocamlgsl_build
export PATH=$(LOCAL_BIN):$$PATH && \
cd ocamlgsl && make install-findlib && cd ..
touch .deps_ocamlgsl_install
.deps_mpich2_untar:
tar xzvf $(MPICH2_PKG)
mv mpich2* mpich2
touch .deps_mpich2_untar
.deps_mpich2_configure: .deps_mpich2_untar config.status
mkdir -p $(MPICH2_PATH)
. ./config.status && \
cd mpich2 && \
./configure --prefix=$(MPICH2_PATH) -disable-f77 -disable-f90 \
--enable-sharedlibs=$$GCC_FLAVOUR && \
cd ..
touch .deps_mpich2_configure
.deps_mpich2_build: .deps_mpich2_configure
cd mpich2 && make && cd ..
touch .deps_mpich2_build
.deps_mpich2_install: .deps_mpich2_build config.status
cd mpich2 && make install && cd .. && \
. ./config.status && \
[ -f lib/mpich2/lib/libmpi$$SHLIB_SUFFIX ] \
|| (cd lib/mpich2/lib && \
$$LN_S libmpich$$SHLIB_SUFFIX libmpi$$SHLIB_SUFFIX)
touch .deps_mpich2_install
.deps_petsc_untar: .deps_python_install
tar xzvf $(PETSC_PKG)
mv petsc* $(PETSC_LIB_PATH)
touch .deps_petsc_untar
.deps_petsc_patch: .deps_petsc_untar
$(SHELL) patches/petsc/patches.sh $(PETSC_LIB_PATH)
touch .deps_petsc_patch
# for Intel MKL you may need to use:
# --with-blas-lapack-lib="-L/local/software/intel/mkl/10.2.1.017/lib/em64t \
# -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core \
# -liomp5 -lm -lpthread" && \
.deps_petsc_configure: .deps_petsc_patch .deps_mpich2_install $(EXPORT_PATHS)
. $(EXPORT_PATHS) && \
cd $(PETSC_LIB_PATH) && \
$(PYTHON) ./config/configure.py --with-shared \
--with-single-library=1 \
--with-mpi-dir=$(MPICH2_PATH) $(PETSC_MORE_CONFIG_OPTS) \
--with-debugging=no && \
cd ..
touch .deps_petsc_configure
.deps_petsc_build: .deps_petsc_configure
cd $(PETSC_LIB_PATH) && \
export PATH=$(MPICH2_BIN_PATH):$$PATH && \
export PETSC_DIR=$(PETSC_LIB_PATH) && \
make all && \
cd ..
touch .deps_petsc_build
set_petsc_arch.sh: .deps_petsc_build
PETSC_ARCH=`grep -e 'PETSC_ARCH[ \t]*=' $(PETSC_LIB_PATH)/conf/petscvariables | cut -d = -f 2` && \
echo PETSC_ARCH=$$PETSC_ARCH > set_petsc_arch.sh
.deps_petsc_setup: set_petsc_arch.sh
. ./set_petsc_arch.sh; \
cp $(PETSC_LIB_PATH)/$${PETSC_ARCH}/include/*.h $(PETSC_INCLUDE_PATH)/ && \
touch .deps_petsc_setup
.deps_parmetis_untar:
tar xzvf $(PARMETIS_PKG)
mv ParMetis* parmetis
touch .deps_parmetis_untar
.deps_parmetis_patch: config.status .deps_parmetis_untar
cat patches/parmetis/Makefile >> parmetis/Makefile
#This sed scripts won't work if the local path contains commas.
# Normally this should't happen but one never knows...
. ./config.status && \
sed -e "s/__SHLIB_SUFFIX__/$$SHLIB_SUFFIX/g" \
-e "s,__INSTALL_PATH__,$(LOCAL_LIB),g" \
-e "s/__SHARED__/$$SHLIB_OPTS/g" \
patches/parmetis/metis/Makefile >> parmetis/METISLib/Makefile && \
sed -e "s/__SHLIB_SUFFIX__/$$SHLIB_SUFFIX/g" \
-e "s,__INSTALL_PATH__,$(LOCAL_LIB),g" \
-e "s/__SHARED__/$$SHLIB_OPTS/g" \
patches/parmetis/parmetis/Makefile >> parmetis/ParMETISLib/Makefile && \
mv parmetis/ParMETISLib/stdheaders.h parmetis/ParMETISLib/stdheaders.h.old && \
sed "s,malloc.h,$$MALLOC_INC,g" parmetis/ParMETISLib/stdheaders.h.old \
> parmetis/ParMETISLib/stdheaders.h
cat patches/parmetis/Makefile.in >> parmetis/Makefile.in
touch .deps_parmetis_patch
.deps_parmetis_build: .deps_parmetis_patch
cd parmetis && \
export PATH=$(MPICH2_BIN_PATH):$$PATH && \
export PETSC_DIR=$(PETSC_LIB_PATH) && \
export PETSC_ARCH= && \
make default shared && cd ..
touch .deps_parmetis_build
.deps_parmetis_install: .deps_parmetis_build
cp parmetis/parmetis.h include/
cp parmetis/lib*metis.* lib/
touch .deps_parmetis_install
.deps_python_untar:
tar xjvf $(PYTHON_PKG)
mv Python* python
touch .deps_python_untar
.deps_python_configure: .deps_python_untar
cd python && ./configure --enable-shared --prefix=$(LOCAL_PATH) && cd ..
touch .deps_python_configure
.deps_python_build: .deps_python_configure
cd python && make && cd ..
touch .deps_python_build
.deps_python_install: .deps_python_build
cd python && make install && cd ..
touch .deps_python_install
.deps_sundials_untar: .deps_mpich2_install
tar xzvf $(SUNDIALS_PKG)
[ -d sundials ] || mv sundials* sundials
touch .deps_sundials_untar
.deps_sundials_configure: .deps_sundials_untar
cd sundials && \
export PATH=$(MPICH2_BIN_PATH):$$PATH && \
./configure --disable-f77 --enable-shared --prefix=$(LOCAL_PATH) --with-mpi-root=$(MPICH2_PATH) && \
cd ..
touch .deps_sundials_configure
.deps_sundials_build: .deps_sundials_configure
cd sundials && make && cd ..
touch .deps_sundials_build
.deps_sundials_install: .deps_sundials_build
cd sundials && make install && cd .. && \
sh patches/sundials/adjust_install.sh $(LOCAL_PATH)
touch .deps_sundials_install
.deps_numpy_untar: .deps_python_install
tar xzvf $(PYTHON_NUMPY_PKG)
mv numpy-* numpy
touch .deps_numpy_untar
.deps_numpy_install: .deps_numpy_untar $(EXPORT_PATHS)
. $(EXPORT_PATHS) && cd numpy && \
$(PYTHON) setup.py install && \
cd ..
touch .deps_numpy_install
.deps_pyvtk_untar: .deps_python_install .deps_numpy_install
tar xzvf $(PYTHON_PYVTK_PKG)
mv PyVTK* pyvtk
touch .deps_pyvtk_untar
.deps_pyvtk_install: .deps_pyvtk_untar $(EXPORT_PATHS)
. $(EXPORT_PATHS) && cd pyvtk && \
$(PYTHON) setup.py install && \
cd ..
touch .deps_pyvtk_install
.deps_hdf5_untar:: .deps_python_install
tar xjvf $(HDF5_PKG)
mv hdf5-* hdf5
touch .deps_hdf5_untar
.deps_hdf5_configure: .deps_hdf5_untar
cd hdf5 && \
./configure --prefix=$(LOCAL_PATH) && cd ..
touch .deps_hdf5_configure
.deps_hdf5_build: .deps_hdf5_configure
cd hdf5 && make && cd ..
touch .deps_hdf5_build
.deps_hdf5_install: .deps_hdf5_build
cd hdf5 && make install && cd ..
touch .deps_hdf5_install
.deps_numarray_untar: .deps_python_install
tar xzvf $(PYTHON_NUMARRAY_PKG)
mv numarray-* numarray
touch .deps_numarray_untar
.deps_numarray_install: .deps_numarray_untar $(EXPORT_PATHS)
. $(EXPORT_PATHS) && cd numarray && \
$(PYTHON) setup.py install && \
cd ..
touch .deps_numarray_install
.deps_pytables_untar: .deps_python_install .deps_hdf5_install .deps_numarray_install
tar xzvf $(PYTHON_PYTABLES_PKG)
mv tables-* pytables
touch .deps_pytables_untar
.deps_pytables_install: .deps_pytables_untar $(EXPORT_PATHS)
. $(EXPORT_PATHS) && export HDF5_DIR=$(LOCAL_PATH) && \
cd pytables && \
$(PYTHON) setup.py install && \
cd ..
touch .deps_pytables_install
.deps_py_untar: .deps_python_install
tar xzvf $(PYTHON_PY_PKG)
mv py-* py
touch .deps_py_untar
.deps_py_patch: .deps_py_untar
cd py && $(PATCH) -p1 < ../patches/py/py.patch
touch .deps_py_patch
.deps_py_install: .deps_py_patch $(EXPORT_PATHS)
. $(EXPORT_PATHS) && \
cd py && \
$(PYTHON) setup.py install && \
cd ..
touch .deps_py_install
.deps_ply_untar:
rm -rf ply-?.?
tar xzvf $(PYTHON_PLY_PKG)
mv ply-?.? ply
touch .deps_ply_untar
.deps_ply_install: .deps_python_install .deps_ply_untar
. $(EXPORT_PATHS) && \
cd ply && \
$(PYTHON) setup.py install && \
cd ..
touch .deps_ply_install
.deps_scipy_untar:
rm -rf scipy scipy-?.?.?
tar xzvf $(PYTHON_SCIPY_PKG)
mv scipy-?.?.? scipy
touch .deps_scipy_untar
.deps_scipy_install: .deps_scipy_untar
. $(EXPORT_PATHS) && \
cd scipy && $(PYTHON) setup.py install && cd ..
touch .deps_scipy_install
.deps_ipython_untar: .deps_python_install
tar xzvf $(IPYTHON_PKG)
rm -rf ipython && mv ipython-* ipython
touch .deps_ipython_untar
.deps_ipython_install: .deps_ipython_untar $(EXPORT_PATHS)
. $(EXPORT_PATHS) && cd ipython && $(PYTHON) setup.py install && cd ..
touch .deps_ipython_install
exports.bash: set_petsc_arch.sh
echo export PATH=$(LOCAL_BIN):$(MPICH2_BIN_PATH):\$$PATH > exports.bash
echo export PETSC_DIR=$(PETSC_LIB_PATH) >> exports.bash
. ./set_petsc_arch.sh && \
echo export LD_LIBRARY_PATH=$(LOCAL_PATH)/lib:$(PETSC_LIB_PATH)/$${PETSC_ARCH}/lib:$(MPICH2_LIB_PATH):\$$LD_LIBRARY_PATH >> exports.bash && \
echo export PETSC_ARCH=$${PETSC_ARCH}
cp exports.bash $(NSIM_LDFLAGS_FILE)
$(NSIM_LDFLAGS_FILE): exports.bash
cp exports.bash $@
nsim/interface/nsim/configuration.py: nsim/configure.py set_petsc_arch.sh \
exports.bash .deps_numpy_install
. ./set_petsc_arch.sh && . exports.bash && cd nsim && \
$(PYTHON) configure.py \
--libdir=$(LOCAL_LIB) \
--includedir=$(LOCAL_INCLUDE) \
--full-lib-name \
--with-single-petsc-lib \
--petsc-libdir=$(PETSC_LIB_PATH)/$$PETSC_ARCH/lib \
--mpi-libdir=$(MPICH2_LIB_PATH) \
--mpi-includedir=$(MPICH2_PATH)/include \
--pmpich-libdir=$(MPICH2_LIB_PATH) \
--petsc-includedir=$(LOCAL_LIB)/petsc/include \
--metis-includedir=$(LOCAL_PATH)/parmetis/METISLib && \
cd ..
.deps_nsim_install: .deps_ocaml_all \
.deps_qhull_install \
.deps_mpich2_install .deps_petsc_setup \
.deps_parmetis_install .deps_python_install \
.deps_sundials_install \
exports.bash $(NSIM_LDFLAGS_FILE) nsim/interface/nsim/configuration.py
. ./exports.bash && cd nsim && ${MAKE} all-log install && cd ..
touch .deps_nsim_install
rebuild:
rm -f nsim/interface/nsim/configuration.py
$(MAKE) .deps_nsim_install
python_tools: .deps_numpy_install .deps_pyvtk_install .deps_pytables_install \
.deps_ipython_install .deps_py_install .deps_ply_install
create-bin-links:
@SRC_BINS=`ls nsim/bin`; \
if [ -d ./bin ]; then \
cd bin; \
SEP="Creating links in ./bin to the nsim bin directory nsim/bin: "; \
for BIN in $$SRC_BINS; do \
if [ ! -f $$BIN ]; then \
echo -n "$$SEP$$BIN"; \
ln -s ../nsim/bin/$$BIN $$BIN; \
SEP=", "; \
fi; \
done; \
echo; \
fi
uninstall: clean
rm -rf bin/* etc/* lib/* nsim/interface/extra/* include/* share/* \
man/* info/* set_petsc_arch.sh exports.bash export_paths.sh \
config.sh config.status
clean:
rm -rf ocaml findlib cryptokit qhull gsl ocamlgsl mpich2 \
parmetis python sundials numpy numarray pyvtk \
hdf5 atlas lapack ipython pytables py hlib
rm -f .deps_*
dist:
NSIMDIST=$$(basename ${PWD}) && \
NSIMPATH=$$NSIMDIST && \
FILES="$(DIST_FILES)" && \
for FILE in $$FILES; do PRFX_FILES="$$PRFX_FILES $$NSIMPATH/$$FILE"; done && \
CD=$$(pwd) && cd .. && \
tar czvf $$CD/$$NSIMDIST.tar.gz --exclude $$NSIMDIST.tar.gz --exclude 'lib/*' \
--exclude 'bin/*' --exclude 'include/*' $$PRFX_FILES && cd $$CD
hints:
@echo
@echo "HINT: To be able to launch nsim more easily, append the "
@echo "following line to the end of your shell configuration file "
@echo "(for BASH users this file is .bashrc and can be found "
@echo "on your home directory ~/.bashrc):"
@echo export PATH='"'`pwd`/nsim/bin:'$$PATH"'
@echo
@echo "The nmag directory `pwd` should not be moved to another"
@echo "location. Doing so will make the package unusable, since"
@echo "absolute paths are hard-coded inside the nmag executables."
@echo
update:
@echo "Will start updating nmag in 5 seconds"
@sleep 5
@echo "Downloading the nmag tarball..."
wget -c $(NSIMCORETARBALL)
ln -s . nmag-0.1
(unlink Makefile && tar xzvf nmag-0.1-core.tar.gz)
rm -f nmag-0.1 nmag-0.1-core.tar.gz
configure-test-suite:
(cd nsim/tests/config && ../../bin/nsim --nolog setup.py)
check: configure-test-suite
cd nsim/tests; make check
checkall: configure-test-suite
cd nsim/tests; make checkall
checkslow: configure-test-suite
cd nsim/tests; make checkslow
checkmpi: configure-test-suite
cd nsim/tests; make checkmpi
checkhlib: configure-test-suite
cd nsim/tests; make checkhlib
hierarchy:
mkdir -p bin etc hlib-pkg include info lib man pkgs share