forked from fquiros/CEO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.mk.gmt
executable file
·74 lines (64 loc) · 2.28 KB
/
common.mk.gmt
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
GMTDOSPATH = $(HOME)/Dropbox/gmt_sim/gmt_dos
CEOPATH = $(GMTDOSPATH)/modules/CEO
CUDAPATH = /usr/local/cuda
PYTHONPATH = $(HOME)/anaconda
CEOPYPATH = $(CEOPATH)/python/ceo
NVCC = $(CUDAPATH)/bin/nvcc
CUDALIBPATH = $(CUDAPATH)/lib64
MATLABINCS = -I/priv/monarcas1/rconan/MATLAB/R2013a/extern/include \
-I/export/monarcas1/rconan/MATLAB/R2013a/toolbox/distcomp/gpu/extern/include
CUDALIBS = cusparse cufft cublas cudart cuda
NOWEBPATH = /usr
WEAVE = $(NOWEBPATH)/bin/noweave
TANGLE = $(NOWEBPATH)/bin/notangle
CPIF = $(NOWEBPATH)/bin/cpif
TEXTOPDF = pdflatex
NVCCFLAGS = -gencode=arch=compute_20,code=\"sm_20,compute_20\" \
--compiler-options=-ansi,-D_GNU_SOURCE,-fwrapv,-fPIC,-fno-omit-frame-pointer,-pthread,-fno-strict-aliasing -O2
LIBS = -L$(CEOPATH)/lib $(CUDALIBPATH:%=-L%) -lceo -lcurl -ljsmn $(CUDALIBS:%=-l%)
INCS = -I. -I$(CEOPATH)/include -I/usr/local/cuda/include/ -I$(PYTHONPATH)/include #$(MATLABINCS)
SHELL = /bin/bash
texsrc = $(nwsrc:%.nw=%.tex)
header = $(nwsrc:%.nw=%.h)
obj = $(nwsrc:%.nw=%.o)
sobj = $(nwsrc:%.nw=%.so)
cusrc = $(nwsrc:%.nw=%.cu)
nwcysrc = $(nwsrc:%.nw=%.cython.nw)
pxdsrc = $(nwcysrc:%.cython.nw=%.pxd)
pyxsrc = $(nwcysrc:%.cython.nw=%.pyx)
libsrc = $(CEOPATH)/lib/libceo.a
.SUFFIXES: .nw .tex .cu .mex .bin .py .pxd .pyx .so
.cu.o:
$(NVCC) $(INCS) $(NVCCFLAGS) -o $@ -c $<
.nw.tex:
$(WEAVE) -delay -index $< > $@
sed -i -e 's/LLL/<<</g' -e 's/RRR/>>>/g' $@
sed -i -e "s/label{eq:/label{$*.eq:/g" -e "s/ref{eq:/ref{$*.eq:/g" $@
sed -i -e "s/label{fig:/label{$*.fig:/g" -e "s/ref{fig:/ref{$*.fig:/g" $@
sed -i -e "s/label{tab:/label{$*.fig:/g" -e "s/ref{tab:/ref{$*.fig:/g" $@
sed -i -e "s/label{sec:/label{$*.sec:/g" -e "s/ref{sec:/ref{$*.sec:/g" $@
.nw.h:
$(TANGLE) -R$@ $< | $(CPIF) $@
sed -i -e 's/LLL/<<</g' -e 's/RRR/>>>/g' $@
cp $@ ../include/
.nw.cu:
$(TANGLE) -L -R$@ $< > $@
sed -i -e 's/LLL/<<</g' -e 's/RRR/>>>/g' $@
.nw.mex:
$(TANGLE) -L -R$@ $< > $@
sed -i -e 's/LLL/<<</g' -e 's/RRR/>>>/g' $@
mv $@ [email protected]
.nw.bin:
$(TANGLE) -L -R$@ $< > $@
sed -i -e 's/LLL/<<</g' -e 's/RRR/>>>/g' $@
mv $@ [email protected]
make -C $(CEOPATH) all
$(NVCC) $(INCS) $(LIBS) [email protected]
.nw.py:
$(TANGLE) -R$@ $< > $@
.nw.pxd:
$(TANGLE) -R$@ $< > $@
cp $@ $(CEOPYPATH)/
.nw.pyx:
$(TANGLE) -R$@ $< > $@
cp $@ $(CEOPYPATH)/