diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..2a1130f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,19 @@ +# TODO: remove for release. +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Debug CACHE STRING "build type") +endif() + +# Require 3.3 and set policy CMP0057 for IN_LIST operator support +cmake_minimum_required(VERSION 3.3) +cmake_policy(SET CMP0057 NEW) +project(onnf) + +set(CMAKE_CXX_FLAGS_DEBUG "-g") +set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") +set(ONNF_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") + +# Set cxx standard only for onnf project files. +set(CMAKE_CXX_STANDARD 14) + +add_subdirectory(src/builder) + diff --git a/src/builder/CMakeLists.txt b/src/builder/CMakeLists.txt index eb4a7b4..4e3ec6c 100644 --- a/src/builder/CMakeLists.txt +++ b/src/builder/CMakeLists.txt @@ -1,5 +1,3 @@ -add_definitions(-DBOOST_LOG_DYN_LINK) - add_library(builder sgir.cpp ) diff --git a/src/builder/onnx_importer.cpp b/src/builder/onnx_importer.cpp index 3d2205d..4235856 100644 --- a/src/builder/onnx_importer.cpp +++ b/src/builder/onnx_importer.cpp @@ -1,3 +1,11 @@ +//===----------------------------------------------------------------------===// +// +// Copyright 2019 The IBM Research Authors. +// +// ============================================================================= +// +//===----------------------------------------------------------------------===// + #include "sgir.hpp" //empty module for MLIR is generated to test the compile/link of MLIR code diff --git a/src/builder/sgir.cpp b/src/builder/sgir.cpp index 50b31a0..2fce457 100644 --- a/src/builder/sgir.cpp +++ b/src/builder/sgir.cpp @@ -57,7 +57,7 @@ namespace onnf { int SGIRTest() { mlir::MLIRContext context; - + mlir::OwningModuleRef module = SGIRGenImpl(context).mlirGen(); if (!module) return 1;