Skip to content

CMakePackage: allow custom CMAKE_PREFIX_PATH entries#32547

Merged
becker33 merged 6 commits intospack:developfrom
scheibelp:bugfix/cmake-prefix-path-option
Sep 8, 2022
Merged

CMakePackage: allow custom CMAKE_PREFIX_PATH entries#32547
becker33 merged 6 commits intospack:developfrom
scheibelp:bugfix/cmake-prefix-path-option

Conversation

@scheibelp
Copy link
Copy Markdown
Member

@scheibelp scheibelp commented Sep 7, 2022

Closes #31631

Users can update the CMAKE_PREFIX_PATH environment variable in setup_dependent_build_environment. However, CMakePackage passes a CMAKE_PREFIX_PATH option to cmake that does not account for these changes; the option overrides the environment variable.

#31631 reorganizes the code to make use of this, but reuses functions that are not necessarily idempotent.

This PR allows a package to define a cmake_search_paths attribute, which is then included in the CMAKE_PREFIX_PATH option to cmake.

Note: this PR also retains the existing modifications to the CMAKE_PREFIX_PATH environment variable in build_environment.py because not all CMake-dependent packages inherit from CMakePackage.

…to the CMAKE_PREFIX_PATH option of the cmake invocation (via CMakePackage)
@spackbot-app spackbot-app bot added build-environment core PR affects Spack core functionality update-package labels Sep 7, 2022
@spackbot-app

This comment was marked as off-topic.

Copy link
Copy Markdown
Member

@becker33 becker33 left a comment

Choose a reason for hiding this comment

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

I think providing a default method on PackageBase will make this simpler.

@spackbot-app spackbot-app bot added dependencies new-version tests General test capability(ies) labels Sep 8, 2022
@scheibelp
Copy link
Copy Markdown
Member Author

@becker33 I have made the requested changes and added a test

@becker33 becker33 merged commit 02151ac into spack:develop Sep 8, 2022
@robertu94
Copy link
Copy Markdown
Contributor

@scheibelp and @becker33 thank you both for helping this get merged!

ma595 pushed a commit to ma595/spack that referenced this pull request Sep 13, 2022
* define `cmake_prefix_paths` property for packages

add to CMake arguments via CMakePackage

Co-authored-by: Robert Underwood <[email protected]>
robertu94 added a commit to robertu94/spack that referenced this pull request Oct 12, 2022
+ new package versions
+ found a dependency `dlib` that didn't correspond to the same `dlib`
  that libpressio-opt refers to.  Renamed the old package because it had
  way fewer users, and davisking/dlib hold the dlib name in Ubuntu,
  Fedora, Homebrew, Pip.  Discused with @adamjstewart who added the old
  dlib package, and he was okay with the replacement
+ added missing fix for CUB relating to spack#32547 needed for cuSZ to build
  using Spack.
robertu94 added a commit to robertu94/spack that referenced this pull request Oct 12, 2022
+ new package versions
+ found a dependency `dlib` that didn't correspond to the same `dlib`
  that libpressio-opt refers to.  Renamed the old package because it had
  way fewer users, and davisking/dlib hold the dlib name in Ubuntu,
  Fedora, Homebrew, Pip.  Discused with @adamjstewart who added the old
  dlib package, and he was okay with the replacement
+ added missing fix for CUB relating to spack#32547 needed for cuSZ to build
  using Spack.
robertu94 added a commit to robertu94/spack that referenced this pull request Oct 12, 2022
+ new package versions
+ found a dependency `dlib` that didn't correspond to the same `dlib`
  that libpressio-opt refers to.  Renamed the old package because it had
  way fewer users, and davisking/dlib hold the dlib name in Ubuntu,
  Fedora, Homebrew, Pip.  Discused with @adamjstewart who added the old
  dlib package, and he was okay with the replacement
+ added missing fix for CUB relating to spack#32547 needed for cuSZ to build
  using Spack.
robertu94 added a commit to robertu94/spack that referenced this pull request Oct 12, 2022
+ new package versions
+ found a dependency `dlib` that didn't correspond to the same `dlib`
  that libpressio-opt refers to.  Renamed the old package because it had
  way fewer users, and davisking/dlib hold the dlib name in Ubuntu,
  Fedora, Homebrew, Pip.  Discused with @adamjstewart who added the old
  dlib package, and he was okay with the replacement
+ added missing fix for CUB relating to spack#32547 needed for cuSZ to build
  using Spack.
robertu94 added a commit to robertu94/spack that referenced this pull request Oct 12, 2022
+ new package versions
+ found a dependency `dlib` that didn't correspond to the same `dlib`
  that libpressio-opt refers to.  Renamed the old package because it had
  way fewer users, and davisking/dlib hold the dlib name in Ubuntu,
  Fedora, Homebrew, Pip.  Discused with @adamjstewart who added the old
  dlib package, and he was okay with the replacement
+ added missing fix for CUB relating to spack#32547 needed for cuSZ to build
  using Spack.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-environment core PR affects Spack core functionality dependencies new-version tests General test capability(ies) update-package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants