[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/LIBONNX PATCH 2/3] Add Makefile



Add onnx port Makefile.uk

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxx>
---
 Makefile.uk | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 143 insertions(+)
 create mode 100644 Makefile.uk

diff --git a/Makefile.uk b/Makefile.uk
new file mode 100644
index 0000000..fb04573
--- /dev/null
+++ b/Makefile.uk
@@ -0,0 +1,143 @@
+#  libonnx config file
+#
+#  Authors: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxx>
+#
+#  Copyright (c) 2020, University Politehnica of Bucharest. All rights 
reserved.
+#
+#  Redistribution and use in source and binary forms, with or without
+#  modification, are permitted provided that the following conditions
+#  are met:
+#
+#  1. Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#  2. Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#  3. Neither the name of the copyright holder nor the names of its
+#     contributors may be used to endorse or promote products derived from
+#     this software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+#  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+#  POSSIBILITY OF SUCH DAMAGE.
+#
+#  THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY
+
+################################################################################
+# Library registration
+################################################################################
+$(eval $(call addlib_s,libonnx,$(CONFIG_LIBONNX)))
+
+################################################################################
+# Sources
+################################################################################
+LIBONNX_VERSION=1.6.0
+LIBONNX_URL=https://github.com/onnx/onnx/archive/v1.6.0.tar.gz
+LIBONNX_PATCHDIR=$(LIBONNX_BASE)/patches
+
+$(eval $(call fetch,libonnx,$(LIBONNX_URL),$(LIBONNX_VERSION).tar.gz))
+$(eval $(call patch,libonnx,$(LIBONNX_PATCHDIR),onnx-$(LIBONNX_VERSION)))
+
+###############################################################################
+# Helpers
+################################################################################
+LIBONNX_SUBDIR=onnx-$(LIBONNX_VERSION)
+LIBONNX_SRC=$(LIBONNX_ORIGIN)/$(LIBONNX_SUBDIR)
+
+################################################################################
+# Library includes
+################################################################################
+CINCLUDES-$(CONFIG_LIBONNX) += -I$(LIBONNX_SRC)/
+CXXINCLUDES-$(CONFIG_LIBONNX) += -I$(LIBONNX_SRC)/
+
+CINCLUDES-$(CONFIG_LIBONNX) += -I$(LIBONNX_SRC)/onnx
+CXXINCLUDES-$(CONFIG_LIBONNX) += -I$(LIBONNX_SRC)/onnx
+
+################################################################################
+# Global flags
+################################################################################
+# Suppress some warnings to make the build process look neater
+LIBONNX_SUPPRESS_FLAGS += -Wno-unused-parameter -Wno-unused-variable 
-Wno-nonnull      \
+-Wno-unused-but-set-variable -Wno-unused-label -Wno-char-subscripts            
\
+-Wno-unused-function -Wno-missing-field-initializers -Wno-uninitialized        
        \
+-Wno-array-bounds -Wno-maybe-uninitialized -Wno-unused-value                   
\
+-Wno-unused-macros -Wno-parentheses -Wno-type-limits -Wno-sign-compare         
\
+-Wno-missing-braces -Wno-endif-labels -Wno-unused-but-set-variable
+
+LIBONNX_LIBRARY_FLAGS += 
-DONNX_API="__attribute__((__visibility__(\"default\")))"     \
+                       -DONNX_ML=1 -DONNX_NAMESPACE=onnx -DONNX_BUILD_MAIN_LIB 
-DNDEBUG
+
+LIBONNX_CFLAGS-y    +=  $(LIBONNX_SUPPRESS_FLAGS) $(LIBONNX_LIBRARY_FLAGS)
+LIBONNX_CXXFLAGS-y    +=  $(LIBONNX_SUPPRESS_FLAGS) $(LIBONNX_LIBRARY_FLAGS)
+
+################################################################################
+# Library sources
+################################################################################
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/onnxifi_loader.c
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/onnxifi_wrapper.c
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/onnx/onnx-ml.pb.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/onnx/onnx-operators-ml.pb.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/cpp2py_export.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/onnxifi_utils.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/schema.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/controlflow/defs.cc|controlflow
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/controlflow/old.cc|controlflow
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/tensor_proto_util.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/tensor_util.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/tensor/defs.cc|tensor
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/tensor/old.cc|tensor
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/attr_proto_util.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/function.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/traditionalml/defs.cc|traditionalml
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/traditionalml/old.cc|traditionalml
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/quantization/defs.cc|quantization
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/reduction/defs.cc|reduction
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/reduction/old.cc|reduction
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/logical/defs.cc|logical
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/logical/old.cc|logical
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/data_type_utils.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/nn/defs.cc|nn
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/nn/old.cc|nn
+LIBONNX_SRCS-y += 
$(LIBONNX_SRC)/onnx/defs/object_detection/defs.cc|onject_detection
+LIBONNX_SRCS-y += 
$(LIBONNX_SRC)/onnx/defs/object_detection/old.cc|onject_detection
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/math/defs.cc|math
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/math/old.cc|math
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/generator/defs.cc|generator
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/generator/old.cc|generator
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/rnn/defs.cc|rnn
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/rnn/old.cc|rnn
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/sequence/defs.cc|sequence
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/defs/tensor/utils.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/shape_inference/implementation.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/common/assertions.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/common/interned_strings.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/common/model_helpers.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/common/ir_pb_converter.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/common/status.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/optimizer/optimize.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/optimizer/pass_registry.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/optimizer/pass.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/optimizer/pass_manager.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/checker.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/version_converter/convert.cc
+LIBONNX_SRCS-y += $(LIBONNX_SRC)/onnx/version_converter/helper.cc
+
+################################################################################
+# Lib-specific Targets
+################################################################################
+
+$(LIBONNX_BUILD)/.prepared: $(LIBONNX_BUILD)/.origin
+       cd $(LIBONNX_SRC) && python onnx/gen_proto.py -p onnx -o onnx/ onnx -m 
&&               \
+               protoc onnx/onnx-ml.proto -I. --cpp_out 
dllexport_decl=ONNX_API:onnx/ &&        \
+               python onnx/gen_proto.py -p onnx -o onnx/ onnx-operators -m &&  
                \
+               protoc onnx/onnx-operators-ml.proto -I. --cpp_out 
dllexport_decl=ONNX_API:onnx/
+
+UK_PREPARE += $(LIBONNX_BUILD)/.prepared
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.