...
For detailed function implementation, please refer to the following file:
View file | ||
---|---|---|
|
2.2. Linux Terminal
...
Compile
When compiling NN-related applications, it is necessary to include SDK's headers and libraries must be included.
Example of SDK Includes Path:
...
This is an example Makefile that just needs to be placed in ~/c3v/Models/yolov8s/wksp/yolov8s_uint8_nbg_unify Folder. And set the relevant VIVIANTE_ SDK_ DIR and TOOLCHAIN can complete the compilation of the app:
Code Block |
---|
BIN=sampleAppyolov8s_sample NN_SDK_DIR=Path to NN SDK directory TOOLCHAIN=Path to toolchain directory NN_SDK_INC=$(NN_SDK_DIR)/include NN_SDK_LIB=$(NN_SDK_DIR)/lib # 1.cross compile #CROSS_COMPILE=$(TOOLCHAIN)/aarch64-none-linux-gnu- #CC=$(CROSS_COMPILE)gcc #CXX=$(CROSS_COMPILE)g++ # 2.build in c3v #CC=gcc #CXX=g++ CFLAGS=-Wall -O3 INCLUDE += -I$(NN_SDK_INC) -I$(NN_SDK_INC)/HAL -I$(NN_SDK_INC)/ovxlib -I$(NN_SDK_INC)/jpeg LIBS += -L$(NN_SDK_LIB) -L./ -L$(STD_LOG_INC) LIBS += -lOpenVX -lOpenVXU -lOpenVX -lCLC -lVSC -lGAL -ljpeg -lovxlib -lm LIBS += -lNNArchPerf -lArchModelSw LIBS += -lstdc++ -ldl -lpthread -lgcc_s CFLAGS += $(INCLUDE) -fPIC SRCS=${wildcard *.c} SRCS+=${wildcard *.cpp} OBJS=$(addsuffix .o, $(basename $(SRCS))) .SUFFIXES: .hpp .cpp .c .cpp.o: $(CXX) $(CFLAGS) -std=c++11 -c $< .c.o: $(CC) $(CFLAGS) -c $< all: $(BIN) $(BIN): $(OBJS) $(CC) $(CFLAGS) $(LFLAGS) $(OBJS) -o $@ $(LIBS) rm -rf *.o clean: rm -rf *.o rm -rf $(BIN) $(LIB) rm -rf *~ |
...
Copy the application and related libraries into C3V Linux and run:
Code Block |
---|
./yolov8suint8yolov8s_sample ./network_binary.nb ./input.jpg |
...