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 2017/04/19 15:22:59 UTC

arrow git commit: ARROW-841: [Python] Add pyarrow build to Appveyor

Repository: arrow
Updated Branches:
  refs/heads/master 59cd801a7 -> 4555ab92b


ARROW-841: [Python] Add pyarrow build to Appveyor

Author: Wes McKinney <we...@twosigma.com>

Closes #566 from wesm/ARROW-841 and squashes the following commits:

4a04d57 [Wes McKinney] Set CMP0054 policy also in python/CMakeLists.txt
d2b4ffb [Wes McKinney] install cython
695e9b3 [Wes McKinney] Fix directory
36ad9e2 [Wes McKinney] Another fix for compiler id check
ba31cf5 [Wes McKinney] typo
7c32abb [Wes McKinney] Set CMP0054 policy
d27563f [Wes McKinney] Fix for CMP0054
ee883d8 [Wes McKinney] Exit early on failure of things
ac903db [Wes McKinney] Fix cmake warning
949558a [Wes McKinney] Remove conda list
54fbd48 [Wes McKinney] Add directory
86f91d2 [Wes McKinney] Write msvc build script that builds pyarrow


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/4555ab92
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/4555ab92
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/4555ab92

Branch: refs/heads/master
Commit: 4555ab92b174ce645ed20c7c6e15ee236a0e2f7a
Parents: 59cd801
Author: Wes McKinney <we...@twosigma.com>
Authored: Wed Apr 19 11:22:54 2017 -0400
Committer: Wes McKinney <we...@twosigma.com>
Committed: Wed Apr 19 11:22:54 2017 -0400

----------------------------------------------------------------------
 appveyor.yml                              | 16 ++++----
 ci/msvc-build.bat                         | 52 ++++++++++++++++++++++++++
 cpp/CMakeLists.txt                        |  6 +++
 cpp/cmake_modules/FindPythonLibsNew.cmake | 13 ++++---
 cpp/cmake_modules/SetupCxxFlags.cmake     |  2 +-
 cpp/src/arrow/python/CMakeLists.txt       | 12 +++---
 python/CMakeLists.txt                     |  6 +++
 7 files changed, 86 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/4555ab92/appveyor.yml
----------------------------------------------------------------------
diff --git a/appveyor.yml b/appveyor.yml
index b8c26e6..f2954a9 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -21,17 +21,15 @@ os: Visual Studio 2015
 environment:
   matrix:
     - GENERATOR: Visual Studio 14 2015 Win64
-    # - GENERATOR: Visual Studio 14 2015
+      PYTHON: "3.5"
+      ARCH: "64"
   MSVC_DEFAULT_OPTIONS: ON
   BOOST_ROOT: C:\Libraries\boost_1_63_0
   BOOST_LIBRARYDIR: C:\Libraries\boost_1_63_0\lib64-msvc-14.0
 
-build_script:
- - cd cpp
- - mkdir build
- - cd build
- - cmake -G "%GENERATOR%" -DARROW_CXXFLAGS="/WX" -DARROW_BOOST_USE_SHARED=OFF -DCMAKE_BUILD_TYPE=Release ..
- - cmake --build . --config Release
+init:
+  - set MINICONDA=C:\Miniconda35-x64
+  - set PATH=%MINICONDA%;%MINICONDA%/Scripts;%MINICONDA%/Library/bin;%PATH%
 
-# test_script:
- - ctest -VV
+build_script:
+ - call ci\msvc-build.bat

http://git-wip-us.apache.org/repos/asf/arrow/blob/4555ab92/ci/msvc-build.bat
----------------------------------------------------------------------
diff --git a/ci/msvc-build.bat b/ci/msvc-build.bat
new file mode 100644
index 0000000..de428b6
--- /dev/null
+++ b/ci/msvc-build.bat
@@ -0,0 +1,52 @@
+@rem Licensed to the Apache Software Foundation (ASF) under one
+@rem or more contributor license agreements.  See the NOTICE file
+@rem distributed with this work for additional information
+@rem regarding copyright ownership.  The ASF licenses this file
+@rem to you under the Apache License, Version 2.0 (the
+@rem "License"); you may not use this file except in compliance
+@rem with the License.  You may obtain a copy of the License at
+@rem
+@rem   http://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing,
+@rem software distributed under the License is distributed on an
+@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@rem KIND, either express or implied.  See the License for the
+@rem specific language governing permissions and limitations
+@rem under the License.
+
+@echo on
+
+set CONDA_ENV=C:\arrow-conda-env
+set ARROW_HOME=C:\arrow-install
+
+conda create -p %CONDA_ENV% -q -y python=%PYTHON% ^
+      six pytest setuptools numpy pandas cython
+call activate %CONDA_ENV%
+
+@rem Build and test Arrow C++ libraries
+
+cd cpp
+mkdir build
+cd build
+cmake -G "%GENERATOR%" ^
+      -DCMAKE_INSTALL_PREFIX=%ARROW_HOME% ^
+      -DARROW_BOOST_USE_SHARED=OFF ^
+      -DCMAKE_BUILD_TYPE=Release ^
+      -DARROW_CXXFLAGS="/WX" ^
+      -DARROW_PYTHON=on ^
+      ..  || exit /B
+cmake --build . --target INSTALL --config Release  || exit /B
+
+@rem Needed so python-test.exe works
+set PYTHONPATH=%CONDA_ENV%\Lib;%CONDA_ENV%\Lib\site-packages;%CONDA_ENV%\python35.zip;%CONDA_ENV%\DLLs;%CONDA_ENV%
+
+ctest -VV  || exit /B
+
+@rem Build and import pyarrow
+
+set PATH=%ARROW_HOME%\bin;%PATH%
+
+cd ..\..\python
+python setup.py build_ext --inplace  || exit /B
+python -c "import pyarrow"  || exit /B

http://git-wip-us.apache.org/repos/asf/arrow/blob/4555ab92/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index f702da1..c1cf785 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -36,6 +36,12 @@ else()
   include(GNUInstallDirs)
 endif()
 
+# Compatibility with CMake 3.1
+if(POLICY CMP0054)
+  # http://www.cmake.org/cmake/help/v3.1/policy/CMP0054.html
+  cmake_policy(SET CMP0054 NEW)
+endif()
+
 set(ARROW_SO_VERSION "0")
 set(ARROW_ABI_VERSION "${ARROW_SO_VERSION}.0.0")
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/4555ab92/cpp/cmake_modules/FindPythonLibsNew.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/FindPythonLibsNew.cmake b/cpp/cmake_modules/FindPythonLibsNew.cmake
index 9610816..09124aa 100644
--- a/cpp/cmake_modules/FindPythonLibsNew.cmake
+++ b/cpp/cmake_modules/FindPythonLibsNew.cmake
@@ -141,12 +141,13 @@ string(REGEX REPLACE "\\\\" "/" PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR})
 string(REGEX REPLACE "\\\\" "/" PYTHON_SITE_PACKAGES ${PYTHON_SITE_PACKAGES})
 
 if(CMAKE_HOST_WIN32)
-    if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
-        set(PYTHON_LIBRARY
-            "${PYTHON_PREFIX}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib")
-    else()
-        set(PYTHON_LIBRARY "${PYTHON_PREFIX}/libs/libpython${PYTHON_LIBRARY_SUFFIX}.a")
-    endif()
+  # Appease CMP0054
+  if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+    set(PYTHON_LIBRARY
+      "${PYTHON_PREFIX}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib")
+  else()
+    set(PYTHON_LIBRARY "${PYTHON_PREFIX}/libs/libpython${PYTHON_LIBRARY_SUFFIX}.a")
+  endif()
 elseif(APPLE)
   # In some cases libpythonX.X.dylib is not part of the PYTHON_PREFIX and we
   # need to call `python-config --prefix` to determine the correct location.

http://git-wip-us.apache.org/repos/asf/arrow/blob/4555ab92/cpp/cmake_modules/SetupCxxFlags.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake
index 694e5a3..7e229ff 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake
+++ b/cpp/cmake_modules/SetupCxxFlags.cmake
@@ -30,7 +30,7 @@ if (MSVC)
   # insecure, like std::getenv
   add_definitions(-D_CRT_SECURE_NO_WARNINGS)
 
-  if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+  if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
     # clang-cl
     set(CXX_COMMON_FLAGS "-EHsc")
   elseif(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 19)

http://git-wip-us.apache.org/repos/asf/arrow/blob/4555ab92/cpp/src/arrow/python/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/python/CMakeLists.txt b/cpp/src/arrow/python/CMakeLists.txt
index 607a1c4..5c2b588 100644
--- a/cpp/src/arrow/python/CMakeLists.txt
+++ b/cpp/src/arrow/python/CMakeLists.txt
@@ -57,6 +57,13 @@ set(ARROW_PYTHON_SHARED_LINK_LIBS
   arrow_shared
 )
 
+if (MSVC)
+  set(ARROW_PYTHON_SHARED_LINK_LIBS
+    ${ARROW_PYTHON_SHARED_LINK_LIBS}
+    ${PYTHON_LIBRARIES}
+    )
+endif()
+
 ADD_ARROW_LIB(arrow_python
   SOURCES ${ARROW_PYTHON_SRCS}
   SHARED_LINK_FLAGS ""
@@ -64,11 +71,6 @@ ADD_ARROW_LIB(arrow_python
   STATIC_LINK_LIBS ""
 )
 
-if (MSVC)
-  target_link_libraries(arrow_python_shared
-    ${PYTHON_LIBRARIES})
-endif()
-
 if ("${COMPILER_FAMILY}" STREQUAL "clang")
   # Clang, be quiet. Python C API has lots of macros
   set_property(SOURCE ${ARROW_PYTHON_SRCS}

http://git-wip-us.apache.org/repos/asf/arrow/blob/4555ab92/python/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index c1431af..3db7b7b 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -28,6 +28,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../cpp/cmake_mod
 
 include(CMakeParseArguments)
 
+# Compatibility with CMake 3.1
+if(POLICY CMP0054)
+  # http://www.cmake.org/cmake/help/v3.1/policy/CMP0054.html
+  cmake_policy(SET CMP0054 NEW)
+endif()
+
 set(BUILD_SUPPORT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../cpp/build-support")
 
 # Allow "make install" to not depend on all targets.