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

Explicitly build Legion if legion_dir or legion_src_dir is not provided #411

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions cmake/thirdparty/get_legion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ function(find_or_configure_legion)
BUILD_EXPORT_SET legate-core-exports
INSTALL_EXPORT_SET legate-core-exports)

# First try to find Legion via find_package()
# so the `Legion_USE_*` variables are visible
# Use QUIET find by default.
set(_find_mode QUIET)
# If Legion_DIR/Legion_ROOT are defined as something other than empty or NOTFOUND
# use a REQUIRED find so that the build does not silently download Legion.
if(Legion_DIR OR Legion_ROOT)
set(_find_mode REQUIRED)
if((NOT CPM_Legion_SOURCE) AND (NOT CPM_DOWNLOAD_Legion))
# First try to find Legion via find_package()
# so the `Legion_USE_*` variables are visible
# Use QUIET find by default.
set(_find_mode QUIET)
# If Legion_DIR/Legion_ROOT are defined as something other than empty or NOTFOUND
# use a REQUIRED find so that the build does not silently download Legion.
if(Legion_DIR OR Legion_ROOT)
set(_find_mode REQUIRED)
endif()
rapids_find_package(Legion ${PKG_VERSION} EXACT CONFIG ${_find_mode} ${FIND_PKG_ARGS})
endif()
rapids_find_package(Legion ${PKG_VERSION} EXACT CONFIG ${_find_mode} ${FIND_PKG_ARGS})

if(Legion_FOUND)
message(STATUS "CPM: using local package Legion@${PKG_VERSION}")
Expand Down
4 changes: 3 additions & 1 deletion install.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,10 @@ def validate_path(path):
cmake_flags += ["-DThrust_ROOT=%s" % thrust_dir]
if legion_dir:
cmake_flags += ["-DLegion_ROOT=%s" % legion_dir]
if legion_src_dir:
elif legion_src_dir:
cmake_flags += ["-DCPM_Legion_SOURCE=%s" % legion_src_dir]
else:
cmake_flags += ["-DCPM_DOWNLOAD_Legion=ON"]
if legion_url:
cmake_flags += ["-Dlegate_core_LEGION_REPOSITORY=%s" % legion_url]
if legion_branch:
Expand Down