diff --git a/.gitignore b/.gitignore index 59f0693..f5bf3bd 100644 --- a/.gitignore +++ b/.gitignore @@ -462,3 +462,6 @@ MigrationBackup/ # End of https://www.toptal.com/developers/gitignore/api/clion,visualstudio /CMakeSettings.json + +# Build directory +build/ diff --git a/.gitmodules b/.gitmodules index 5970d1e..5d8803c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,12 @@ -[submodule "third_parties/googletest"] - path = third_parties/googletest - url = https://github.com/google/googletest.git +[submodule "third_parties/fmt"] + path = third_parties/fmt + url = https://github.com/fmtlib/fmt.git [submodule "third_parties/mp11"] path = third_parties/mp11 - url = git@github.com:mis-wut/mp11.git + url = https://github.com/boostorg/mp11.git [submodule "third_parties/CLI11"] path = third_parties/CLI11 url = https://github.com/CLIUtils/CLI11.git +[submodule "third_parties/googletest"] + path = third_parties/googletest + url = https://github.com/google/googletest diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ff4b7b..b228d99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,29 +3,22 @@ set(CMAKE_VERBOSE_MAKEFILE ON) project(meta-json-parser VERSION 0.1 LANGUAGES CXX CUDA) -find_package(CUDAToolkit 10.0 REQUIRED) +# As of now not using LIBCUDF throws +set(USE_LIBCUDF 1) -IF(NOT LOCAL_LIB) -find_package(Boost 1.75) # version 1.75 is required to use boost::mp11::mp_pairwise_fold_q -ENDIF() +find_package(CUDAToolkit EXACT 11.8 REQUIRED) -IF(NOT Boost_FOUND) - add_subdirectory(third_parties/mp11) - add_library(Boost::boost ALIAS boost_mp11) -ENDIF() - -IF(NOT LOCAL_LIB) -find_package(GTest REQUIRED CONFIG) -ENDIF() - -IF(NOT GTest_FOUND) - add_subdirectory(third_parties/googletest) - add_library(GTest::gtest ALIAS gtest) - add_library(GTest::gmock ALIAS gmock) -ENDIF() +# Add Boost MP11 library +add_subdirectory(third_parties/mp11) +add_library(Boost::boost ALIAS boost_mp11) +# Add GoogleTest +add_subdirectory(third_parties/googletest) include(GoogleTest) +#Add FMT library (as CUDA11.8 doesn't support gcc12) +add_subdirectory(third_parties/fmt) + add_library(lib-meta-json-parser INTERFACE) target_compile_features(lib-meta-json-parser INTERFACE cxx_std_17 cuda_std_17) @@ -113,6 +106,7 @@ target_link_libraries(meta-cudf-parser-1 PUBLIC lib-meta-json-parser) target_include_directories(meta-cudf-parser-1 PUBLIC "${PROJECT_SOURCE_DIR}/meta_cudf/opt1" + "$ENV{CONDA_PREFIX}/include" ) target_compile_options(meta-cudf-parser-1 PRIVATE $<$:--expt-relaxed-constexpr> $<$:--extended-lambda>) @@ -182,7 +176,7 @@ add_subdirectory(third_parties/CLI11) #add_executable(meta-json-parser-benchmark benchmark/checkpoint_results.cpp benchmark/checkpoint_results.h) add_executable(meta-json-parser-benchmark) -target_link_libraries(meta-json-parser-benchmark PRIVATE lib-meta-json-parser CLI11) +target_link_libraries(meta-json-parser-benchmark PRIVATE lib-meta-json-parser fmt::fmt CLI11) # libcudf is an optional dependency for meta-json-parser-benchmark # run cmake with -DUSE_LIBCUDF=1 to enable it @@ -192,15 +186,15 @@ if (USE_LIBCUDF) # instead of hardcoding paths to includes and to libraries, like below target_include_directories(meta-cudf-parser-1 PUBLIC /usr/local/include - /usr/local/include/libcudf/libcudacxx + $ENV{CONDA_PREFIX}/include ) target_include_directories(meta-cudf-parser-1 AFTER PUBLIC - /opt/conda/envs/rapids/include + $ENV{CONDA_PREFIX}/include ) target_link_libraries(meta-cudf-parser-1 PRIVATE cudf -L/usr/local/cuda/lib64 -L/usr/local/lib - -L/opt/conda/envs/rapids/lib + -L$ENV{CONDA_PREFIX}/lib ) target_compile_definitions(meta-cudf-parser-1 PRIVATE HAVE_LIBCUDF=1 @@ -208,17 +202,18 @@ if (USE_LIBCUDF) target_include_directories(meta-json-parser-benchmark PUBLIC /usr/local/include - /usr/local/include/libcudf/libcudacxx + $ENV{CONDA_PREFIX}/include ) + # NOTE: needs to be added as the last directory to be checked, because # it can contain outdated Boost library (which in Ubuntu 20.04 is Boost 1.72) target_include_directories(meta-json-parser-benchmark AFTER PUBLIC - /opt/conda/envs/rapids/include + $ENV{CONDA_PREFIX}/include ) target_link_libraries(meta-json-parser-benchmark PRIVATE cudf -L/usr/local/cuda/lib64 -L/usr/local/lib - -L/opt/conda/envs/rapids/lib + -L$ENV{CONDA_PREFIX}/lib ) target_compile_definitions(meta-json-parser-benchmark PRIVATE HAVE_LIBCUDF=1 diff --git a/include/meta_json_parser/debug_helpers.cpp b/include/meta_json_parser/debug_helpers.cpp index 8d35a74..67639d9 100644 --- a/include/meta_json_parser/debug_helpers.cpp +++ b/include/meta_json_parser/debug_helpers.cpp @@ -192,7 +192,7 @@ void describe_table(cudf::io::table_with_metadata& table_with_metadata, bool dum printf("table (with metadata) has %d columns\n", n_cols); for (int col_idx = 0; col_idx < n_cols; col_idx++) { printf("column(%d) name is \"%s\":\n", col_idx, - table_with_metadata.metadata.column_names[col_idx].c_str()); + table_with_metadata.metadata.schema_info[col_idx].name.c_str()); describe_column(table.column(col_idx), dump_data); } } diff --git a/include/meta_json_parser/parser_output_host.cuh b/include/meta_json_parser/parser_output_host.cuh index 808b814..dcb1251 100644 --- a/include/meta_json_parser/parser_output_host.cuh +++ b/include/meta_json_parser/parser_output_host.cuh @@ -1,7 +1,6 @@ #pragma once #include #include -#include #include #include #include diff --git a/meta_cudf/parser.cu b/meta_cudf/parser.cu index 46b0719..54411c9 100644 --- a/meta_cudf/parser.cu +++ b/meta_cudf/parser.cu @@ -257,7 +257,8 @@ cudf::io::table_with_metadata generate_example_metadata(const char* filename, in return "Column " + to_string(i++); }); - cudf::io::table_metadata metadata{column_names}; + cudf::io::table_metadata metadata; + std::for_each(begin(column_names), end(column_names), [&](auto& elem){metadata.schema_info.push_back({elem});}); return cudf::io::table_with_metadata{ make_unique(cudf_table), diff --git a/third_parties/CLI11 b/third_parties/CLI11 index 0d06d21..4a14b78 160000 --- a/third_parties/CLI11 +++ b/third_parties/CLI11 @@ -1 +1 @@ -Subproject commit 0d06d21b56eadef9dcb24907ee2866b2b6f0babe +Subproject commit 4a14b78ff44ee4e25105d0ec7d6fc1fbd7bbca5e diff --git a/third_parties/fmt b/third_parties/fmt new file mode 160000 index 0000000..02cae7e --- /dev/null +++ b/third_parties/fmt @@ -0,0 +1 @@ +Subproject commit 02cae7e48ac9b1d90acb0ee07c76fbde2462a99e diff --git a/third_parties/googletest b/third_parties/googletest index 1de637f..f345b2c 160000 --- a/third_parties/googletest +++ b/third_parties/googletest @@ -1 +1 @@ -Subproject commit 1de637fbdd4ab0051229707f855eee76f5a3d5da +Subproject commit f345b2ca6adb1b505049190867eedf24d3b5eaa3 diff --git a/third_parties/mp11 b/third_parties/mp11 index 19c1a9a..773ec9b 160000 --- a/third_parties/mp11 +++ b/third_parties/mp11 @@ -1 +1 @@ -Subproject commit 19c1a9a202f1135d20a32a656a2955d136342b48 +Subproject commit 773ec9b8b2b9133c194d0c97c89abb47c1a82de4