Skip to content

Commit

Permalink
ARROW-17728: [C++][Gandiva] Accept LLVM 15.0 (#14125)
Browse files Browse the repository at this point in the history
Lead-authored-by: Jin Shang <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
js8544 and kou authored Sep 16, 2022
1 parent 6bc2e01 commit 9131724
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 29 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ jobs:
ARROW_BUILD_TYPE: release
ARROW_FLIGHT: ON
ARROW_FLIGHT_SQL: ON
ARROW_GANDIVA: ON
# ARROW-17728: SEGV on MinGW
ARROW_GANDIVA: OFF
ARROW_GCS: ON
ARROW_HDFS: OFF
ARROW_HOME: /ucrt${{ matrix.mingw-n-bits }}
Expand Down
30 changes: 14 additions & 16 deletions ci/scripts/cpp_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,20 @@ case "$(uname)" in
exclude_tests="gandiva-internals-test"
exclude_tests="${exclude_tests}|gandiva-projector-test"
exclude_tests="${exclude_tests}|gandiva-utf8-test"
if [ "${MSYSTEM}" = "MINGW32" ]; then
exclude_tests="${exclude_tests}|gandiva-binary-test"
exclude_tests="${exclude_tests}|gandiva-boolean-expr-test"
exclude_tests="${exclude_tests}|gandiva-date-time-test"
exclude_tests="${exclude_tests}|gandiva-decimal-single-test"
exclude_tests="${exclude_tests}|gandiva-decimal-test"
exclude_tests="${exclude_tests}|gandiva-filter-project-test"
exclude_tests="${exclude_tests}|gandiva-filter-test"
exclude_tests="${exclude_tests}|gandiva-hash-test"
exclude_tests="${exclude_tests}|gandiva-if-expr-test"
exclude_tests="${exclude_tests}|gandiva-in-expr-test"
exclude_tests="${exclude_tests}|gandiva-literal-test"
exclude_tests="${exclude_tests}|gandiva-null-validity-test"
exclude_tests="${exclude_tests}|gandiva-precompiled-test"
exclude_tests="${exclude_tests}|gandiva-projector-test"
fi
exclude_tests="${exclude_tests}|gandiva-binary-test"
exclude_tests="${exclude_tests}|gandiva-boolean-expr-test"
exclude_tests="${exclude_tests}|gandiva-date-time-test"
exclude_tests="${exclude_tests}|gandiva-decimal-single-test"
exclude_tests="${exclude_tests}|gandiva-decimal-test"
exclude_tests="${exclude_tests}|gandiva-filter-project-test"
exclude_tests="${exclude_tests}|gandiva-filter-test"
exclude_tests="${exclude_tests}|gandiva-hash-test"
exclude_tests="${exclude_tests}|gandiva-if-expr-test"
exclude_tests="${exclude_tests}|gandiva-in-expr-test"
exclude_tests="${exclude_tests}|gandiva-literal-test"
exclude_tests="${exclude_tests}|gandiva-null-validity-test"
exclude_tests="${exclude_tests}|gandiva-precompiled-test"
exclude_tests="${exclude_tests}|gandiva-projector-test"
ctest_options+=(--exclude-regex "${exclude_tests}")
;;
*)
Expand Down
1 change: 1 addition & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ set(ARROW_DOC_DIR "share/doc/${PROJECT_NAME}")
set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support")

set(ARROW_LLVM_VERSIONS
"15.0"
"14.0"
"13.0"
"12.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@
# specific language governing permissions and limitations
# under the License.

if(zstdAlt_FOUND)
return()
endif()

set(find_package_args)
if(zstdAlt_FIND_VERSION)
list(APPEND find_package_args ${zstdAlt_FIND_VERSION})
endif()
if(zstdAlt_FIND_QUIETLY)
list(APPEND find_package_args QUIET)
endif()
find_package(zstd ${find_package_args})
if(zstd_FOUND)
set(zstdAlt_FOUND TRUE)
return()
endif()

Expand Down Expand Up @@ -83,11 +96,17 @@ else()
endif()
endif()

find_package_handle_standard_args(zstd REQUIRED_VARS ZSTD_LIB ZSTD_INCLUDE_DIR)
find_package_handle_standard_args(zstdAlt REQUIRED_VARS ZSTD_LIB ZSTD_INCLUDE_DIR)

if(zstd_FOUND)
add_library(zstd::libzstd UNKNOWN IMPORTED)
set_target_properties(zstd::libzstd
if(zstdAlt_FOUND)
if(ARROW_ZSTD_USE_SHARED)
set(zstd_TARGET zstd::libzstd_shared)
add_library(${zstd_TARGET} SHARED IMPORTED)
else()
set(zstd_TARGET zstd::libzstd_static)
add_library(${zstd_TARGET} STATIC IMPORTED)
endif()
set_target_properties(${zstd_TARGET}
PROPERTIES IMPORTED_LOCATION "${ZSTD_LIB}"
INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIR}")
endif()
18 changes: 10 additions & 8 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2397,30 +2397,32 @@ macro(build_zstd)

file(MAKE_DIRECTORY "${ZSTD_PREFIX}/include")

add_library(zstd::libzstd STATIC IMPORTED)
set_target_properties(zstd::libzstd
add_library(zstd::libzstd_static STATIC IMPORTED)
set_target_properties(zstd::libzstd_static
PROPERTIES IMPORTED_LOCATION "${ZSTD_STATIC_LIB}"
INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_PREFIX}/include")

add_dependencies(toolchain zstd_ep)
add_dependencies(zstd::libzstd zstd_ep)
add_dependencies(zstd::libzstd_static zstd_ep)

list(APPEND ARROW_BUNDLED_STATIC_LIBS zstd::libzstd)
list(APPEND ARROW_BUNDLED_STATIC_LIBS zstd::libzstd_static)

set(ZSTD_VENDORED TRUE)
endmacro()

if(ARROW_WITH_ZSTD)
# ARROW-13384: ZSTD_minCLevel was added in v1.4.0, required by ARROW-13091
resolve_dependency(zstd
HAVE_ALT
TRUE
PC_PACKAGE_NAMES
libzstd
REQUIRED_VERSION
1.4.0)

if(TARGET zstd::libzstd)
set(ARROW_ZSTD_LIBZSTD zstd::libzstd)
if(ZSTD_VENDORED)
set(ARROW_ZSTD_LIBZSTD zstd::libzstd_static)
else()
# "SYSTEM" source will prioritize cmake config, which exports
# zstd::libzstd_{static,shared}
if(ARROW_ZSTD_USE_SHARED)
if(TARGET zstd::libzstd_shared)
set(ARROW_ZSTD_LIBZSTD zstd::libzstd_shared)
Expand Down

0 comments on commit 9131724

Please sign in to comment.