Skip to content

Commit

Permalink
Fix codegen CMakeLists.txt (#26)
Browse files Browse the repository at this point in the history
Summary:
velox/experimental/codegen did not have its CMakeLists.txt set up properly, so some tests weren't ran when building with cmake. I had to disable one test, that will be addressed in the future.

Pull Request resolved: #26

Reviewed By: kkeita

Differential Revision: D30262438

Pulled By: christycylee

fbshipit-source-id: 2583fd8c93a0ee423c31f23e10e9c006ac3a6543
  • Loading branch information
christycylee authored and facebook-github-bot committed Aug 16, 2021
1 parent a465960 commit 67bf403
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
3 changes: 3 additions & 0 deletions velox/experimental/codegen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ add_subdirectory(code_generator)
add_subdirectory(ast)
add_subdirectory(udf_manager)
add_subdirectory(utils)
add_subdirectory(benchmark)
add_subdirectory(functions)
add_subdirectory(vector_function)

add_library(velox_experimental_codegen Codegen.cpp CodegenStubs.cpp
CodegenLogger.cpp)
Expand Down
9 changes: 4 additions & 5 deletions velox/experimental/codegen/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
add_executable(
velox_codegen_benchmark_single_output
SingleOutputDefaultNullsBenchmark.cpp
SingleOutputNotDefaultNullsBenchmark.cpp BooleanBenchmark.cpp)
SingleOutputNotDefaultNullsBenchmark.cpp BooleanBenchmarks.cpp)

target_link_libraries(
velox_codegen_benchmark_single_output
velox_exec_test_lib
velox_codegen_utils_resource_path
velox_codegen_code_generator
${FOLLY_BENCHMARK}
${FOLLY_WITH_DEPENDENCIES}
Expand All @@ -26,7 +27,6 @@ target_link_libraries(
${GFLAGS_LIBRARIES}
${FMT}
velox_core
koski_parser
velox_exec_test_util
velox_functions_lib
velox_functions_common
Expand All @@ -46,8 +46,7 @@ add_compile_definitions(velox_codegen_test
add_compile_definitions(
velox_codegen_test
CODEGEN="$<TARGET_LINKER_FILE:velox_codegen_code_generator>")
add_compile_definitions(velox_codegen_test
KOSKI_PARSER="$<TARGET_LINKER_FILE:koski_parser>")

add_compile_definitions(
velox_codegen_test
VELOX_FUNCTIONS_LIB="$<TARGET_LINKER_FILE:velox_functions_lib>")
Expand Down Expand Up @@ -89,7 +88,7 @@ target_link_libraries(
${GLOG}
${FMT}
velox_core
koski_parser
velox_codegen_utils_resource_path
velox_exec_test_util
velox_functions_lib
velox_functions_common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,11 @@ TEST_F(ArithmeticFunctionsTest, DISABLED_testRound) {
"round(C0)", {{32}, {13}, {-13}, {1}, {-1}});
}

TEST_F(ArithmeticFunctionsTest, testHash) {
// FIXME: This test errors on macs:
// velox/velox/functions/common/HashImpl.h:22:31: error: implicit instantiation
// of undefined template 'folly::hasher<std::__1::basic_string_view<char, \
// std::__1::char_traits<char> >, void>'
TEST_F(ArithmeticFunctionsTest, DISABLED_testHash) {
StringView input("hi welcome");
evaluateAndCompare<
RowTypeTrait<TypeKind::VARCHAR>,
Expand Down
14 changes: 14 additions & 0 deletions velox/experimental/codegen/functions/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

add_library(velox_codegen_functions INTERFACE)
target_link_libraries(velox_codegen_functions INTERFACE ${FMT})
4 changes: 2 additions & 2 deletions velox/experimental/codegen/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ add_dependencies(velox_experimental_codegen_test velox_codegen_expression_test)
target_link_libraries(
velox_experimental_codegen_test
${GTEST_BOTH_LIBRARIES}
velox_codegen_utils_resource_path
velox_core
velox_exec
velox_experimental_codegen
velox_exec_test_lib
velox_exec_test_util
velox_functions_common)
velox_functions_common
velox_codegen_utils_resource_path)

add_test(velox_experimental_codegen_test velox_experimental_codegen_test)
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

add_executable(velox_codegen_vector_function_test
veloxCodegenVectorFunctionTest.cpp, TempStringTest.cpp)
add_executable(velox_codegen_vector_function_test CodegenVectorFunctionTest.cpp
TempStringTest.cpp)
add_test(velox_codegen_vector_function_test velox_codegen_vector_function_test)

target_link_libraries(
Expand All @@ -37,7 +37,7 @@ target_link_libraries(
velox_dwio_type_fbhive
velox_dwrf_test_utils
velox_presto_serializer
velox_transform
velox_transform_utils
${ANTLR4_RUNTIME}
${Boost_ATOMIC_LIBRARIES}
${Boost_CONTEXT_LIBRARIES}
Expand Down

0 comments on commit 67bf403

Please sign in to comment.