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

Completes the WIP CMake config for find_package #116

Merged
merged 10 commits into from
Dec 16, 2024

Conversation

ilumsden
Copy link
Collaborator

The big thing this PR does is complete @JaeseungYeom's WIP DYADConfig.cmake and similar stuff for exporting DYAD and making it compatible with find_package(DYAD CONFIG).

It also does the following more minor things:

  • Makes the naming of install path variables (e.g., DYAD_INSTALL_INCLUDE_DIR) more consistent and tweaks the values to be more consistent with expected behavior for installation paths
  • Replaces the glibc version check with a portable version
  • Replaces the CMake targets that added -Werror with a macro that will directly add the flag to targets with target_compile_options

In case we want to revert any of these changes, this PR currently does not delete any of the old code. Instead, the old code is just all commented out.

These changes have all been tested with the unit testing from the in-progress refactor/enhancement of the A4MD benchmark. Thanks to that, I can confirm that these changes allow external projects to properly use DYAD as a dependency with find_package.

@ilumsden
Copy link
Collaborator Author

ilumsden commented Jul 3, 2024

This PR has been rebased on top of #117. It should only be merged once #117 is merged

@ilumsden
Copy link
Collaborator Author

ilumsden commented Jul 3, 2024

This PR is ready for review @hariharan-devarajan @JaeseungYeom. Just note that it shouldn't be merged before #117

ilumsden added a commit to TauferLab/dyad that referenced this pull request Jul 9, 2024
@JaeseungYeom
Copy link
Contributor

Was this the PR that had ${CMAKE_INSTALL_PREFIX}/ removed?
We had a discussion on either testing to make sure linking is not broken with dynamic libraries or put it back.

@ilumsden
Copy link
Collaborator Author

ilumsden commented Sep 3, 2024

@JaeseungYeom @hariharan-devarajan I've updated this PR to undo the removal of CMAKE_INSTALL_PREFIX in places. I still need to test that I can still use this to find DYAD in another CMake project, but this PR should be ready to discuss in our meeting on Thursday.

Copy link
Collaborator

@hariharan-devarajan hariharan-devarajan left a comment

Choose a reason for hiding this comment

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

Some minor comments.

CMakeLists.txt Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
cmake/modules/SetupCompiler.cmake Outdated Show resolved Hide resolved
@ilumsden
Copy link
Collaborator Author

ilumsden commented Sep 4, 2024

@hariharan-devarajan @JaeseungYeom tests with A4X-Benchmark were successful. I'll make the last couple of minor edits that @hariharan-devarajan suggested, and then this PR is fully ready for final review and merge.

@ilumsden
Copy link
Collaborator Author

ilumsden commented Sep 5, 2024

@ilumsden double check that links/rpath is set correctly by running ldd

@ilumsden ilumsden force-pushed the cmake_export branch 3 times, most recently from 68e66fb to 00fe881 Compare September 5, 2024 21:31
@ilumsden
Copy link
Collaborator Author

@ilumsden double check that links/rpath is set correctly by running ldd

RPATH is set correctly. When building with Spack, I get the following:

RPATH                /usr/WS2/lumsden1/spack/opt/spack/linux-rhel8-zen/gcc-10.3.1/dyad-cmake_export-l55ylmzb6eam427yrwgacppqpg3if2m5/lib64:/usr/WS2/lumsden1/spack/opt/spack/linux-rhel8-zen/gcc-10.3.1/dyad-cmake_export-l55ylmzb6eam427yrwgacppqpg3if2m5/lib64:/usr/WS2/lumsden1/spack/opt/spack/linux-rhel8-zen/gcc-10.3.1/gcc-runtime-10.3.1-jzsuaszeq4v63m2mgk3ccsbokplmvaxm/lib:/collab/usr/global/tools/tce4/packages/gcc/gcc-10.3.1/lib/gcc/x86_64-redhat-linux/10

The last 3 paths are injected by Spack. The first path is coming from DYAD's CMake.

Copy link
Collaborator

@hariharan-devarajan hariharan-devarajan left a comment

Choose a reason for hiding this comment

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

Comments for -FPIC.

Remove the commented target properties.

@ilumsden
Copy link
Collaborator Author

@hariharan-devarajan @JaeseungYeom all the comments from yesterday have been addressed. I just have to rebase.

@wangvsa
Copy link
Collaborator

wangvsa commented Dec 13, 2024

@ilumsden I need to merge this one before #120. Is this one ready?

@wangvsa wangvsa merged commit b24680e into flux-framework:main Dec 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMake CHECK_GLIBC_VERSION macro causes configure crashes on non-LC systems
4 participants