TF_CFLAGS := $(shell python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))')
TF_LFLAGS := $(shell python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))')

all:
	nvcc -std=c++11 -c -o cuda_fmod.cu.o cuda_fmod.cu.cc $(TF_CFLAGS) -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -I/usr/local -expt-relaxed-constexpr
	g++ -std=c++11 -shared -o cuda_fmod.so cuda_fmod.cc  cuda_fmod.cu.o $(TF_CFLAGS) -fPIC  $(TF_LFLAGS)

clean:
	rm cuda_fmod.cu.o cuda_fmod.so
