I'm working remotely on Linux operating system, where I'm trying to compile a .cu file.
The folder contains a main.cu file which does an histogram equalization. It uses opencv libraries.
How should I create the makefile? Everything I tried didn't work.
I got this error: undefined reference to cv::imread(cv::String const&, int)'
Is this the right way to make a makefile?
BINARY=cuda
SOURCES= main.cu
LIBPATHS = /usr/include/opencv2/libopencv_highgui.so
CC=nvcc
OBJECTS=$(SOURCES:.cu=.o)
INCFLAGS=$(foreach TMP,$(INCPATHS),-I$(TMP))
LIBFLAGS=$(foreach TMP,$(LIBPATHS),-L$(TMP))
OPENCV = `pkg-config opencv --cflags --libs`
LIBS = $(OPENCV)
$(PROG):$(SRCS)
$(CC) $(CFLAGS) -o $(PROG) $(SRCS) $(LIBS)
all:
$(CC) $(INCFLAGS) $(SOURCES) -o $(BINARY)
distclean:
rm -f $(BINARY)
clean:
rm -f $(BINARY)
I got these two include in my main.cu file:
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
Thanks a lot