-
Notifications
You must be signed in to change notification settings - Fork 783
fix pybind11 incompatibility with some CUDA versions and add Catch2 dependency for tests #19047
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
Merged
Micket
merged 2 commits into
easybuilders:develop
from
Flamefire:20231020112132_new_pr_pybind112103
Oct 21, 2023
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| easyblock = 'CMakeMake' | ||
|
|
||
| name = 'Catch2' | ||
| version = '2.13.9' | ||
|
|
||
| homepage = 'https://github.com/catchorg/Catch2' | ||
| description = """A modern, C++-native, header-only, | ||
| test framework for unit-tests, TDD and BDD | ||
| - using C++11, C++14, C++17 and later | ||
| """ | ||
|
|
||
| toolchain = SYSTEM | ||
|
|
||
| source_urls = ['https://github.com/catchorg/Catch2/archive/'] | ||
| sources = ['v%(version)s.tar.gz'] | ||
| checksums = ['06dbc7620e3b96c2b69d57bf337028bf245a211b3cddb843835bfe258f427a52'] | ||
|
|
||
| # using CMake built with GCCcore to avoid relying on the system compiler to build it | ||
| builddependencies = [ | ||
| ('GCCcore', '10.2.0'), # required to a access CMake when using hierarchical module naming scheme | ||
| ('binutils', '2.35', '', ('GCCcore', '10.2.0')), # to make CMake compiler health check pass on old systems | ||
| ('CMake', '3.18.4', '', ('GCCcore', '10.2.0')), | ||
| ] | ||
|
|
||
| separate_build_dir = True | ||
|
|
||
| sanity_check_paths = { | ||
| 'files': [], | ||
| 'dirs': ['include/catch2', 'lib64/cmake'], | ||
| } | ||
|
|
||
| moduleclass = 'lib' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
easybuild/easyconfigs/p/pybind11/pybind11-2.10.3_fix-nvcc-compat.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| NVCC of CUDA 12 (and seemingly also CUDA 11.7 in some configureations) | ||
| fail to parse the expression and fail with | ||
| > pybind11/detail/../cast.h: In function ‘typename pybind11::detail::type_caster<typename pybind11::detail::intrinsic_type<T>::type | ||
| > ::cast_op_type<T> pybind11::detail::cast_op(make_caster<T>&)’: | ||
| > pybind11/detail/../cast.h:45:120: error: expected template-name before ‘<’ token | ||
| > 45 | return caster.operator typename make_caster<T>::template cast_op_type<T>(); | ||
|
|
||
| See https://github.com/pybind/pybind11/issues/4606 | ||
| Disambiguate the expression to workaround this. | ||
|
|
||
| Author: Alexander Grund (TU Dresden) | ||
|
|
||
| diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h | ||
| index 3a404602..1eefd0f1 100644 | ||
| --- a/include/pybind11/cast.h | ||
| +++ b/include/pybind11/cast.h | ||
| @@ -42,13 +42,14 @@ using make_caster = type_caster<intrinsic_t<type>>; | ||
| // Shortcut for calling a caster's `cast_op_type` cast operator for casting a type_caster to a T | ||
| template <typename T> | ||
| typename make_caster<T>::template cast_op_type<T> cast_op(make_caster<T> &caster) { | ||
| - return caster.operator typename make_caster<T>::template cast_op_type<T>(); | ||
| + using result_t = typename make_caster<T>::template cast_op_type<T>; | ||
| + return caster.operator result_t(); | ||
| } | ||
| template <typename T> | ||
| typename make_caster<T>::template cast_op_type<typename std::add_rvalue_reference<T>::type> | ||
| cast_op(make_caster<T> &&caster) { | ||
| - return std::move(caster).operator typename make_caster<T>:: | ||
| - template cast_op_type<typename std::add_rvalue_reference<T>::type>(); | ||
| + using result_t = typename make_caster<T>::template cast_op_type<typename std::add_rvalue_reference<T>::type>; | ||
| + return std::move(caster).operator result_t(); | ||
| } | ||
|
|
||
| template <typename type> |
21 changes: 21 additions & 0 deletions
21
easybuild/easyconfigs/p/pybind11/pybind11-2.10.3_require-catch.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| Error out if Catch2 is not found instead of silently skipping. | ||
|
|
||
| Author: Alexander Grund (TU Dresden) | ||
|
|
||
| diff --git a/tools/FindCatch.cmake b/tools/FindCatch.cmake | ||
| index 57bba58b..41f82e5c 100644 | ||
| --- a/tools/FindCatch.cmake | ||
| +++ b/tools/FindCatch.cmake | ||
| @@ -60,9 +60,10 @@ if(NOT CATCH_VERSION OR CATCH_VERSION VERSION_LESS ${Catch_FIND_VERSION}) | ||
| if(DOWNLOAD_CATCH) | ||
| _download_catch(${Catch_FIND_VERSION} "${PROJECT_BINARY_DIR}/catch/") | ||
| _get_catch_version() | ||
| + elseif(CATCH_INCLUDE_DIR) | ||
| + message(FATAL_ERROR "Catch (${CATCH_INCLUDE_DIR}) version to low: ${CATCH_VERSION} < ${Catch_FIND_VERSION}") | ||
| else() | ||
| - set(CATCH_FOUND FALSE) | ||
| - return() | ||
| + message(FATAL_ERROR "Catch not found") | ||
| endif() | ||
| endif() | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.