• Adam Procter's avatar
    Compatibility fixes for gcc-4.8.5 and CentOS-7.4 (#444) · 8bccef1a
    Adam Procter authored
    (Squashing this commit but going to leave the full log here, unlike the way I usually do things)
    
    * Incremental work on compatibility with system requirements
    
    * Lower cmake version requirement so we can work with CentOS 7.4
    
    * Disambiguate isnan call (CentOS's compiler doesn't like it)
    
    * Make external_tbb conditional on NGRAPH_CPU_ENABLE
    
    * Make MKLDNN inclusion conditional on NGRAPH_CPU_ENABLE
    
    * Roll back desperation change to Ubuntu 14.04 binaries
    
    * De-revert copyright date change (arrgh)
    
    * Revert change of TBB's hard-coded compiler choice to gcc
    
    * Cleanup of modified CMake stuff
    
    * Add broken support for building LLVM from source
    
    * Explain modification to json.hpp required compiler version
    
    * Make TBB optional, and on by default. To disable, cmake -DNGRAPH_TBB_ENABLE=FALSE
    
    * Add reasonable default for LLVM's CMAKE_ASM_COMPILER so users don't have to specify it
    
    * Force TBB disabled if CMake is too old to build it (for CentOS)
    
    * Build LLVM OpenMP as external project
    
    * Tweak LLVM build options
    
    * Minor comment edit in cmake scripts
    
    * Workaround (fix?) for codegen crashes on CentOS
    
    * Add some header paths for CentOS to resource_generator; temporary(?) tweak to ignore nonexistent paths
    
    * Remove CMake compatibility figleaf since LLVM will require 3.1+ anyway
    
    * Fix the TBB-enable flag to default to on
    
    * Remove hard-coded choice of clang as tbb compiler
    
    * ln -s -> ln -sf in command to create link for OpenMP source dir
    
    * Make OpenMP build so it doesn't require symlink
    
    * Allow use of prebuilt LLVM if requested at cmake time
    
    * Some INSTALL instructions
    
    * Allow NGRAPH_USE_PREBUILT_LLVM to be set in environment variable
    
    * Tweak CI cmake options to use prebuilt LLVM
    
    * Remove debug messages
    
    * Rework defaulting behavior for LLVM_TARBALL_URL and LLVM_SHA1_HASH
    
    * Remove warning message for unavailable header file directories
    Unverified
    8bccef1a
INSTALL 1.54 KB
Currently two platforms are known to work:

- Ubuntu 16.04
- CentOS 7.4

Ubuntu 16.04 Prerequisites
==========================

Compilers currently known to work are gcc-5.4.0, clang-3.9, and gcc-4.8.5.

If you are using gcc-5.4.0 or clang-3.9, it is recommended to add the
option `-DNGRAPH_USE_PREBUILT_LLVM=TRUE` to the `cmake` command. This causes
the build system to fetch a pre-built tarball of LLVM+Clang from `llvm.org`,
which substantially cuts down on build times.

If you are using gcc-4.8, it may be necessary to add symlinksfrom `gcc` to
`gcc-4.8`, and from `g++` to `g++-4.8`, in your PATH, even if you have
specify CMAKE_C_COMPILER and CMAKE_CXX_COMPILER when building. (You should
NOT supply the `-DNGRAPH_USE_PREBUILT_LLVM` flag in this case, because the
prebuilt tarball supplied on llvm.org is not compatible with a gcc-4.8
based build.)

CentOS 7.4 Prerequisites
========================

CentOS supplies an older version of CMake that is not compatible with
LLVM-5.0.1, which we build as an external dependency. There are two options:

1. (requires root privileges) install the the `cmake3` package from EPEL, or
2. (does not require root privileges) build CMake (3.1 or newer) from source,
   and run it from its build directory.

General Instructions
====================

These instructions assume that your system has been prepared in accordance
with the above prerequisites.

$ cd private-ngraph-cpp
$ mkdir build
$ cd build
$ cmake .. \
    -DCMAKE_C_COMPILER=<path to C compiler> \
    -DCMAKE_CXX_COMPILER=<path to C++ compiler>
$ make -j install