# onnc-umbrella **Repository Path**: yds90/onnc-umbrella ## Basic Information - **Project Name**: onnc-umbrella - **Description**: umbrella project helps you to build up onnc from scratch - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-01-09 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ONNC Umbrella ## Introduction ONNC Umbrella is the umbrella for all ONNC projects. ## Prerequisites 1. git 2. Autotools 3. GNU Libtool 4. pkg-config 5. Protocol Buffer 6. glog 7. flex 8. bison 9. curl ### Ubuntu - with Apt ### ``` apt install git automake libtool protobuf-compiler libprotoc-dev pkg-config python2.7 python2.7-dev python-pip libgoogle-glog-dev flex bison curl pip install lit ``` ### macOS - with Homebrew ### ``` xcode-select --install brew install git autoconf automake libtool pkg-config protobuf coreutils ``` ## Compilation Instructions The simplest way to compile this package is: Dance with `build.sh` script. 1. Check out ONNC from the repository. ``` git clone --recursive https://github.com/ONNC/onnc-umbrella.git ${ONNC} ``` 2. Type `cd ${ONNC}` to the directory containing the source code. 3. Use `build.sh` to compile the package. ``` ./build.sh [mode] [target folder] ``` The package is built at `./build-/`, and installed to `./install-/`. It is a staged installation if the third argument (target folder) is given. Check GNU automake's DESTDIR for more information about a staged installation at the below [link](https://www.gnu.org/software/automake/manual/html_node/DESTDIR.html). For example, use `./build.sh dbg /opt/onnc` to build the latest revision in debug mode for installation at `/opt/onnc`. It will build in `build-dbg`, install to `install-dbg`, and generate a binary package named `onnc-.tar.gz`. ## Deployment Instructions You can use the following instruction to install the binary package. ``` tar zxf onnc-master.tar.gz -C /opt ``` or ``` mkdir /opt/onnc tar zxf onnc-master.tar.gz --strip-components 1 -C /opt/onnc ``` Recompile with the same arguments `./build.sh dbg /opt/onnc`, or make with `DESTDIR=./install-dbg` to ensure the binaries are installed to the staged installation path instead of being installed directly to the target folder `/opt/onnc`. ``` cd ./build-dbg make DESTDIR=$(pwd)/../install-dbg install ``` ### Building Mode There are four building modes, regression mode, debugging mode, optimizing mode and normal mode. Select mode by changing the second argument. | mode | description | |---------|--------------------------------------------------------------| | normal | (default) build with normal compilation flags | | dbg | build in debug mode (unittest enabled) | | rgn | build in debug mode (unittest enabled) with regression test | | opt | build in optimized mode | ### Target Folder The package is configured to be installed at the target folder (PREFIX). ## Directory Structure * README - This document * README.md - Same document in Markdown format * build.sh - The building script * src - The source directory of onnc project * external - The external librarys ## Compilation Instructions (CMake) We also provide `build.cmake.sh` for people love cmake. Currently, this script is experimental. It only pass deployment test on ubuntu Linux environment. 1. Check out ONNC from the repository with `--recursive` flag ``` git clone --recursive https://github.com/ONNC/onnc-umbrella.git ${ONNC} ``` 2. Type `cd ${ONNC}` to the directory containing the source code. 3. Use `build.cmake.sh` to compile the package. ``` ./build.cmake.sh [mode] [target folder] ``` The behavior of this script is as same as `./build.sh`, but driven with CMake instead of automake.