Commit db788de8 authored by Sang Ik Lee's avatar Sang Ik Lee Committed by Scott Cyphers

Remove the no longer supported alternative installation method for (#831)

* Remove the no longer supported alternative installation method for
python binding.

* Put back CMakeLists.txt as it is used by travis ci dockerfile.

* Remove python/CMakeLists.txt and update Travis CI
parent b29f7220
......@@ -33,13 +33,11 @@ RUN make -j 8
RUN make install
# Prepare nGraph Python API
RUN mkdir /root/ngraph/python/build
WORKDIR /root/ngraph/python/build
RUN cmake -DNGRAPH_INSTALL_PREFIX=/root/ngraph_dist ..
RUN make -j 8
WORKDIR /root/ngraph/python
RUN git clone --recursive -b allow-nonconstructible-holders https://github.com/jagerman/pybind11.git
ENV NGRAPH_CPP_BUILD_PATH /root/ngraph_dist
ENV LD_LIBRARY_PATH /root/ngraph_dist/lib
ENV PYBIND_HEADERS_PATH /root/ngraph/python/build/pybind11
ENV PYBIND_HEADERS_PATH /root/ngraph/python/pybind11
# Test nGraph and nGraph Python API
CMD cd /root/ngraph/build && make check ; cd /root/ngraph/python && tox
# ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ******************************************************************************
cmake_minimum_required (VERSION 3.1)
# Suppress an OS X-specific warning.
if (POLICY CMP0042)
cmake_policy(SET CMP0042 OLD)
endif()
project (pyngraph)
include(ExternalProject)
ExternalProject_Add(
pybind11
GIT_REPOSITORY "https://github.com/jagerman/pybind11.git"
GIT_TAG "allow-nonconstructible-holders"
SOURCE_DIR "${CMAKE_BINARY_DIR}/pybind11"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
#
# The user can always override this by using the cmake command listed below.
if (DEFINED NGRAPH_INSTALL_PREFIX)
if(NOT EXISTS ${NGRAPH_INSTALL_PREFIX}/include/ngraph)
message(FATAL_ERROR "Cannot find ngraph library in ${NGRAPH_INSTALL_PREFIX} make sure that NGRAPH_INSTALL_PREFIX is set correctly")
endif()
set(USE_EMBEDDED_NGRAPH FALSE)
else()
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/../src/ngraph)
message(FATAL_ERROR "Cannot find ngraph source in ${CMAKE_SOURCE_DIR}/..")
endif()
set(USE_EMBEDDED_NGRAPH TRUE)
set(NGRAPH_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/ngraph_dist)
endif()
if(USE_EMBEDDED_NGRAPH)
set(NGRAPH_SOURCE_DIR ${CMAKE_SOURCE_DIR}/..)
set(NGRAPH_CMAKE_ARGS "-DNGRAPH_INSTALL_PREFIX=${NGRAPH_INSTALL_PREFIX}")
if(APPLE)
set(NGRAPH_CMAKE_ARGS "-DCMAKE_MACOSX_RPATH=ON" ${NGRAPH_CMAKE_ARGS})
endif()
ExternalProject_Add(
ngraph
DOWNLOAD_COMMAND ""
SOURCE_DIR ${NGRAPH_SOURCE_DIR}
CMAKE_ARGS ${NGRAPH_CMAKE_ARGS}
)
endif()
......@@ -73,38 +73,3 @@ rm -rf .tox
tox
```
## Alternate Installation Method (If you haven't build nGraph yet.)
Checkout nGraph and python wrapper code and build bdist wheel.
```
git clone https://github.com/NervanaSystems/ngraph.git
cd ngraph/python
```
```
pip install wheel
```
To build python2 bdist wheel type
```
./build_python2_wheel.sh
```
To build python3 bdist wheel type
```
./build_python3_wheel.sh
```
The bdist wheel will be placed in ngraph/python/build/dist
Activate your virtual environment and install the bdist wheel
```
pip install -U <full path to the bdist wheel>
```
For example, On MacOS you would run a command like,
```
pip install -U dist/ngraph-0.0.1-cp35-cp35m-linux_x86_64.whl
```
#!/bin/sh
# ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ******************************************************************************
set -e
if [ -d build ]; then
rm -rf build
fi
mkdir build
cd build
if [ -z "${NGRAPH_CPP_BUILD_PATH+x}" ]; then
echo "NGRAPH_CPP_BUILD_PATH is not set"
cmake ..
else
echo "NGRAPH_CPP_BUILD_PATH set to" $NGRAPH_CPP_BUILD_PATH
cmake -DNGRAPH_INSTALL_PREFIX=$NGRAPH_CPP_BUILD_PATH ..
fi
make -j8
cd ..
python2 setup.py bdist_wheel
#!/bin/sh
# ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ******************************************************************************
set -e
if [ -d build ]; then
rm -rf build
fi
mkdir build
cd build
if [ -z "${NGRAPH_CPP_BUILD_PATH+x}" ]; then
echo "NGRAPH_CPP_BUILD_PATH is not set"
cmake ..
else
echo "NGRAPH_CPP_BUILD_PATH set to" $NGRAPH_CPP_BUILD_PATH
cmake -DNGRAPH_INSTALL_PREFIX=$NGRAPH_CPP_BUILD_PATH ..
fi
make -j8
cd ..
python3 setup.py bdist_wheel
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment