Part Number: PROCESSOR-SDK-AM57X
Tool/software: TI C/C++ Compiler
Hi,
OS: Ubuntu 18.04
TIDL ver.: REL.TIDL.01.01.03.00
Protobuf ver.: 3.2.0rc2
I am trying to build the TIDL import tool on Ubuntu so that it can be used to convert parameter and model files on Linux, since the provided pre-built import tool can only be used on Windows.
I am referring to the TIDL_UserGuide.pdf provided in REL.TIDL.01.01.03.00. However, there is not any information regarding the steps to build the import tool on Linux.
When I was trying to build it on my own on Ubuntu, many errors occurred.
I modified the makefile to support my environment, as shown below:
COMMON_DIR= ../../../../../common
SUBDIRS= ../tfImport/proto_cc/tensorflow/core/framework
CFILES := $(foreach dir,$(SUBDIRS),$(wildcard $(dir)/*.cc))
CFILES += ../caffeImport/caffe.pb.cc
CFILES += $(COMMON_DIR)/configparser.c
CFILES += tidl_import_config.c
CFILES += tidl_import_common.cpp
#CFILES += ../caffeImport/tidl_caffeImport.cpp
CFILES += tidl_tfImport.cpp
CFILES += tidl_caffeImport.cpp
HFILES += $(foreach dir,$(SUBDIRS),$(wildcard $(dir)/*.h))
HFILES += ti_dl.h
# updation of paths in import config files
OUTFILE=./out/tidl_model_import.out
PROTOBUF_INC_DIR ?= /usr/local/include
ifeq ($(PROTOBUF_LIB_DIR),)
$(call error,ERROR - PROTOBUF_LIB_DIR IS NOT DEFINED)
endif
ifeq ($(PROTOBUF_INC_DIR),)
$(call error,ERROR - PROTOBUF_INC_DIR IS NOT DEFINED)
endif
CFLAGS+= -I $(PROTOBUF_INC_DIR)
CFLAGS+= -I ../caffeImport
CFLAGS+= -I ../tfImport
CFLAGS+= -I ../tfImport/proto_cc
CFLAGS+= -I /usr/include/sys
ifeq ($(TARGET_BUILD), release)
LDFLAGS+=-l $(PROTOBUF_LIB_DIR)/libprotoc.so
LDFLAGS+=-l $(PROTOBUF_LIB_DIR)/libprotobuf.so
else
LDFLAGS+=-l $(PROTOBUF_LIB_DIR)/libprotocd.so
LDFLAGS+=-l $(PROTOBUF_LIB_DIR)/libprotobufd.so
endif
LDFLAGS= -L $(PROTOBUF_LIB_DIR)
LDFLAGS+= -lprotoc -lprotobuf
LDFLAGS+= -lpthread
# ifeq ($(LINUX_IMPORT_TOOL), 64BIT)
CFLAGS+= -DPLATFORM_64BIT
# endif
LDFLAGS+= -lstdc++ -static
# else
# LDFLAGS+= -lstdc++ -lz -static
# endif
##############################################################
OUTDIR = "out"
##############################################################
When I compiled using the makefile above, errors were found as below, with most of the them were protobuf related errors:
"/usr/include/features.h", line 184: warning: unrecognized preprocessing directive
"/usr/include/stdc-predef.h", line 58: warning: incompatible redefinition of macro "__STDC_ISO_10646__" (declared at line 106 of "../../../../../../../../ti_components/cg_tools/linux/C6000_7.4.2/include/yvals.h")
"/usr/include/sys/sysmacros.h", line 62: error: expected an identifier
"/usr/include/sys/sysmacros.h", line 62: error: expected a macro parameter name
"/usr/include/bits/thread-shared-types.h", line 140: warning: types cannot be declared in anonymous unions
"/usr/include/bits/thread-shared-types.h", line 157: warning: types cannot be declared in anonymous unions
"/usr/include/bits/thread-shared-types.h", line 166: warning: types cannot be declared in anonymous unions
"/usr/local/include/google/protobuf/stubs/platform_macros.h", line 94: error: "#" not expected here
"/usr/local/include/google/protobuf/stubs/platform_macros.h", line 94: error: expected a declaration
"/usr/local/include/google/protobuf/stubs/logging.h", line 62: warning: parsing restarts here after previous syntax error
"/usr/local/include/google/protobuf/stubs/logging.h", line 75: error: identifier "LogLevel" is undefined
"/usr/local/include/google/protobuf/stubs/logging.h", line 90: error: name followed by "::" must be a class or namespace name
"/usr/local/include/google/protobuf/stubs/logging.h", line 97: error: identifier "LogLevel" is undefined
"/usr/local/include/google/protobuf/stubs/logging.h", line 166: error: namespace "google::protobuf::internal" has no member "LogFinisher"
"/usr/local/include/google/protobuf/stubs/logging.h", line 166: error: namespace "google::protobuf::internal" has no member "LogMessage"
"/usr/local/include/google/protobuf/stubs/logging.h", line 166: error: namespace "google::protobuf" has no member "LOGLEVEL_FATAL"
"/usr/local/include/google/protobuf/stubs/logging.h", line 203: error: identifier "LogLevel" is undefined
"/usr/local/include/google/protobuf/stubs/logging.h", line 234: error: expected a declaration
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 125: warning: parsing restarts here after previous syntax error
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 130: error: scoped_ptr is not a template
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 130: error: type qualifier is not allowed on this function
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 130: error: too few parameters for this operator function
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 130: error: nonmember operator requires a parameter with class or enum type
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 131: error: scoped_ptr is not a template
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 131: error: type qualifier is not allowed on this function
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 131: error: too few parameters for this operator function
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 131: error: nonmember operator requires a parameter with class or enum type
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 134: error: identifier "scoped_ptr" is undefined
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 134: warning: omission of explicit type is nonstandard ("int" assumed)
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 135: error: "operator=" must be a member function
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 135: error: function "scoped_ptr" is not a type name
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 136: error: expected a declaration
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 225: error: expected a declaration
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 229: warning: parsing restarts here after previous syntax error
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 230: error: namespace "internal" has no member "scoped_array"
"/usr/local/include/google/protobuf/stubs/scoped_ptr.h", line 233: error: expected a declaration
"/usr/local/include/google/protobuf/stubs/mutex.h", line 64: warning: parsing restarts here after previous syntax error
"/usr/local/include/google/protobuf/stubs/mutex.h", line 66: error: expected a declaration
"/usr/local/include/google/protobuf/stubs/mutex.h", line 68: error: identifier "Internal" is undefined
"/usr/local/include/google/protobuf/stubs/mutex.h", line 70: error: identifier "Mutex" is undefined
"/usr/local/include/google/protobuf/stubs/mutex.h", line 70: warning: omission of explicit type is nonstandard ("int" assumed)
"/usr/local/include/google/protobuf/stubs/mutex.h", line 70: error: "operator=" must be a member function
"/usr/local/include/google/protobuf/stubs/mutex.h", line 70: error: function "Mutex" is not a type name
"/usr/local/include/google/protobuf/stubs/mutex.h", line 71: error: expected a declaration
"/usr/local/include/google/protobuf/stubs/mutex.h", line 84: error: "explicit" is not allowed
"/usr/local/include/google/protobuf/stubs/mutex.h", line 84: error: expected a ")"
"/usr/local/include/google/protobuf/stubs/mutex.h", line 84: error: incomplete type is not allowed
"/usr/local/include/google/protobuf/stubs/mutex.h", line 84: error: identifier "mu_" is undefined
"/usr/local/include/google/protobuf/stubs/mutex.h", line 84: error: function call is not allowed in a constant expression
"/usr/local/include/google/protobuf/stubs/mutex.h", line 84: error: identifier "mu" is undefined
"/usr/local/include/google/protobuf/stubs/mutex.h", line 84: error: expected a ";"
"/usr/local/include/google/protobuf/stubs/mutex.h", line 87: warning: parsing restarts here after previous syntax error
"/usr/local/include/google/protobuf/stubs/mutex.h", line 98: error: "explicit" is not allowed
"/usr/local/include/google/protobuf/stubs/mutex.h", line 98: error: expected a ")"
"/usr/local/include/google/protobuf/stubs/mutex.h", line 98: error: incomplete type is not allowed
"/usr/local/include/google/protobuf/stubs/mutex.h", line 99: error: identifier "mu_" is undefined
"/usr/local/include/google/protobuf/stubs/mutex.h", line 99: error: function call is not allowed in a constant expression
"/usr/local/include/google/protobuf/stubs/mutex.h", line 99: error: identifier "mu" is undefined
"/usr/local/include/google/protobuf/stubs/mutex.h", line 99: error: expected a ";"
"/usr/local/include/google/protobuf/stubs/mutex.h", line 102: warning: parsing restarts here after previous syntax error
"/usr/local/include/google/protobuf/stubs/mutex.h", line 134: error: expected a declaration
"/usr/local/include/google/protobuf/stubs/mutex.h", line 138: warning: parsing restarts here after previous syntax error
"/usr/local/include/google/protobuf/stubs/mutex.h", line 139: error: namespace "internal" has no member "MutexLock"
"/usr/local/include/google/protobuf/stubs/mutex.h", line 140: error: namespace "internal" has no member "ReaderMutexLock"
"/usr/local/include/google/protobuf/stubs/mutex.h", line 141: error: namespace "internal" has no member "WriterMutexLock"
"/usr/local/include/google/protobuf/stubs/mutex.h", line 142: error: namespace "internal" has no member "MutexLockMaybe"
"/usr/local/include/google/protobuf/stubs/mutex.h", line 145: error: expected a declaration
"/usr/local/include/google/protobuf/stubs/template_util.h", line 81: warning: parsing restarts here after previous syntax error
"/usr/local/include/google/protobuf/stubs/template_util.h", line 83: error: integral_constant is not a template
"/usr/local/include/google/protobuf/stubs/template_util.h", line 89: error: integral_constant is not a template
"/usr/local/include/google/protobuf/stubs/template_util.h", line 90: error: integral_constant is not a template
"/usr/local/include/google/protobuf/stubs/template_util.h", line 114: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/template_util.h", line 118: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/template_util.h", line 124: error: integral_constant is not a template
"/usr/local/include/google/protobuf/stubs/template_util.h", line 124: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/template_util.h", line 130: error: integral_constant is not a template
"/usr/local/include/google/protobuf/stubs/template_util.h", line 130: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/template_util.h", line 134: error: expected a declaration
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 88: warning: parsing restarts here after previous syntax error
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 123: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 124: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 125: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 126: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 127: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 134: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 136: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 137: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 138: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 139: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 140: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 141: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 152: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 153: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 154: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 155: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 166: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 167: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 177: error: identifier "small_" is undefined
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 178: error: identifier "big_" is undefined
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 179: error: identifier "small_" is undefined
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 187: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 222: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 223: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 231: error: integral_constant is not a template
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 231: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 250: error: integral_constant is not a template
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 250: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 265: error: integral_constant is not a template
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 265: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 278: error: integral_constant is not a template
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 278: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 291: error: integral_constant is not a template
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 291: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 325: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 326: error: not a class or struct name
"/usr/local/include/google/protobuf/stubs/type_traits.h", line 343: error: identifier "small_" is undefined
Error limit reached.
100 errors detected in the compilation of "tidl_import_common.cpp".
Compilation terminated.