You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/08/03 00:19:36 UTC

[GitHub] [hbase-native-client] phrocker commented on a change in pull request #12: HBASE-24810: Download Boost with other dependencies

phrocker commented on a change in pull request #12:
URL: https://github.com/apache/hbase-native-client/pull/12#discussion_r464141390



##########
File path: cmake/DownloadBoost.cmake
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+## Download Boost. 
+## SOURCE_DIR is typically the cmake source directory
+## BINARY_DIR is the build directory, typically 'build'
+## Sets BOOST_ROOT, search prefix for FindBoost.
+
+function(download_boost SOURCE_DIR BUILD_DIR BOOST_LIBS)
+  set(BOOST_DOWNLOAD_DIR "${BUILD_DIR}/dependencies/boost-download")
+  set(BOOST_SOURCE_DIR "${BUILD_DIR}/dependencies/boost-src")
+  set(BOOST_INSTALL_DIR "${BUILD_DIR}/dependencies/boost-install")
+
+  # Only compile and install the needed libs.
+  set(LIBS_TO_COMPILE "")
+  foreach(lib ${BOOST_LIBS})
+    string(APPEND LIBS_TO_COMPILE --with-${lib} " ")
+  endforeach()
+
+  separate_arguments(BUILD_CMD UNIX_COMMAND "./b2 ${LIBS_TO_COMPILE} install")
+
+  ExternalProject_Add(boost
+     URL "https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz"

Review comment:
       Does this build a static lib? 

##########
File path: cmake/boost/local/FindBoost.cmake
##########
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+# Stubs to allow us to find Boost libs
+
+set(Boost_INCLUDE_DIRS "${BOOST_ROOT}/include" CACHE STRING "" FORCE)
+set(Boost_INCLUDE_DIR "${BOOST_ROOT}/include" CACHE STRING "" FORCE)
+
+set(Boost_LIBRARIES "" CACHE STRING "" FORCE)
+foreach(COMPONENT ${Boost_FIND_COMPONENTS})
+  list(APPEND Boost_LIBRARIES "${BOOST_ROOT}/lib/${BYPRODUCT_PREFIX}boost_${COMPONENT}${BYPRODUCT_SHARED_SUFFIX}")

Review comment:
       Given BYPRODUCT_SHARED_SUFFIX, will the install ensure these shared objects are available for the distributed binary?

##########
File path: cmake/DownloadBoost.cmake
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+## Download Boost. 
+## SOURCE_DIR is typically the cmake source directory
+## BINARY_DIR is the build directory, typically 'build'
+## Sets BOOST_ROOT, search prefix for FindBoost.
+
+function(download_boost SOURCE_DIR BUILD_DIR BOOST_LIBS)
+  set(BOOST_DOWNLOAD_DIR "${BUILD_DIR}/dependencies/boost-download")
+  set(BOOST_SOURCE_DIR "${BUILD_DIR}/dependencies/boost-src")
+  set(BOOST_INSTALL_DIR "${BUILD_DIR}/dependencies/boost-install")
+
+  # Only compile and install the needed libs.
+  set(LIBS_TO_COMPILE "")
+  foreach(lib ${BOOST_LIBS})
+    string(APPEND LIBS_TO_COMPILE --with-${lib} " ")
+  endforeach()
+
+  separate_arguments(BUILD_CMD UNIX_COMMAND "./b2 ${LIBS_TO_COMPILE} install")
+
+  ExternalProject_Add(boost

Review comment:
       Does this significantly add to the build time? I haven't pulled it down to try but will. 

##########
File path: cmake/DownloadBoost.cmake
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+## Download Boost. 
+## SOURCE_DIR is typically the cmake source directory
+## BINARY_DIR is the build directory, typically 'build'
+## Sets BOOST_ROOT, search prefix for FindBoost.
+
+function(download_boost SOURCE_DIR BUILD_DIR BOOST_LIBS)
+  set(BOOST_DOWNLOAD_DIR "${BUILD_DIR}/dependencies/boost-download")
+  set(BOOST_SOURCE_DIR "${BUILD_DIR}/dependencies/boost-src")
+  set(BOOST_INSTALL_DIR "${BUILD_DIR}/dependencies/boost-install")
+
+  # Only compile and install the needed libs.
+  set(LIBS_TO_COMPILE "")
+  foreach(lib ${BOOST_LIBS})
+    string(APPEND LIBS_TO_COMPILE --with-${lib} " ")
+  endforeach()
+
+  separate_arguments(BUILD_CMD UNIX_COMMAND "./b2 ${LIBS_TO_COMPILE} install")
+
+  ExternalProject_Add(boost
+     URL "https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz"
+     PREFIX "${BUILD_DIR}/dependencies"
+     DOWNLOAD_DIR ${BOOST_DOWNLOAD_DIR}
+     BUILD_IN_SOURCE true
+     SOURCE_DIR ${BOOST_SOURCE_DIR}
+     INSTALL_DIR ${BOOST_INSTALL_DIR}
+     CONFIGURE_COMMAND ./bootstrap.sh --prefix=${BOOST_INSTALL_DIR}

Review comment:
       You could probably statically link against boost. Not sure that is of interest I guess it's a balance of size




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org