-
Notifications
You must be signed in to change notification settings - Fork 63
Kanvi/bazel build with clang libc++ #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
77a46a0
Initial changes
kanvi-nervana 31608cc
remove tbb related code from WORKSPACE, ngraph.build files
kanvi-nervana ddc0c91
Disable building TBB with cmake for the cpu backend
kanvi-nervana 28160ca
Update the urls for ngraph since the PR is merged
kanvi-nervana 74143ff
Fix formatting
kanvi-nervana 26bb100
update to ngraph-0.25.1-rc.5 for ci to pass and also update bazel wor…
kanvi-nervana 12996d3
minor clean up
kanvi-nervana 5b8a444
Address comments
kanvi-nervana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
|
|
||
| # ============================================================================== | ||
| # Copyright 2019 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. | ||
| # ============================================================================== | ||
| # Docker file to setup build envrionment for nGraph-TensorFlow | ||
|
|
||
| FROM ubuntu:18.04 | ||
| RUN apt-get update && apt-get install -y \ | ||
| vim \ | ||
| python \ | ||
| python-pip \ | ||
| python3-pip \ | ||
| git \ | ||
| unzip zip wget \ | ||
| sudo \ | ||
| zlib1g zlib1g-dev bash-completion \ | ||
| build-essential cmake \ | ||
| clang-format-3.9 | ||
|
|
||
| RUN pip install -U virtualenv==16.0.0 | ||
|
|
||
| #install latest cmake | ||
| ADD https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.sh /cmake-3.7.2-Linux-x86_64.sh | ||
| RUN mkdir /opt/cmake | ||
| RUN sh /cmake-3.7.2-Linux-x86_64.sh --prefix=/opt/cmake --skip-license | ||
| RUN ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake | ||
| RUN cmake --version | ||
|
|
||
| #Install Bazel | ||
| ADD https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-installer-linux-x86_64.sh ./bazel-0.24.1-installer-linux-x86_64.sh | ||
| RUN bash bazel-0.24.1-installer-linux-x86_64.sh | ||
| RUN bazel | ||
|
|
||
| #install gcc-4.8 and register both 7 and 4.8 with alternatives | ||
| #RUN apt-get update && apt-get install -y gcc-4.8 g++-4.8 | ||
| #RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8 && \ | ||
| #update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7 | ||
|
|
||
| # Install Clang | ||
| RUN apt-get install -y clang-8 libc++-dev libc++abi-dev | ||
|
|
||
| # Set the environment variables CC and CXX to point to clang-8 | ||
| ENV CC clang-8 | ||
| ENV CXX clang++-8 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # How to use this Dockerfile (Dockerfile.clang-8.ubuntu18.04) | ||
| 1. Create a dir where you want to build eg: docker_demo/build | ||
| 2. Download ngraph-bridge repo : git clone https://github.com/tensorflow/ngraph-bridge.git | ||
| 3. Build docker | ||
| docker build -t <ngtf_build> -f Dockerfile.clang-8.ubuntu18.04 . | ||
| or | ||
| If users want to build behind corporate proxy, they can always build it this way: | ||
| docker build \ | ||
| --build-arg HTTP_PROXY=${HTTP_PROXY} \ | ||
| --build-arg HTTPS_PROXY=${HTTPS_PROXY} \ | ||
| --build-arg NO_PROXY=${NO_PROXY} \ | ||
| --build-arg http_proxy=${http_proxy} \ | ||
| --build-arg https_proxy=${https_proxy} \ | ||
| --build-arg no_proxy=${no_proxy} \ | ||
| -f Dockerfile.clang-8.ubuntu18.04 . | ||
| 4. docker run -it -v ${PWD}:/<workspace> -w /<workspace> <ngtf_build> | ||
| 5. Create a virtual env : virtualenv -p python3 <venv3> | ||
| 6. Activate the virtual env : source venv3/bin/activate | ||
| 7. pip install future | ||
sayantan-nervana marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 8. cd ngraph-bridge | ||
| 9. ./configure_bazel.sh | ||
| 10. BAZEL_LINKOPTS=-lc++ BAZEL_CXXOPTS=-stdlib=libc++ bazel build :hello_tf | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this wiki: https://github.com/tensorflow/ngraph-bridge/wiki/Update-TF-version-in-ngraph-bridge
when TF version is upgraded, bazel version will upgrade, and we need to upgrade this (and maybe other) docker file from 0.24.1 to next bazel version