Skip to content

Fix cloning, compilation and linking errors for the non-docker version - #9

Open
gprabowski wants to merge 3 commits into
mis-wut:masterfrom
gprabowski:master
Open

gprabowski wants to merge 3 commits into
mis-wut:masterfrom
gprabowski:master

Conversation

@gprabowski

Copy link
Copy Markdown

Currently the repository is impossible to clone or build in both docker and non-docker version.

Although not full, this is a list of changes that makes it work for the local non-docker version.

There's much more to be done, to make it universal, but this is the minimal set.

More changes will be added as the semester progresses.

steps to build, assuming conda rapids-23.04 environment has been installed (if not install from here)

git clone --recurse-submodules [...]
cd meta-json-parser
mkdir build
cd build
conda activate rapids-23.04
cmake ../ -GNinja
ninja

Comment thread .gitmodules
[submodule "third_parties/fmt"]
path = third_parties/fmt
url = https://github.com/fmtlib/fmt.git
[submodule "third_parties/mp11"]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise impossible to clone

Comment thread .gitmodules
[submodule "third_parties/googletest"]
path = third_parties/googletest
url = https://github.com/google/googletest.git
[submodule "third_parties/fmt"]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise impossible to link

Comment thread CMakeLists.txt

find_package(CUDAToolkit 10.0 REQUIRED)
# As of now not using LIBCUDF throws
set(USE_LIBCUDF 1)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not set to 1, the project throws compilation errors (ifdefs are leaky)

Comment thread CMakeLists.txt
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)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently the newest is 12 (so the previous would find 12, as it only set minimum), but RAPIDS are currently limited to 11.X

Comment thread CMakeLists.txt
include(GoogleTest)

#Add FMT library (as CUDA11.8 doesn't support gcc12)
add_subdirectory(third_parties/fmt)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

Comment thread CMakeLists.txt

target_include_directories(meta-cudf-parser-1 PUBLIC
"${PROJECT_SOURCE_DIR}/meta_cudf/opt1"
"$ENV{CONDA_PREFIX}/include"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

universal instead of hardfixed

Comment thread CMakeLists.txt
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)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise throws linking errors

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During which part of build (I wonder which part requires fmt library)?

Comment thread CMakeLists.txt
target_include_directories(meta-cudf-parser-1 PUBLIC
/usr/local/include
/usr/local/include/libcudf/libcudacxx
$ENV{CONDA_PREFIX}/include

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

universal instead of hardfixed

Comment thread CMakeLists.txt
# 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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't find libcudacxx in any folder related to current libraries and deleting this doesn't change anything

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember it was necessary for something, perhaps for running via docker image, but might be no longer needed.

Comment thread CMakeLists.txt
)
target_include_directories(meta-cudf-parser-1 AFTER PUBLIC
/opt/conda/envs/rapids/include
$ENV{CONDA_PREFIX}/include

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

universal instead of hardfixed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also /opt/conda/envs/rapids doesn't exist in a default conda installation of rapids

Comment thread CMakeLists.txt
cudf
-L/usr/local/cuda/lib64 -L/usr/local/lib
-L/opt/conda/envs/rapids/lib
-L$ENV{CONDA_PREFIX}/lib

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

universal instead of hardfixed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also /opt/conda/envs/rapids doesn't exist in a default conda installation of rapids

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RAPIDS docker images used to have some of necessary includes and libs in /opt/conda/envs/rapids/ - while Dockerfile does not set CONDA_PREFIX environment variable. That's why it is here: for sudo docker build . to work.

Adding the $ENV{CONDA_PREFIX}/lib part is good, but I'd wait with removing /opt/conda/envs/rapids/ (see split commits).

Comment thread CMakeLists.txt

target_include_directories(meta-json-parser-benchmark PUBLIC
/usr/local/include
/usr/local/include/libcudf/libcudacxx

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

Comment thread CMakeLists.txt
target_include_directories(meta-json-parser-benchmark PUBLIC
/usr/local/include
/usr/local/include/libcudf/libcudacxx
$ENV{CONDA_PREFIX}/include

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

Comment thread CMakeLists.txt
# 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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

Comment thread CMakeLists.txt
cudf
-L/usr/local/cuda/lib64 -L/usr/local/lib
-L/opt/conda/envs/rapids/lib
-L$ENV{CONDA_PREFIX}/lib

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

universal instead of hardfixed

as above with respect to existence of /envs/rapids

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());

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cuDF in new (stable) RAPIDS released has changed its API and this is the new approach. schema info is a table of structs containing strings instead of table of strings

more info here

#pragma once
#include <cuda_runtime_api.h>
#include <thrust/host_vector.h>
#include <thrust/system/cuda/experimental/pinned_allocator.h>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used and CUDA 12 toolchain incompatible

Comment thread meta_cudf/parser.cu

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});});

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above (cuDF API change)

@gprabowski

Copy link
Copy Markdown
Author

a thing I noticed in development:
CONDA overwrites CUDA_HOME, it should be set manually back to 11.8 instead of 12.1 to which for some reason conda defaults to (although rapids-23.04 explicitly needs 11.8)

@jnareb

jnareb commented May 23, 2023

Copy link
Copy Markdown
Contributor

Thanks.

I am currently working on incorporating this pull request, splitting it into even smaller pieces.
You can see current work in progress in branch 'pg/cmake_improvements', see
master...pg/cmake_improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants