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

CMake: add install target #323

Merged
merged 7 commits into from
Jan 6, 2025
Merged

CMake: add install target #323

merged 7 commits into from
Jan 6, 2025

Conversation

skosukhin
Copy link
Collaborator

  1. Add the install target. Installs the rte and rrtmgp libraries together with their module files.
    TODO: consider fetching and installing the rrtmgp-gas-*.nc data files from rrtmgp-data as there are users who consider them to be part of the library.
  2. Generate and install CMake config, target and version files to enable find_package(rte-rrtmgp) in the user projects. The COMPATIBILITY is set to SameMinorVersion, which means that if the users need version 1.8, any 1.8.x version suffices but neither 1.7.x nor 1.9.x do.
  3. Export the targets to the build directory to make the project locatable from the build directory as well (i.e. find_package(rte-rrtmgp) with CMAKE_PREFIX_PATH containing /path/to/rte-rrtmgp/build). This part also required some tweaks for the rtekernels and rrtmgpkernels object libraries since we don't want to expose them to the users (at least for now).
  4. Add public aliases in the rte-rrtmgp:: namespace so the project is fetchable and addable (with add_subdirectory) by the users' application projects.

@RobertPincus RobertPincus self-requested a review January 6, 2025 17:00
@RobertPincus
Copy link
Member

@skosukhin
Re 1, it might indeed make sense to fetch the data during installation, especially if there are ways to override the location/update the data (do we add CMake to the data repo?)
Re 3, there may be times that users need access to front-end and kernel-libraries separately, e.g. when using the C++ front end with the Fortran kernels.

@skosukhin skosukhin marked this pull request as draft January 6, 2025 17:05
Copy link
Member

@RobertPincus RobertPincus left a comment

Choose a reason for hiding this comment

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

Thanks again, @skosukhin. Note that we may want to kernel libraries to be visible e.g. when using the C++ front end with the kernel libraries.

@skosukhin skosukhin marked this pull request as ready for review January 6, 2025 17:24
@skosukhin
Copy link
Collaborator Author

Re 1, it might indeed make sense to fetch the data during installation, especially if there are ways to override the location/update the data (do we add CMake to the data repo?)

What is the full list of data files that you think should be installed?

Re 3, there may be times that users need access to front-end and kernel-libraries separately, e.g. when using the C++ front end with the Fortran kernels.

Currently, the kernel libraries are only auxiliary OBJECT libraries. They are not produced by the build system (i.e. there are no respective *.a files) and their objects are simply injected into librte.a and librrtmgp.a. I will need a better understanding of the source code structure to come up with a suggestion on what build artefacts we should produce and install. At the moment, this is similar (as much as it makes sense) to how things are done in the autoconf branch.

@RobertPincus RobertPincus merged commit a7d6a69 into develop Jan 6, 2025
41 checks passed
@RobertPincus RobertPincus deleted the cmake-install branch January 6, 2025 17:44
@RobertPincus RobertPincus mentioned this pull request Jan 6, 2025
12 tasks
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