From 84c7862d4bde4fa65a1318a15d2e6791826d0bd3 Mon Sep 17 00:00:00 2001 From: liaogang Date: Thu, 22 Dec 2016 16:51:35 +0800 Subject: [PATCH] Remove bazel from dockerfile and docs --- WORKSPACE | 31 ----- .../build_and_install/docker_install_en.rst | 12 +- paddle/scripts/docker/Dockerfile | 12 -- paddle/scripts/docker/Dockerfile.gpu | 12 -- third_party/gflags.BUILD | 12 -- third_party/gflags_test/BUILD | 10 -- third_party/glog.BUILD | 128 ------------------ third_party/glog_test/BUILD | 10 -- third_party/gtest.BUILD | 8 -- third_party/protobuf_test/BUILD | 24 ---- third_party/protobuf_test/README.md | 1 - 11 files changed, 1 insertion(+), 259 deletions(-) delete mode 100644 WORKSPACE delete mode 100644 third_party/gflags.BUILD delete mode 100644 third_party/gflags_test/BUILD delete mode 100644 third_party/glog.BUILD delete mode 100644 third_party/glog_test/BUILD delete mode 100644 third_party/gtest.BUILD delete mode 100644 third_party/protobuf_test/BUILD delete mode 100644 third_party/protobuf_test/README.md diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index f097c41da8..0000000000 --- a/WORKSPACE +++ /dev/null @@ -1,31 +0,0 @@ -# External dependency to Google protobuf. -http_archive( - name="protobuf", - url="http://github.com/google/protobuf/archive/v3.1.0.tar.gz", - sha256="0a0ae63cbffc274efb573bdde9a253e3f32e458c41261df51c5dbc5ad541e8f7", - strip_prefix="protobuf-3.1.0") - -# External dependency to gtest 1.7.0. This method comes from -# https://www.bazel.io/versions/master/docs/tutorial/cpp.html. -new_http_archive( - name="gtest", - url="https://github.com/google/googletest/archive/release-1.7.0.zip", - sha256="b58cb7547a28b2c718d1e38aee18a3659c9e3ff52440297e965f5edffe34b6d0", - build_file="third_party/gtest.BUILD", - strip_prefix="googletest-release-1.7.0") - -# External dependency to gflags. This method comes from -# https://github.com/gflags/example/blob/master/WORKSPACE. -new_git_repository( - name="gflags", - tag="v2.2.0", - remote="https://github.com/gflags/gflags.git", - build_file="third_party/gflags.BUILD") - -# External dependency to glog. This method comes from -# https://github.com/reyoung/bazel_playground/blob/master/WORKSPACE -new_git_repository( - name="glog", - remote="https://github.com/google/glog.git", - commit="b6a5e0524c28178985f0d228e9eaa43808dbec3c", - build_file="third_party/glog.BUILD") diff --git a/doc/getstarted/build_and_install/docker_install_en.rst b/doc/getstarted/build_and_install/docker_install_en.rst index 7633bf4d57..88eb0473f7 100644 --- a/doc/getstarted/build_and_install/docker_install_en.rst +++ b/doc/getstarted/build_and_install/docker_install_en.rst @@ -57,16 +57,13 @@ The general development workflow with Docker and Bazel is as follows: --name paddle \ -p 2022:22 \ -v $PWD:/paddle \ - -v $HOME/.cache/bazel:/root/.cache/bazel \ paddle:dev where :code:`-d` makes the container running in background, :code:`--name paddle` allows us to run a nginx container to serve documents in this container, :code:`-p 2022:22` allows us to SSH into this container, :code:`-v $PWD:/paddle` shares the source code - on the host with the container, :code:`-v - $HOME/.cache/bazel:/root/.cache/bazel` shares Bazel cache on the - host with the container. + on the host with the container. 4. SSH into the container: @@ -86,13 +83,6 @@ The general development workflow with Docker and Bazel is as follows: make -j `nproc` CTEST_OUTPUT_ON_FAILURE=1 ctest - or Bazel in the container: - - .. code-block:: bash - - cd /paddle - bazel test ... - CPU-only and GPU Images ----------------------- diff --git a/paddle/scripts/docker/Dockerfile b/paddle/scripts/docker/Dockerfile index 207f97c4a6..575be6c098 100644 --- a/paddle/scripts/docker/Dockerfile +++ b/paddle/scripts/docker/Dockerfile @@ -15,18 +15,6 @@ RUN cd /usr/src/gtest && cmake . && make && cp *.a /usr/lib RUN pip install -U BeautifulSoup docopt PyYAML pillow \ sphinx sphinx_rtd_theme recommonmark -# cmake tends to hide and blur the dependencies between code modules, as -# noted here https://github.com/PaddlePaddle/Paddle/issues/763. We are -# thinking about using Bazel to fix this problem, e.g., -# https://github.com/PaddlePaddle/Paddle/issues/681#issuecomment-263996102. To -# start the trail of fixing, we add Bazel to our Dockerfiles. -RUN apt-get update && apt-get install -y curl software-properties-common \ - && add-apt-repository ppa:webupd8team/java \ - && echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections \ - && echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \ - && curl https://bazel.build/bazel-release.pub.gpg | apt-key add - \ - && apt-get update && apt-get install -y oracle-java8-installer bazel - ARG WITH_AVX ARG WITH_DOC ARG WITH_SWIG_PY diff --git a/paddle/scripts/docker/Dockerfile.gpu b/paddle/scripts/docker/Dockerfile.gpu index 33f6adfea2..ed067112eb 100644 --- a/paddle/scripts/docker/Dockerfile.gpu +++ b/paddle/scripts/docker/Dockerfile.gpu @@ -15,18 +15,6 @@ RUN cd /usr/src/gtest && cmake . && make && cp *.a /usr/lib RUN pip install -U BeautifulSoup docopt PyYAML pillow \ sphinx sphinx_rtd_theme recommonmark -# cmake tends to hide and blur the dependencies between code modules, as -# noted here https://github.com/PaddlePaddle/Paddle/issues/763. We are -# thinking about using Bazel to fix this problem, e.g., -# https://github.com/PaddlePaddle/Paddle/issues/681#issuecomment-263996102. To -# start the trail of fixing, we add Bazel to our Dockerfiles. -RUN apt-get update && apt-get install -y curl software-properties-common \ - && add-apt-repository ppa:webupd8team/java \ - && echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections \ - && echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \ - && curl https://bazel.build/bazel-release.pub.gpg | apt-key add - \ - && apt-get update && apt-get install -y oracle-java8-installer bazel - ARG WITH_AVX ARG WITH_DOC ARG WITH_SWIG_PY diff --git a/third_party/gflags.BUILD b/third_party/gflags.BUILD deleted file mode 100644 index 85e8bd0bd7..0000000000 --- a/third_party/gflags.BUILD +++ /dev/null @@ -1,12 +0,0 @@ -# Bazel (http://bazel.io/) BUILD file for gflags. -# -# See INSTALL.md for instructions for adding gflags to a Bazel workspace. - -licenses(["notice"]) - -exports_files(["src/gflags_complections.sh", "COPYING.txt"]) - -load(":bazel/gflags.bzl", "gflags_sources", "gflags_library") -(hdrs, srcs) = gflags_sources(namespace=["google", "gflags"]) -gflags_library(hdrs=hdrs, srcs=srcs, threads=0) -gflags_library(hdrs=hdrs, srcs=srcs, threads=1) diff --git a/third_party/gflags_test/BUILD b/third_party/gflags_test/BUILD deleted file mode 100644 index b50615203b..0000000000 --- a/third_party/gflags_test/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -licenses(["notice"]) # Apache 2.0 - -cc_test( - name="gflags_test", - srcs=["gflags_test.cc"], - copts=["-Iexternal/gtest/include"], - deps=[ - "@gtest//:gtest", - "@gflags//:gflags", - ], ) diff --git a/third_party/glog.BUILD b/third_party/glog.BUILD deleted file mode 100644 index a0ff1d6b41..0000000000 --- a/third_party/glog.BUILD +++ /dev/null @@ -1,128 +0,0 @@ -licenses(["notice"]) - -cc_library( - visibility=["//visibility:public"], - name="glog", - includes=[ - ".", - "src", - ], - copts=[ - "-D_START_GOOGLE_NAMESPACE_='namespace google {'", - "-D_END_GOOGLE_NAMESPACE_='}'", - "-DGOOGLE_NAMESPACE='google'", - "-DGOOGLE_GLOG_DLL_DECL=''", - "-DHAVE_DLADDR", - "-DHAVE_SNPRINTF", - "-DHAVE_DLFCN_H", - "-DHAVE_FCNTL", - "-DHAVE_GLOB_H", - "-DHAVE_INTTYPES_H", - "-DHAVE_LIBPTHREAD", - "-DHAVE_SYS_SYSCALL_H", - "-DHAVE_MEMORY_H", - "-DHAVE_NAMESPACES", - "-DHAVE_PREAD", - "-DHAVE_PTHREAD", - "-DHAVE_PWD_H", - "-DHAVE_PWRITE", - "-DHAVE_RWLOCK", - "-DHAVE_SIGACTION", - "-DHAVE_SIGALTSTACK", - "-DHAVE_STDINT_H", - "-DHAVE_STRING_H", - "-DHAVE_SYS_TIME_H", - "-DHAVE_SYS_TYPES_H", - "-DHAVE_SYS_UCONTEXT_H", - "-DHAVE_SYS_UTSNAME_H", - "-DHAVE_UNISTD_H", - "-DHAVE_USING_OPERATOR", - "-DHAVE_HAVE___ATTRIBUTE___", - "-DHAVE_HAVE___BUILTIN_EXPECT", - #"-DNO_FRAME_POINTER", - "-D_GNU_SOURCE", - #"-fno-sanitize=thread", - #"-fno-sanitize=address", - "-Iexternal/glog/src", - ], - srcs=[ - "src/demangle.cc", - "src/logging.cc", - "src/raw_logging.cc", - "src/signalhandler.cc", - "src/symbolize.cc", - "src/utilities.cc", - "src/vlog_is_on.cc", - ":config_h", - ":logging_h", - ":raw_logging_h", - ":stl_logging_h", - ":vlog_is_on_h", - ], - hdrs=[ - "src/demangle.h", - "src/mock-log.h", - "src/stacktrace.h", - "src/symbolize.h", - "src/utilities.h", - "src/base/commandlineflags.h", - "src/base/googleinit.h", - "src/base/mutex.h", - "src/glog/log_severity.h", - ]) - -genrule( - name="config_h", - srcs=["src/config.h.cmake.in"], - outs=["config.h"], - cmd="awk '{ gsub(/^#cmakedefine/, \"//cmakedefine\"); print; }' $(<) > $(@)", -) - -genrule( - name="logging_h", - srcs=["src/glog/logging.h.in"], - outs=["glog/logging.h"], - cmd="$(location :gen_sh) < $(<) > $(@)", - tools=[":gen_sh"]) - -genrule( - name="raw_logging_h", - srcs=["src/glog/raw_logging.h.in"], - outs=["glog/raw_logging.h"], - cmd="$(location :gen_sh) < $(<) > $(@)", - tools=[":gen_sh"]) - -genrule( - name="stl_logging_h", - srcs=["src/glog/stl_logging.h.in"], - outs=["glog/stl_logging.h"], - cmd="$(location :gen_sh) < $(<) > $(@)", - tools=[":gen_sh"]) - -genrule( - name="vlog_is_on_h", - srcs=["src/glog/vlog_is_on.h.in"], - outs=["glog/vlog_is_on.h"], - cmd="$(location :gen_sh) < $(<) > $(@)", - tools=[":gen_sh"]) - -genrule( - name="gen_sh", - outs=["gen.sh"], - cmd=""" -cat > $@ <<"EOF" -#! /bin/sh -sed -e 's/@ac_cv_have_unistd_h@/1/g' \ - -e 's/@ac_cv_have_stdint_h@/1/g' \ - -e 's/@ac_cv_have_systypes_h@/1/g' \ - -e 's/@ac_cv_have_libgflags_h@/1/g' \ - -e 's/@ac_cv_have_uint16_t@/1/g' \ - -e 's/@ac_cv_have___builtin_expect@/1/g' \ - -e 's/@ac_cv_have_.*@/0/g' \ - -e 's/@ac_google_start_namespace@/namespace google {/g' \ - -e 's/@ac_google_end_namespace@/}/g' \ - -e 's/@ac_google_namespace@/google/g' \ - -e 's/@ac_cv___attribute___noinline@/__attribute__((noinline))/g' \ - -e 's/@ac_cv___attribute___noreturn@/__attribute__((noreturn))/g' \ - -e 's/@ac_cv___attribute___printf_4_5@/__attribute__((__format__ (__printf__, 4, 5)))/g' -EOF""") diff --git a/third_party/glog_test/BUILD b/third_party/glog_test/BUILD deleted file mode 100644 index 56d08e95f8..0000000000 --- a/third_party/glog_test/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -licenses(["notice"]) # Apache 2.0 - -cc_test( - name="glog_test", - srcs=["glog_test.cc"], - copts=["-Iexternal/gtest/include"], - deps=[ - "@gtest//:gtest", - "@glog//:glog", - ], ) diff --git a/third_party/gtest.BUILD b/third_party/gtest.BUILD deleted file mode 100644 index 9255b51d9a..0000000000 --- a/third_party/gtest.BUILD +++ /dev/null @@ -1,8 +0,0 @@ -cc_library( - name="gtest", - srcs=glob( - ["src/*.cc"], exclude=["src/gtest-all.cc"]), - hdrs=glob(["include/**/*.h", "src/*.h"]), - copts=["-Iexternal/gtest/include"], - linkopts=["-pthread"], - visibility=["//visibility:public"], ) diff --git a/third_party/protobuf_test/BUILD b/third_party/protobuf_test/BUILD deleted file mode 100644 index 67d4293c70..0000000000 --- a/third_party/protobuf_test/BUILD +++ /dev/null @@ -1,24 +0,0 @@ -licenses(["notice"]) # Apache 2.0 - -load("@protobuf//:protobuf.bzl", "cc_proto_library") - -cc_proto_library( - name="example_proto", - srcs=["example.proto"], - protoc="@protobuf//:protoc", - default_runtime="@protobuf//:protobuf", ) - -cc_library( - name="example_lib", - srcs=["example_lib.cc"], - hdrs=["example_lib.h"], - deps=[":example_proto"], ) - -cc_test( - name="example_lib_test", - srcs=["example_lib_test.cc"], - copts=["-Iexternal/gtest/include"], - deps=[ - "@gtest//:gtest", - ":example_lib", - ], ) diff --git a/third_party/protobuf_test/README.md b/third_party/protobuf_test/README.md deleted file mode 100644 index e8bdeee6fe..0000000000 --- a/third_party/protobuf_test/README.md +++ /dev/null @@ -1 +0,0 @@ -This package tests that Bazel can build protobuf related rules. -- GitLab