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 15:25:57 UTC

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

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



##########
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:
       It builds both. Actually I was only trying to glue the whole thing together and haven't thought much about boost compiling options. Let me fix this. I think we can just build a static/mt version/release build.

##########
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:
       This was unintentional, the build was building both shared and static libs and hence this worked. Let me move to static libs.

##########
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:
       Not really actually, a few more mins, I think.




----------------------------------------------------------------
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