Skip to content

Commit

Permalink
Merge branch 'main' into static-link-library
Browse files Browse the repository at this point in the history
Signed-off-by: Elssky <[email protected]>
  • Loading branch information
Elssky authored Oct 17, 2024
2 parents 6d39a60 + b081718 commit e8c3219
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
68 changes: 68 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,74 @@ macro(install_graphar_target target)
)
endmacro()

# ------------------------------------------------------------------------------
# clean output data
# ------------------------------------------------------------------------------
add_custom_target(clean_data
COMMAND ${CMAKE_COMMAND} -E remove_directory /tmp/vertex
COMMAND ${CMAKE_COMMAND} -E remove_directory /tmp/edge
COMMAND ${CMAKE_COMMAND} -E remove_directory /tmp/ldbc
)

# ------------------------------------------------------------------------------
# clean target and data
# ------------------------------------------------------------------------------
add_custom_target(clean_all
COMMAND ${CMAKE_COMMAND} clean
COMMAND ${CMAKE_COMMAND} clean_data
)

# ------------------------------------------------------------------------------
# building or find third party library
# ------------------------------------------------------------------------------
# check if arrow is installed
find_package(Arrow QUIET)
if (NOT ${Arrow_FOUND})
message(FATAL_ERROR "apache-arrow is required, please install it and retry")
endif()
find_package(ArrowDataset QUIET)
if (NOT ${ArrowDataset_FOUND})
message(FATAL_ERROR "apache-arrow-dataset is required, please install it and retry")
endif()
if (${Arrow_VERSION} VERSION_GREATER_EQUAL "12.0.0")
# ArrowAcero is available in Arrow 12.0.0 and later
find_package(ArrowAcero QUIET)
if (NOT ${ArrowAcero_FOUND})
message(FATAL_ERROR "apache-arrow-acero is required, please install it and retry")
endif()
endif()
# Check if ORC is enabled.
if (NOT ${ARROW_ORC})
message(WARNING "apache-arrow is built without ORC extension, ORC related functionalities will be disabled.")
else()
add_definitions(-DARROW_ORC) # Add macro, otherwise inconsistent in build phase on ubuntu.
endif()

find_package(Parquet QUIET)
if (NOT ${Parquet_FOUND})
message(FATAL_ERROR "parquet is required, please install it and retry")
endif()

find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})

macro(get_target_location var target)
if(TARGET ${target})
foreach(prop LOCATION LOCATION_NOCONFIG LOCATION_DEBUG LOCATION_RELEASE)
get_target_property(${var} ${target} ${prop})
if(NOT ("${${var}}" STREQUAL "${var}-NOTFOUND"))
break ()
endif()
endforeach()
endif()
endmacro()

include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)
include_directories(src)

# ------------------------------------------------------------------------------
# generate graphar library
# ------------------------------------------------------------------------------
macro(build_graphar)
file(GLOB_RECURSE CORE_SRC_FILES "src/graphar/*.cc" ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/mini-yaml/yaml/*.cpp)
if(GRAPHAR_BUILD_STATIC)
Expand Down
6 changes: 6 additions & 0 deletions pyspark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@

.PHONY: install_test
install_test:
make clean
export JAVA_HOME=${JAVA_HOME_11_X64}
cd ../maven-projects/spark && mvn --no-transfer-progress clean package -DskipTests -Dspotless.check.skip=true && cd ../../pyspark
export PYSPARK_HADOOP_VERSION=3.3
poetry install --with=spark,tests

.PHONY: test
test:
make clean
export JAVA_HOME=${JAVA_HOME_11_X64}
export SPARK_TESTING=1
poetry run pytest --cov
Expand Down Expand Up @@ -53,3 +55,7 @@ install_docs:
.PHONY: docs
docs:
poetry run pdoc -t ./template --output-dir ./docs graphar_pyspark

.PHONY: clean
clean:
rm -rf /tmp/vertex /tmp/edge /tmp/ldbc || true

0 comments on commit e8c3219

Please sign in to comment.