Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. SONAME = libtensorrtpro.so
  2. SOLINK = $(SONAME).0.0
  3. SOTARGET = $(SONAME).0.0.0
  4. cuda_arch = -gencode=arch=compute_75,code=sm_75 # NVIDIA GeForce RTX 2070
  5. SOLIB_OBJS = application/yolocrowd.o\
  6. tensorrt/cuda_tools.o tensorrt/ilogger.o \
  7. tensorrt/trt_infer.o tensorrt/trt_tensor.o
  8. SOLIB_CU_OBJS = application/yolocrowd_decode.o tensorrt/preprocess_kernel.o
  9. INCLUDE = -I../include/application \
  10. -I../include/tensorrt \
  11. -I../../../../../links/common/include \
  12. -I/usr/local/include/opencv4 \
  13. -I/usr/local/cuda/include
  14. CC = g++
  15. NVCC = nvcc
  16. RM = rm -f
  17. LN = ln -sf
  18. CXXFLAGS = -std=gnu++11 -g -O0 -Wall -fPIC -DLINUX -D__STDC_CONSTANT_MACROS
  19. NVCCFLAGS = -std=c++11 -g -w -O0 -Xcompiler "$(CXXFLAGS)" $(cuda_arch)
  20. LDPATH = -L../../../../../links/common/libs -L/usr/local/cuda/lib64 -L/home/flechazo/tools/TensorRT-8.5.3.1/lib
  21. LDFLAGS = -lpthread -ldl -lcommon\
  22. -lopencv_core -lopencv_imgproc -lopencv_imgcodecs \
  23. -lnvinfer -lnvinfer_plugin\
  24. -lcuda -lcudart
  25. .SUFFIXES: .cu .cpp .h .o
  26. .cpp.o:
  27. $(CC) $(CXXFLAGS) $(INCLUDE) -o $@ -c $<
  28. .cu.o:
  29. $(NVCC) $(NVCCFLAGS) $(INCLUDE) -o $@ -c $<
  30. $(SOTARGET): $(SOLIB_OBJS) $(SOLIB_CU_OBJS)
  31. $(CC) -shared -Wl,-Bsymbolic -o $@ $^ $(LDPATH) $(LDFLAGS)
  32. $(LN) $(SOTARGET) $(SOLINK)
  33. $(LN) $(SOLINK) $(SONAME)
  34. all: $(SOTARGET)
  35. clean:
  36. $(RM) $(SONAME) $(SOLIB_OBJS) $(SOLIB_CU_OBJS) $(SOLINK) $(SOTARGET)
  37. .PHONY: clean all