-
Notifications
You must be signed in to change notification settings - Fork 9
Multiple find package pdi #610
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
base: main
Are you sure you want to change the base?
Multiple find package pdi #610
Conversation
|
Thank you @benoitmartin88 I think it should fix CExA-project/ddc#964. A naive question that comes to me is, are these global targets (
|
|
@jbigot Could you take a look ? |
…/pdi into multiple_find_package_pdi
|
Do you think it is wortk keeping the How should the user react seeing this message ? |
|
You are right, this warning might be a little too aggressive. I'm going to dial it down to "normal" cmake message. |
| cd "$(mktemp -d pdibuild.XXXXX)" | ||
| TEST_DIR="${PWD}" | ||
|
|
||
| INSTALL_DIR="${INSTALL_DIR:-/tmp/pdi_install_dir}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| INSTALL_DIR="${INSTALL_DIR:-/tmp/pdi_install_dir}" | |
| INSTALL_DIR="${INSTALL_DIR:-"$(mktemp --tmpdir -d pdi_install_dir_XXXXXXX)"}" |
| -DBUILD_USER_CODE_PLUGIN=ON" | ||
|
|
||
| DYLD_LIBRARY_PATH=${INSTALL_DIR}/lib:$DYLD_LIBRARY_PATH | ||
| CMAKE_TEST_FLAGS="-DTEST_FORTRAN=OFF -DTEST_PYTHON=OFF" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to explicitly set DYLD_LIBRARY_PATH? Shouldn't pdirun be enough?
If we do not build neither Fortran nor Python, why do we need to specify that we don't test them again?
| cd /tmp | ||
| cd "$(mktemp -d pdicmaketestdir.XXXXX)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| cd /tmp | |
| cd "$(mktemp -d pdicmaketestdir.XXXXX)" | |
| cd "$(mktemp --tmpdir -d pdicmaketestdir.XXXXXXX)" |
| add_executable(PDI::pdirun IMPORTED) | ||
| set_target_properties(PDI::pdirun PROPERTIES IMPORTED_LOCATION "${PDI_pdirun_EXECUTABLE}") | ||
| else() | ||
| message("Target PDI::pdirun is already defined. Skipping.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should handle the QUIET parameter here
| add_library(PDI::PDI_Fortran ALIAS PDI_f90) | ||
| add_library(PDI::pdi_f90 ALIAS PDI_f90) | ||
| else() | ||
| message("Target PDI_f90 is already defined. Skipping.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should handle the QUIET parameter here
| target_link_libraries(PDI_C INTERFACE PDI::PDI_C) | ||
| add_library(PDI::pdi ALIAS PDI_C) | ||
| else() | ||
| message("Target PDI_C is already defined. Skipping.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be made a lower priority message and QUIET should be honored
| # Note: temporary fix for oldest supported cmake. target will have global scope with cmake version < 3.18 | ||
| if (CMAKE_MAJOR_VERSION VERSION_EQUAL "3" AND CMAKE_MINOR_VERSION VERSION_GREATER_EQUAL "18") | ||
| add_library(PDI_f90 INTERFACE IMPORTED) | ||
| else() | ||
| add_library(PDI_f90 INTERFACE) | ||
| endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Note: temporary fix for oldest supported cmake. target will have global scope with cmake version < 3.18 | |
| if (CMAKE_MAJOR_VERSION VERSION_EQUAL "3" AND CMAKE_MINOR_VERSION VERSION_GREATER_EQUAL "18") | |
| add_library(PDI_f90 INTERFACE IMPORTED) | |
| else() | |
| add_library(PDI_f90 INTERFACE) | |
| endif() | |
| add_library(PDI_f90 INTERFACE IMPORTED) |
| #### Removed | ||
|
|
||
| #### Fixed | ||
| * Fix multiple consecutive calls to find_package(PDI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * Fix multiple consecutive calls to find_package(PDI) | |
| * Support multiple reentrant calls to find_package(PDI) |
| # check subdirectory scope | ||
| # Note: temporary deactivate due to cmake version <3.18 bug with target alias | ||
| #message(STATUS "+ add_subdirectory(PDI)") | ||
| #add_subdirectory(subdir) | ||
| #assert(NOT DEFINED PDI_FOUND) | ||
| #assert(NOT TARGET PDI_C) | ||
| #assert(NOT TARGET PDI_f90) | ||
| #assert(NOT TARGET PDI_pysupport) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move to 3.22 as a minimum. Also this can be conditionnally deactivated base on cmake version
| make install | ||
| cd /tmp | ||
| cd "$(mktemp -d pdicmaketestdir.XXXXX)" | ||
| ${INSTALL_DIR}/bin/pdirun cmake ${CMAKE_TEST_FLAGS} ${SRCDIR}/tests/test_cmake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option would be to call this from a bash script called through ctest. This would make it a normal test. Do you think this is feasible?
Closes
find_package(PDI)cannot be called twice #526 and fixes CExA-project/ddc/pull/964List of things to check before making a PR
Before merging your code, please check the following:
.clang-format;Fix #issuekeyword to autoclose the issue when merged.