-
Notifications
You must be signed in to change notification settings - Fork 46
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
[FEA] set ${pkg}_DIR
for project dependencies to assist with building dependencies in a common build dir
#1
Comments
The primary issue holding this back is that this could break consuming projects when a cache is shared between multiple consumers. For example consider a cache where I think that for this to work safely it needs to be explicit on the consuming side to opt into the cache. The dependencies should generate / encode the location but shouldn't set it unless some requested flag is set by the consumer. @trxcllnt Did I capture the issues correctly? |
Should note for completeness -- this would happen even if the version numbers are different. To support this, CPM (or maybe CMake's For example, here's the include(ExternalProject)
ExternalProject_Add(arrow-populate
"UPDATE_DISCONNECTED" "False" "GIT_REPOSITORY" "https://github.com/apache/arrow.git" "GIT_TAG" "apache-arrow-1.0.1" "GIT_SHALLOW" "TRUE"
SOURCE_DIR "<root>/.cache/cpm/arrow/8e5cd63fd71d7269acd5d779a6767e97ede977f5"
BINARY_DIR "<root>/.cache/build/Release/arrow-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
USES_TERMINAL_DOWNLOAD YES
USES_TERMINAL_UPDATE YES
) In the above case, |
To properly test `cpm` packages in rapids-cmake we need to fix two major issues. 1. A way to have tests that depend on the same CPM package not execute at the same time. This is required so we don't double checkout a project 2. A way to checkout and build projects such as RMM that themselves use rapids-cmake without issue. Number rapidsai#1 is solved by the introduction of the `SERIAL` keyword Number rapidsai#2 is solved for most tests by having the `project_template` that `.cmake` tests use get `rapids-cmake` via FETCH_CONENT. This will allow us to verify local rapids-cmake changes against existing projects that use rapids-cmake
To properly test `cpm` packages in rapids-cmake we need to fix two major issues. 1. A way to have tests that depend on the same CPM package not execute at the same time. This is required so we don't double checkout a project 2. A way to checkout and build projects such as RMM that themselves use rapids-cmake without issue. Number #1 is solved by the introduction of the `SERIAL` keyword Number #2 is solved for most tests by having the `project_template` that `.cmake` tests use get `rapids-cmake` via FETCH_CONENT. This will allow us to verify local rapids-cmake changes against existing projects that use rapids-cmake Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: None URL: #48
In node-rapids we're taking advantage of a centralized source and build cache for all our C++ dependencies. We have multiple
CMakeLists.txt
project files that depend on certain expensive-to-build RAPIDS libraries likelibcudf
, and we don't want to build those libraries multiple times.CPM has a utility for telling it to centralize where it downloads dependency sources via
CPM_SOURCE_CACHE
, but it has no corresponding setting for centralizing dependency build dirs i.e.CPM_BINARY_CACHE
.We can trick CPM (everything else that uses FetchContent) into centralizing build dirs via the
FETCHCONTENT_BASE_DIR
variable.However, we later run into issues when a built project's export targets go to look up its own dependencies via
FindPackage()
. The dependencies aren't installed, and they're not in a locationFindPackage()
knows to search.And since
FetchContent
doesn't create directory namesFindPackage
recognizes as locations a package could be (i.e.thrust
vs.thrust-build
), we can't simply dolist(APPEND CMAKE_PREFIX_PATH ${FETCHCONTENT_BASE_DIR})
.Our workaround for this is to set
${pkg}_DIR
for a project's dependencies before callingCPMFindPackage()
. We have this little CMake function to help us:The text was updated successfully, but these errors were encountered: