Overview
TODO
libngraph
Building Build Environments
Operating System | Compiler | Build system | Status | Additional packages required |
---|---|---|---|---|
Ubuntu 16.04 (LTS) 64-bit | CLang 3.9 | CMake 3.5.1 + GNU Make | supported | build-essential cmake clang-3.9 |
Ubuntu 16.04 (LTS) 64-bit | CLang 4.0 | CMake 3.5.1 + GNU Make | unsupported, but works | build-essential cmake clang-4.0 |
Steps
libngraph
is build in the customary manner for a CMake-based project:
- Create a build directory outside of source directory tree.
-
cd
to the build directory. - Run
cmake
. For example,cmake ../
- Run
make -j8
. - Run
make install
.- This will install
libngraph.so
and the header files to$HOME/ngraph_dist
.
- This will install
-
(Optional, requires
doxygen
) Runmake doc
.- This will build API documentation in the directory
doc
inside the build directory.
- This will build API documentation in the directory
libngraph
Testing libngraph
uses the GTest framework for unit tests. CMake automatically downloads a
copy of the required GTest files when configuring the build directory.
To perform the unit tests
- Configure the build directory as described above.
- Change directory to the build directory.
- Run
make check
libngraph
Using From Tensorflow as XLA plugin
- Get the Nervana's fork of the TF from this repo:
git@github.com:NervanaSystems/ngraph-tensorflow.git
- Go to the end near the following snippet:
native.new_local_repository(
name = "ngraph_external",
path = "/your/home/directory/where/ngraph_is_installed",
build_file = str(Label("//tensorflow/compiler/plugin/ngraph:ngraph.BUILD")),
)
Then modify the following line in tensorflow/workspace.bzl
file and provide absolute path to ~/ngraph_dist
:
path = "/your/home/directory/where/ngraph_is_installed",
- Now run
configure
and rest of the TF build.
System Requirements
TBD
External library requirements
TBD
libngraph
Maintaining Code formatting
All C/C++ source code in the libngraph
repository, including the test code when practical,
should adhere to the project's source-code formatting guidelines.
The script maint/apply-code-format.sh
enforces that formatting at the C/C++ syntactic level.
The script maint/check-code-format.sh
verifies that the formatting rules are met by all C/C++
code (again, at the syntax level.) The script has an exit code of 0 when this all code meets
the standard, and non-zero otherwise. This script does not modify the source code.