You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zg...@apache.org on 2019/03/12 12:44:52 UTC
[hbase] 04/133: HBASE-15401 Add Zookeeper to third party
This is an automated email from the ASF dual-hosted git repository.
zghao pushed a commit to branch HBASE-14850
in repository https://gitbox.apache.org/repos/asf/hbase.git
commit 32ff80cd9f591910ce736e02b6691638dc951e72
Author: Elliott Clark <ec...@apache.org>
AuthorDate: Mon Mar 7 14:58:21 2016 -0800
HBASE-15401 Add Zookeeper to third party
---
hbase-native-client/Dockerfile | 26 +++++++++-
hbase-native-client/third-party/BUCK | 96 +++++++++++++++++-------------------
2 files changed, 68 insertions(+), 54 deletions(-)
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
index 5f17f04..1364d22 100644
--- a/hbase-native-client/Dockerfile
+++ b/hbase-native-client/Dockerfile
@@ -15,8 +15,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM pjameson/buck-folly-watchman
+FROM cpp_update
-RUN apt-get install -y libprotobuf-dev protobuf-compiler clang-format-3.7 vim maven inetutils-ping
+ARG CC=/usr/bin/gcc-5
+ARG CXX=/usr/bin/g++-5
+ARG CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 -pthread"
+ARG CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 -pthread"
+
+RUN apt-get install -y clang-format-3.7 vim maven inetutils-ping
+RUN git clone --depth 1 --branch v2.6.1 https://github.com/google/protobuf.git /usr/src/protobuf && \
+ cd /usr/src/protobuf/ && \
+ ./autogen.sh && \
+ ./configure --disable-shared && \
+ make && \
+ make check && \
+ make install
+RUN cd /usr/src && \
+ wget http://www-us.apache.org/dist/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz && \
+ tar zxf zookeeper-3.4.8.tar.gz && \
+ rm -rf zookeeper-3.4.8.tar.gz && \
+ cd zookeeper-3.4.8 && \
+ cd src/c && \
+ ./configure --disable-shared && \
+ make && \
+ make install && \
+ make clean
WORKDIR /usr/local/src/hbase/hbase-native-client
diff --git a/hbase-native-client/third-party/BUCK b/hbase-native-client/third-party/BUCK
index b7baa86..e577a5f 100644
--- a/hbase-native-client/third-party/BUCK
+++ b/hbase-native-client/third-party/BUCK
@@ -15,68 +15,60 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-def add_system_libs(names = []):
+def add_system_libs(names = [], lib_dir = "/usr/lib/x86_64-linux-gnu", deps = [], exported_linker_flags = []):
rules = []
for name in names:
- prebuilt_cxx_library(
- name = name,
- lib_name = name,
- lib_dir = "/usr/lib/x86_64-linux-gnu",
- visibility = [ 'PUBLIC', ],
- )
- rules.append(":" + name)
-
+ gen_rule_name = "gen_lib{}".format(name)
+ genrule(
+ name = gen_rule_name,
+ out = gen_rule_name,
+ bash = "mkdir -p $OUT && cp {}/lib{}.* $OUT".format(lib_dir,name),
+ )
+ prebuilt_cxx_library(
+ name = name,
+ lib_name = name,
+ lib_dir = '$(location :{})'.format(gen_rule_name),
+ force_static = True,
+ deps = deps,
+ visibility = [ 'PUBLIC' ],
+ exported_linker_flags = exported_linker_flags,
+ )
+ rules.append(":" + name)
return rules
system_libs = [
+ "unwind",
+ "lzma",
+]
+local_libs = [
"double-conversion",
"glog",
- "protobuf",
"gflags",
- "unwind",
- "lzma",
+ "protobuf",
+ "zookeeper_mt",
"boost_regex",
]
-tp_dep_rules = add_system_libs(system_libs)
-prebuilt_cxx_library(
- name = "folly",
- lib_name = "folly",
- lib_dir = "/usr/local/lib",
- deps = tp_dep_rules,
- exported_linker_flags = [
- "-pthread",
- "-lstdc++",
- ],
- visibility = [
- 'PUBLIC',
- ]
-)
-prebuilt_cxx_library(
- name = "follybenchmark",
- lib_name = "follybenchmark",
- lib_dir = "/usr/local/lib",
- deps = tp_dep_rules + [":folly"],
- exported_linker_flags = [
- "-pthread",
- "-lstdc++",
- ],
- visibility = [
- 'PUBLIC',
- ]
-)
-prebuilt_cxx_library(
- name = "wangle",
- lib_name = "wangle",
- lib_dir = "/usr/local/lib",
- deps = tp_dep_rules + [":folly"],
- exported_linker_flags = [
- "-pthread",
- "-lstdc++",
- ],
- visibility = [
- 'PUBLIC',
- ]
-)
+
+tp_dep_rules = add_system_libs(system_libs) \
+ + add_system_libs(local_libs, lib_dir = "/usr/local/lib")
+folly = add_system_libs(
+ ['folly'],
+ lib_dir = '/usr/local/lib',
+ deps = tp_dep_rules,
+ exported_linker_flags = [ "-pthread", "-lstdc++",]
+ )
+folly_bench = add_system_libs(
+ ['follybenchmark'],
+ lib_dir = '/usr/local/lib',
+ deps = tp_dep_rules + folly,
+ exported_linker_flags = [ "-pthread", "-lstdc++",]
+ )
+wangle = add_system_libs(
+ ['wangle'],
+ lib_dir = '/usr/local/lib',
+ deps = tp_dep_rules + folly,
+ exported_linker_flags = [ "-pthread", "-lstdc++",]
+ )
cxx_library(
name = 'google-test',
srcs = [