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' $@ 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' $@ cp $@ ../include/ .nw.cu: $(TANGLE) -L -R$@ $< > $@ sed -i -e 's/LLL/<<>>/g' $@ .nw.mex: $(TANGLE) -L -R$@ $< > $@ sed -i -e 's/LLL/<<>>/g' $@ mv $@ $@.cu .nw.bin: $(TANGLE) -L -R$@ $< > $@ sed -i -e 's/LLL/<<>>/g' $@ mv $@ $@.cu make -C $(CEOPATH) all $(NVCC) $(INCS) $(LIBS) $@.cu .nw.py: $(TANGLE) -R$@ $< > $@ .nw.pxd: $(TANGLE) -R$@ $< > $@ cp $@ $(CEOPYPATH)/ .nw.pyx: $(TANGLE) -R$@ $< > $@ cp $@ $(CEOPYPATH)/