From 62bcfef37f4b0ca736644d649ad9bb399cb217d6 Mon Sep 17 00:00:00 2001 From: Mehrdad Date: Sat, 18 Jun 2016 21:35:26 -0700 Subject: [PATCH 1/3] Windows compatibility fixes for posix_memalign() and mmap() --- cpp/src/arrow/util/memory-pool.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cpp/src/arrow/util/memory-pool.cc b/cpp/src/arrow/util/memory-pool.cc index 9f83afe4cb2..6ad140b7aca 100644 --- a/cpp/src/arrow/util/memory-pool.cc +++ b/cpp/src/arrow/util/memory-pool.cc @@ -33,7 +33,13 @@ namespace { Status AllocateAligned(int64_t size, uint8_t** out) { // TODO(emkornfield) find something compatible with windows constexpr size_t kAlignment = 64; - const int result = posix_memalign(reinterpret_cast(out), kAlignment, size); + const int result = +#ifdef _WIN32 + ((*out = static_cast(_aligned_malloc(size, kAlignment))) ? 0 : errno) +#else + posix_memalign(reinterpret_cast(out), kAlignment, size) +#endif + ; if (result == ENOMEM) { std::stringstream ss; ss << "malloc of size " << size << " failed"; @@ -83,7 +89,11 @@ int64_t InternalMemoryPool::bytes_allocated() const { void InternalMemoryPool::Free(uint8_t* buffer, int64_t size) { std::lock_guard guard(pool_lock_); DCHECK_GE(bytes_allocated_, size); +#ifdef _WIN32 + _aligned_free(buffer); +#else std::free(buffer); +#endif bytes_allocated_ -= size; } From 2844095e5b0929b2d064b75359da261dfad88d97 Mon Sep 17 00:00:00 2001 From: Mehrdad Date: Tue, 22 Nov 2016 23:27:40 -0800 Subject: [PATCH 2/3] Visual Studio projects --- vsprojects/arrow.props | 28 ++++++++++ vsprojects/arrow.vcxproj | 116 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 vsprojects/arrow.props create mode 100644 vsprojects/arrow.vcxproj diff --git a/vsprojects/arrow.props b/vsprojects/arrow.props new file mode 100644 index 00000000000..8e3076c54cb --- /dev/null +++ b/vsprojects/arrow.props @@ -0,0 +1,28 @@ + + + + + + $(SolutionDir)build\$(Platform)\$(Configuration)\ + $(SolutionDir)build\$(Platform)\$(Configuration)\$(MSBuildProjectName)\ + + + 8.1 + + + true + + + + $(ProjectDir)..\cpp\src;$(ProjectDir)..\cpp\thirdparty\flatbuffers\include;$(ProjectDir)..\cpp\thirdparty\parquet\src;%(AdditionalIncludeDirectories) + true + false + ARROW_UTIL_VISIBILITY_H=;ARROW_EXPORT=;ARROW_NO_EXPORT=;%(PreprocessorDefinitions) + + + + + NDEBUG;PreprocessorDefinitions) + + + \ No newline at end of file diff --git a/vsprojects/arrow.vcxproj b/vsprojects/arrow.vcxproj new file mode 100644 index 00000000000..375eca8a59d --- /dev/null +++ b/vsprojects/arrow.vcxproj @@ -0,0 +1,116 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {10E7D8E8-0EEB-46EA-A58D-F9236B5960AD} + Win32Proj + + + + StaticLibrary + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Document + "$(OutDir)flatc.exe" -c -o "$(ProjectDir)..\cpp\src\arrow\ipc" "%(FullPath)" + $(ProjectDir)..\cpp\src\arrow\ipc\Message_generated.h;%(Outputs) + + + Document + "$(OutDir)flatc.exe" -c -o "$(ProjectDir)..\cpp\src\arrow\ipc" "%(FullPath)" + $(ProjectDir)..\cpp\src\arrow\ipc\Message_generated.h;%(Outputs) + + + + + {5b5857e1-64e2-4ced-a12e-45e1b3880496} + + + + + \ No newline at end of file From 52d2b32ab95e8ca92f7675dd4c904a0cbd6e67c4 Mon Sep 17 00:00:00 2001 From: Mehrdad Date: Tue, 22 Nov 2016 23:28:07 -0800 Subject: [PATCH 3/3] Add Submodules --- .gitmodules | 3 +++ cpp/thirdparty/flatbuffers | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 cpp/thirdparty/flatbuffers diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..bcbab666e98 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "third_party/flatbuffers"] + path = cpp/thirdparty/flatbuffers + url = https://github.com/ray-project/flatbuffers.git diff --git a/cpp/thirdparty/flatbuffers b/cpp/thirdparty/flatbuffers new file mode 160000 index 00000000000..05cac3137ee --- /dev/null +++ b/cpp/thirdparty/flatbuffers @@ -0,0 +1 @@ +Subproject commit 05cac3137ee6f2a12aab8b5ac21f97c6614739a9