Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct compliation of cuml c library #3908

Conversation

robertmaynard
Copy link
Contributor

Resolves two issues found when trying to build cuml locally.

The first was that the CUML_C_TARGET had FAISS in the public link requirements, which doesn't look needed. This caused CMake configuration errors when trying to generate the cuml-config.cmake file. Solution was to move FAISS to be a private dependency ( brought in via CUML_CPP_TARGET )

The second was that the CUML_C_TARGET tests need to make sure the C library is enabled. CUML doesn't enable this language by default as the CUML_C_TARGET builds using the C++ compiler and exposes a C API via extern C blocks.
I didn't go with a blanket enable C language as each language enabled, as that would increase the default requirements to build CUML when testing is disabled.

The C api library like the C++ api doesn't need consumers to
link to faiss, so remove it from public API
The tests for the cuml C library need to ensure that the C language
is enabled, as that isn't done by default since the `cuml` library
uses C++ internally with `extern "C"` blocks.
The C api library like the C++ api doesn't need consumers to
link to faiss, so remove it from public API, but it needs to be
private.

In addition correctly specify where to find the FAISS headers
@dantegd dantegd added 5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working non-breaking Non-breaking change labels May 27, 2021
@dantegd dantegd added this to PR-WIP in v21.06 Release via automation May 27, 2021
Copy link
Member

@dantegd dantegd left a comment

Choose a reason for hiding this comment

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

Missed a comment in my first review, and after running locally stumbled into the same issue as CI:

[167/223] /usr/local/cuda-11.2/bin/nvcc -forward-unknown-to-host-compiler -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -I../bench/../src_prims -I_deps/benchmark-src/src/../include -I_deps/raft-src/cpp/include -I_deps/rmm-src/include -I_deps/thrust-src -I_deps/thrust-src/dependencies/cub -isystem=/usr/local/cuda-11.2/include -isystem=/home/galahad/miniconda3/envs/ns0527/include -O3 -DNDEBUG --generate-code=arch=compute_86,code=[sm_86] --expt-extended-lambda --expt-relaxed-constexpr -Xcompiler=-Wno-deprecated-declarations -Xcompiler -pthread -std=c++17 -MD -MT bench/CMakeFiles/prims_benchmark.dir/prims/add.cu.o -MF bench/CMakeFiles/prims_benchmark.dir/prims/add.cu.o.d -x cu -c ../bench/prims/add.cu -o bench/CMakeFiles/prims_benchmark.dir/prims/add.cu.o
FAILED: bench/CMakeFiles/prims_benchmark.dir/prims/add.cu.o 
/usr/local/cuda-11.2/bin/nvcc -forward-unknown-to-host-compiler -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -I../bench/../src_prims -I_deps/benchmark-src/src/../include -I_deps/raft-src/cpp/include -I_deps/rmm-src/include -I_deps/thrust-src -I_deps/thrust-src/dependencies/cub -isystem=/usr/local/cuda-11.2/include -isystem=/home/galahad/miniconda3/envs/ns0527/include -O3 -DNDEBUG --generate-code=arch=compute_86,code=[sm_86] --expt-extended-lambda --expt-relaxed-constexpr -Xcompiler=-Wno-deprecated-declarations -Xcompiler -pthread -std=c++17 -MD -MT bench/CMakeFiles/prims_benchmark.dir/prims/add.cu.o -MF bench/CMakeFiles/prims_benchmark.dir/prims/add.cu.o.d -x cu -c ../bench/prims/add.cu -o bench/CMakeFiles/prims_benchmark.dir/prims/add.cu.o
In file included from ../bench/prims/add.cu:19:
../bench/prims/../common/ml_benchmark.hpp:22:10: fatal error: cuml/common/logger.hpp: No such file or directory
   22 | #include <cuml/common/logger.hpp>

Not entirely sure of the cause of it yet, since not much changed in the cmakelists on the bench folder

cpp/CMakeLists.txt Outdated Show resolved Hide resolved
v21.06 Release automation moved this from PR-WIP to PR-Needs review May 27, 2021
robertmaynard and others added 2 commits May 27, 2021 11:43
Co-authored-by: Dante Gama Dessavre <dante.gamadessavre@gmail.com>
@robertmaynard robertmaynard requested a review from a team as a code owner May 27, 2021 18:19
@robertmaynard
Copy link
Contributor Author

rerun tests

@robertmaynard
Copy link
Contributor Author

rerun tests

v21.06 Release automation moved this from PR-Needs review to PR-Reviewer approved Jun 2, 2021
@dantegd
Copy link
Member

dantegd commented Jun 2, 2021

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 8f6b188 into rapidsai:branch-21.06 Jun 2, 2021
v21.06 Release automation moved this from PR-Reviewer approved to Done Jun 2, 2021
@robertmaynard robertmaynard deleted the bug/correct_compliation_of_cuml_c_library branch August 18, 2021 12:52
vimarsh6739 pushed a commit to vimarsh6739/cuml that referenced this pull request Oct 9, 2023
Resolves two issues found when trying to build `cuml` locally. 

The first was that the `CUML_C_TARGET` had `FAISS` in the public link requirements, which doesn't look needed. This caused CMake configuration errors when trying to generate the `cuml-config.cmake` file. Solution was to move `FAISS` to be a private dependency ( brought in via `CUML_CPP_TARGET` )

The second was that the `CUML_C_TARGET`  tests need to make sure the `C` library is enabled. CUML doesn't enable this language by default as the `CUML_C_TARGET` builds using the `C++` compiler and exposes a `C` API via `extern C` blocks. 
I didn't go with a blanket enable `C` language as each language enabled, as that would increase the default requirements to build CUML when testing is disabled.

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: rapidsai#3908
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working CMake CUDA/C++ non-breaking Non-breaking change
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants