From 0189b09581a8b7c5e0aef3352bc109d73c4b2266 Mon Sep 17 00:00:00 2001 From: Guru Medasani Date: Sun, 16 Apr 2017 17:02:15 -0500 Subject: [PATCH] Fixes Mac OSX installation error (#464) * changes to address ARROW-826 and ARROW-444 * changes to address ARROW-826 and ARROW-444 * ignoring cmake-build-debug * additional IDEA ignore files * additional IDEA ignore files * remove arrow ipc and arrow io libraries * add boost dependencies * fix arrow origin and remove submodule --- .gitignore | 21 +++++++++++++++++++ src/numbuf/CMakeLists.txt | 12 ++++------- .../python/src/pynumbuf/adapters/python.cc | 8 +++---- src/numbuf/thirdparty/download_thirdparty.sh | 2 +- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index f51683b36..bfc38ada3 100644 --- a/.gitignore +++ b/.gitignore @@ -80,6 +80,9 @@ scripts/nodes.txt *.dSYM/ *.su +# CMake +cmake-build-debug/ + # Python setup files *.egg-info @@ -92,3 +95,21 @@ scripts/nodes.txt # Generated documentation files /doc/_build + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries diff --git a/src/numbuf/CMakeLists.txt b/src/numbuf/CMakeLists.txt index e7980e5ac..830b6fa71 100644 --- a/src/numbuf/CMakeLists.txt +++ b/src/numbuf/CMakeLists.txt @@ -34,10 +34,6 @@ set(ARROW_DIR "${CMAKE_CURRENT_LIST_DIR}/thirdparty/arrow/" set(ARROW_LIB "${CMAKE_CURRENT_LIST_DIR}/thirdparty/arrow/cpp/build/release/libarrow.a" CACHE STRING "Path to libarrow.a (needs to be changed if arrow is build in debug mode)") -set(ARROW_IO_LIB "${CMAKE_CURRENT_LIST_DIR}/thirdparty/arrow/cpp/build/release/libarrow_io.a" - CACHE STRING "Path to libarrow_io.a (needs to be changed if arrow is build in debug mode)") -set(ARROW_IPC_LIB "${CMAKE_CURRENT_LIST_DIR}/thirdparty/arrow/cpp/build/release/libarrow_ipc.a" - CACHE STRING "Path to libarrow_ipc.a (needs to be changed if arrow is build in debug mode)") set(ARROW_PYTHON_LIB "${CMAKE_CURRENT_LIST_DIR}/thirdparty/arrow/cpp/build/release/libarrow_python.a" CACHE STRING "Path to libarrow_python.a (needs to be changed if arrow is build in debug mode)") @@ -69,15 +65,15 @@ if(APPLE) endif(APPLE) if(APPLE) - target_link_libraries(numbuf ${ARROW_LIB} ${ARROW_IO_LIB} ${ARROW_IPC_LIB} ${ARROW_PYTHON_LIB} ${PYTHON_LIBRARIES} -lpthread) + target_link_libraries(numbuf ${ARROW_LIB} ${ARROW_PYTHON_LIB} ${PYTHON_LIBRARIES} -lpthread -lboost_regex -lboost_system -lboost_filesystem) else() - target_link_libraries(numbuf -Wl,--whole-archive ${ARROW_LIB} -Wl,--no-whole-archive ${ARROW_IO_LIB} ${ARROW_IPC_LIB} ${ARROW_PYTHON_LIB} ${PYTHON_LIBRARIES} -lpthread) + target_link_libraries(numbuf -Wl,--whole-archive ${ARROW_LIB} -Wl,--no-whole-archive ${ARROW_PYTHON_LIB} ${PYTHON_LIBRARIES} -lpthread -lboost_regex -lboost_system -lboost_filesystem) endif() if(HAS_PLASMA) - target_link_libraries(numbuf ${ARROW_LIB} ${ARROW_IO_LIB} ${ARROW_IPC_LIB} ${ARROW_PYTHON_LIB} ${PYTHON_LIBRARIES} plasma_lib common ${FLATBUFFERS_STATIC_LIB} -lpthread) + target_link_libraries(numbuf ${ARROW_LIB} ${ARROW_PYTHON_LIB} ${PYTHON_LIBRARIES} plasma_lib common ${FLATBUFFERS_STATIC_LIB} -lpthread -lboost_regex -lboost_system -lboost_filesystem) else() - target_link_libraries(numbuf ${ARROW_LIB} ${ARROW_IO_LIB} ${ARROW_IPC_LIB} ${ARROW_PYTHON_LIB} ${PYTHON_LIBRARIES} -lpthread) + target_link_libraries(numbuf ${ARROW_LIB} ${ARROW_PYTHON_LIB} ${PYTHON_LIBRARIES} -lpthread -lboost_regex -lboost_system -lboost_filesystem) endif() install(TARGETS numbuf DESTINATION ${CMAKE_SOURCE_DIR}/numbuf/) diff --git a/src/numbuf/python/src/pynumbuf/adapters/python.cc b/src/numbuf/python/src/pynumbuf/adapters/python.cc index afd1b6405..79289c284 100644 --- a/src/numbuf/python/src/pynumbuf/adapters/python.cc +++ b/src/numbuf/python/src/pynumbuf/adapters/python.cc @@ -22,7 +22,7 @@ namespace numbuf { Status get_value(std::shared_ptr arr, int32_t index, int32_t type, PyObject* base, const std::vector>& tensors, PyObject** result) { - switch (arr->type()->type) { + switch (arr->type()->id()) { case Type::BOOL: *result = PyBool_FromLong(std::static_pointer_cast(arr)->Value(index)); @@ -55,13 +55,13 @@ Status get_value(std::shared_ptr arr, int32_t index, int32_t type, PyObje case Type::STRUCT: { auto s = std::static_pointer_cast(arr); auto l = std::static_pointer_cast(s->field(0)); - if (s->type()->child(0)->name == "list") { + if (s->type()->child(0)->name() == "list") { return DeserializeList(l->values(), l->value_offset(index), l->value_offset(index + 1), base, tensors, result); - } else if (s->type()->child(0)->name == "tuple") { + } else if (s->type()->child(0)->name() == "tuple") { return DeserializeTuple(l->values(), l->value_offset(index), l->value_offset(index + 1), base, tensors, result); - } else if (s->type()->child(0)->name == "dict") { + } else if (s->type()->child(0)->name() == "dict") { return DeserializeDict(l->values(), l->value_offset(index), l->value_offset(index + 1), base, tensors, result); } else { diff --git a/src/numbuf/thirdparty/download_thirdparty.sh b/src/numbuf/thirdparty/download_thirdparty.sh index a05f98cf1..ab23b57db 100755 --- a/src/numbuf/thirdparty/download_thirdparty.sh +++ b/src/numbuf/thirdparty/download_thirdparty.sh @@ -11,4 +11,4 @@ if [ ! -d $TP_DIR/arrow ]; then git clone https://github.com/apache/arrow/ "$TP_DIR/arrow" fi cd $TP_DIR/arrow -git checkout b0863cb63d62ae7c4a429164e5a2e350d3c1f21a +git checkout 30e03a90718971c2a1d773145fb042d0c2857036