You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2019/03/15 20:20:43 UTC

[arrow] branch master updated: ARROW-4873: [C++] Clarify documentation about how to use external ARROW_PACKAGE_PREFIX while also using CONDA dependency resolution

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 359ba42  ARROW-4873: [C++] Clarify documentation about how to use external ARROW_PACKAGE_PREFIX while also using CONDA dependency resolution
359ba42 is described below

commit 359ba42d83d3a89ff8fb891d74cdff3002339171
Author: Wes McKinney <we...@apache.org>
AuthorDate: Fri Mar 15 15:20:34 2019 -0500

    ARROW-4873: [C++] Clarify documentation about how to use external ARROW_PACKAGE_PREFIX while also using CONDA dependency resolution
    
    This clarifies the "hybrid" developer case where the library toolchain is maintained externally, but the Python bits are managed by an active conda environment.
    
    Author: Wes McKinney <we...@apache.org>
    
    Closes #3901 from wesm/toolchain-option and squashes the following commits:
    
    9cff629ed <Wes McKinney> Fix rebase artifact to restore \Library on MSVC
    889f8465a <Wes McKinney> Add additional clarification for dependency sources, note that environment variables can be used with CMake >= 3.11
    cf4c3f4c3 <Wes McKinney> Clarify how to use external package toolchain and conda together
---
 ci/cpp-msvc-build-main.bat                  |  2 +-
 ci/travis_before_script_cpp.sh              |  4 ++--
 cpp/CMakeLists.txt                          | 24 ++++++++++++++++--------
 cpp/cmake_modules/ThirdpartyToolchain.cmake |  9 +++++----
 4 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/ci/cpp-msvc-build-main.bat b/ci/cpp-msvc-build-main.bat
index 29782af..da28d88 100644
--- a/ci/cpp-msvc-build-main.bat
+++ b/ci/cpp-msvc-build-main.bat
@@ -30,7 +30,7 @@ if "%JOB%" == "Toolchain" (
       -DGTest_SOURCE=BUNDLED
 ) else (
   @rem We're in a conda enviroment but don't want to use it for the dependencies
-  set CMAKE_ARGS=%CMAKE_ARGE% -DARROW_DEPENDENCY_SOURCE=AUTO
+  set CMAKE_ARGS=%CMAKE_ARGS% -DARROW_DEPENDENCY_SOURCE=AUTO
 )
 
 @rem Retrieve git submodules, configure env var for Parquet unit tests
diff --git a/ci/travis_before_script_cpp.sh b/ci/travis_before_script_cpp.sh
index 26a45ec..21ed9dd 100755
--- a/ci/travis_before_script_cpp.sh
+++ b/ci/travis_before_script_cpp.sh
@@ -57,8 +57,8 @@ CMAKE_OSX_FLAGS="\
 -DARROW_GFLAGS_USE_SHARED=OFF"
 
 if [ "$ARROW_TRAVIS_USE_TOOLCHAIN" == "1" ]; then
-  CMAKE_COMMON_FLAGS="${CMAKE_COMMON_FLAGS} -DARROW_JEMALLOC=ON"
-  CMAKE_COMMON_FLAGS="${CMAKE_COMMON_FLAGS} -DARROW_WITH_BZ2=ON"
+  CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_JEMALLOC=ON"
+  CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_WITH_BZ2=ON"
 fi
 
 if [ $only_library_mode == "yes" ]; then
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 7a757d8..3886743 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -186,17 +186,25 @@ static|shared (default shared)")
   #----------------------------------------------------------------------
   # Thirdparty toolchain options
 
-  # Determine how we will look for dependencies:
+  # Determine how we will look for dependencies
   # * AUTO: Guess which packaging systems we're running in and pull the
   #   dependencies from there. Build any missing ones through the
-  #   ExternalProject setup.
-  # * BUNDLED: Build all dependencies through CMake's ExternalProject facility.
+  #   ExternalProject setup. This is the default unless the CONDA_PREFIX
+  #   environment variable is set, in which case the CONDA method is used
+  # * BUNDLED: Build dependencies through CMake's ExternalProject facility. If
+  #   you wish to build individual dependencies from source instead of using
+  #   one of the other methods, pass -D$NAME_SOURCE=BUNDLED
   # * SYSTEM: Use CMake's find_package and find_library without any custom
-  #   paths. If packages are on non-default locations, let the user indicate it
-  #   from the outside using the *_ROOT variables.
-  #   If your system packages are in general in a non-default location, you can
-  #   set a general default for the *_ROOT variables using ARROW_PACKAGE_PREFIX.
-  # * CONDA: Same as system but set all *_ROOT variables to ENV{CONDA_PREFIX}.
+  #   paths. If individual packages are on non-default locations, you can pass
+  #   $NAME_ROOT arguments to CMake, or set environment variables for the same
+  #   with CMake 3.11 and higher.  If your system packages are in a non-default
+  #   location, or if you are using a non-standard toolchain, you can also pass
+  #   ARROW_PACKAGE_PREFIX to set the *_ROOT variables to look in that
+  #   directory
+  # * CONDA: Same as system but set all *_ROOT variables to
+  #   ENV{CONDA_PREFIX}. If this is run within an active conda environment,
+  #   then ENV{CONDA_PREFIX} will be used for dependencies unless
+  #   ARROW_DEPENDENCY_SOURCE is set explicitly to one of the other options
   # * BREW: Use SYSTEM but search for select packages with brew.
   if(NOT "$ENV{CONDA_PREFIX}" STREQUAL "")
     set(ARROW_DEPENDENCY_SOURCE_DEFAULT "CONDA")
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 112c119..ddbb163 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -35,9 +35,6 @@ endif()
 # ----------------------------------------------------------------------
 # Resolve the dependencies
 
-message(STATUS "Using ${ARROW_DEPENDENCY_SOURCE} approach to find dependencies")
-
-set(ARROW_ACTUAL_DEPENDENCY_SOURCE "${ARROW_DEPENDENCY_SOURCE}")
 set(ARROW_THIRDPARTY_DEPENDENCIES
   double-conversion
   BROTLI
@@ -58,15 +55,19 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
   LLVM
   BOOST)
 
+message(STATUS "Using ${ARROW_DEPENDENCY_SOURCE} approach to find dependencies")
+
 # TODO: double-conversion check fails for conda, it should not
 if(ARROW_DEPENDENCY_SOURCE STREQUAL "CONDA")
-  message(STATUS "Using CONDA_PREFIX: $ENV{CONDA_PREFIX}")
   if (MSVC)
     set(ARROW_PACKAGE_PREFIX "$ENV{CONDA_PREFIX}/Library")
   else()
     set(ARROW_PACKAGE_PREFIX $ENV{CONDA_PREFIX})
   endif()
   set(ARROW_ACTUAL_DEPENDENCY_SOURCE "SYSTEM")
+  message(STATUS "Using CONDA_PREFIX for ARROW_PACKAGE_PREFIX: ${ARROW_PACKAGE_PREFIX}")
+else()
+  set(ARROW_ACTUAL_DEPENDENCY_SOURCE "${ARROW_DEPENDENCY_SOURCE}")
 endif()
 
 if (ARROW_PACKAGE_PREFIX)