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

Patch so that "make install" works properly. #140

Merged

Conversation

rhoneyager-tomorrow
Copy link
Contributor

@rhoneyager-tomorrow rhoneyager-tomorrow commented Jun 18, 2024

Description

The ecbuild to cmake update broke the ability to have CMake "install" CRTM. This fixes it. The patch is based on the v3.1.0-skylabv8 tag, which is why there are conflicts against develop.

Expected behavior:

cmake -D CMAKE_INSTALL_PREFIX=/some/installation/directory   path_to_crtm_source
make install

-- Install configuration: "Release"
-- Up-to-date: /some/installation/directory/lib64/libcrtm.a
-- Up-to-date: /some/installation/directory/lib64/cmake/crtm/crtm-config.cmake
-- Up-to-date: /some/installation/directory/lib64/cmake/crtm/crtm-config-version.cmake
-- Up-to-date: /some/installation/directory/lib64/cmake/crtm/crtm-targets.cmake
-- Up-to-date: /some/installation/directory/lib64/cmake/crtm/crtm-targets-release.cmake
-- Up-to-date: /some/installation/directory/module/crtm/Intel/2021.9.0.20230302
-- Up-to-date: /some/installation/directory/module/crtm/Intel/2021.9.0.20230302/crtm_module.mod
......

Issue(s) addressed

None tracked here.

Dependencies

None.

Impact

Spack can build CRTM v3 again.

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (No doc changes relevant)
  • I have run the unit tests before creating the PR (None applicable)
  • I have tested this code in a jedi-bundle build
  • I have built CRTM independent of a bundle, run make install, and then passed that installation directory for use in a bundle build of ufo. Ex: cmake -Dcrtm_DIR=/some/installation/directory/for/crtm.
  • I have built CRTM independent of a bundle, and passed the CRTM build directory for use in a bundle build of ufo. Ex: cmake -Dcrtm_DIR=/some/build/directory/for/crtm.

@rhoneyager-tomorrow rhoneyager-tomorrow marked this pull request as draft June 18, 2024 18:45
CMakeLists.txt Outdated
@@ -70,14 +70,9 @@ install(FILES
# Install the export set for use with the install-tree
install(EXPORT ${PROJECT_NAME}-config
FILE "${PROJECT_NAME}-targets.cmake"
#FILE "${PROJECT_NAME}-config.cmake"
Copy link
Contributor

Choose a reason for hiding this comment

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

as far as I understand it, the crtm-config.cmake generation is necessary for integration in JEDI/UFO -- that's what it looks for to find CRTM. I may be missing something.

@BenjaminTJohnson
Copy link
Contributor

@rhoneyager-tomorrow just tested and looks like it works without any issues.

@rhoneyager-tomorrow
Copy link
Contributor Author

rhoneyager-tomorrow commented Jun 21, 2024

Still working on it! It's in draft and visible so that Rick Grubin can also take a look and finish any leftover parts.

@rhoneyager-tomorrow
Copy link
Contributor Author

Open for review.

You have to consider three cases for how CMake can be built and linked with dependent projects.

  1. A jedi-bundle build. This is managed by ecbuild, and a whole slew of different repositories are combined together as a set of CMake projects and sub-projects. There's nothing special in this case.
  2. Linking a downstream project to a CMake build directory. At your build root, the crtm-config.cmake and crtm-targets*.cmake files are written, and find_package(crtm) will locate crtm if you give it a hint (by setting crtm_DIR to the crtm build location).
  3. Linking a downstream project to a CMake install directory. This is the collection of files and folders written when you run make install. Normally, this defaults to /usr/local, but this install path may be customized by setting CMAKE_PREFIX_PATH accordingly. As with case 2, find_package(crtm) will locate crtm if you give it a hint (by setting crtm_DIR to the crtm install location). This is also how Spack installs packages. It sets the correct CMake variables and runs make install, and everything just works.

I've tested all three cases, and can successfully link crtm to ufo in each case.

@rhoneyager-tomorrow rhoneyager-tomorrow marked this pull request as ready for review June 28, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants