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

Set LD_LIBRARY_PATH and ROOT_INCLUDE_PATH within CheckClassVersion #15

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

knoepfel
Copy link
Collaborator

In a Spack user environment, LD_LIBRARY_PATH and ROOT_INCLUDE_PATH are not fully populated (or even available). This PR populates the environment variables as part of the add_custom_command(...) invocation.

@knoepfel knoepfel requested a review from greenc-FNAL November 15, 2023 17:39
Copy link
Member

@greenc-FNAL greenc-FNAL left a comment

Choose a reason for hiding this comment

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

Have you verified that the $<GENEX_EVAL:...> wrapper is necessary? I'm never quite sure.

@knoepfel
Copy link
Collaborator Author

Have you verified that the $<GENEX_EVAL:...> wrapper is necessary? I'm never quite sure.

Somehow I had convinced myself that it was necessary. I've removed the wrapper and the behavior is the same, and the code easier to read.

@greenc-FNAL greenc-FNAL merged commit 45eca9c into develop Nov 15, 2023
2 checks passed
greenc-FNAL added a commit that referenced this pull request Nov 17, 2023
…rsion (#15)"

Reverted pending investigation of CI failures.

This reverts commit 45eca9c.
@knoepfel knoepfel deleted the fix-check-class-version branch November 27, 2023 15:38
knoepfel added a commit to knoepfel/cetmodules that referenced this pull request Nov 27, 2023
greenc-FNAL added a commit that referenced this pull request Nov 27, 2023
* Reapply "Set LD_LIBRARY_PATH and ROOT_INCLUDE_PATH within CheckClassVersion (#15)"

This reverts commit edc0b1d.

* Preserve existing LD_LIBRARY_PATH entries.

* Use simpler string concatenation.

Co-authored-by: Chris Green <[email protected]>

* Accommodate macOS systems.

* Correctly account for macOS systems.

---------

Co-authored-by: Chris Green <[email protected]>
greenc-FNAL added a commit that referenced this pull request Jan 3, 2024
* During the Perl bootstrap stage of `setup_for_development`, `STDERR`
  and `STDOUT` are now both redirected to `bootstrap.log`.

* Many, many improvements to documentation generation, format and
  content: see https://fnalssi.github.io/cetmodules/ and
  https://fnalssi.github.io/cetmodules/latest/.

* Update `pmm.cmake`.

* Update BSD 3-clause license to a conforming copy to aid detection by
  GitHub.

* Proper support for `USE_PROJECT_NAME` in `basic_plugin()` for
  consistency with other functions.

* `cet_copy()` improvements:

  * New options `NO_ALL` and `TARGET_VAR`.

  * Detect use of single-source options (`NAME`, `NAME_AS_TARGET` and
    `TARGET_VAR` with multiple sources.

  * Make behavior of relative `DESTINATION` values conform to intent and
    documentation (relative to `${CMAKE_CURRENT_BINARY_DIR}` _vs_
    `${CMAKE_CURRENT_SOURCE_DIR}`.

* New CMake find module `FindM4.cmake`.

* `cet_make_library()` improvements:

  * Handle explicitly-scoped aliases.

  * `STRIP_LIBS` is incompatible with `INTERFACE` libraries.

* New function `cet_finalize()` to replace
  `cet_cmake_config(NO_CMAKE_CONFIG)`.

* Minor improvement to format of `warn_deprecated()` messages.

* `build_dictionary()` improvements:

  * Remove vestigial `REQUIRED_DICTIONARIES` option (also from
    `check_class_version()`).

  * `genreflex` -> `rootcling --reflex`

  * Allow for increased diagnostics from `rootcling` via `VERBOSE` or
    `VERBOSITY <n>` options.

  * Separate the internal concepts of `dictname` and `LIB_TARGET` to
    allow for better handling of `NO_LIBRARY`—especially where multiple
    generated dictionary sources might be added to the same external
    library target.

  * Generated source (whose name may now be specified with
    `GENERATED_SOURCE_FILENAME`) is added to the library target as a
    separate `target_sources()` call to account for `NO_LBIRARY`.

  * Allow for specification of the library target via `LIB_TARGET`, and
    return of a calculated library target name via `LIB_TARGET_VAR`.

  * Simplify `_generate_dictionary()` signature by relying on information
    inherited from `build_dictionary()`.

  * Relocate macOS `.rootmap` fix for older ROOT to ensure it is added
    at the appropriate time, and when (and only when) necessary.

  * Preliminary work to add PCM dictionary capability.

  * Generate late-executing targets to handle the concatenation of
    multiple `module.modulemap` files with the same `INSTALL`
    destination (which destination may be specified via
    `MODULEMAP_INSTALL_DIR`).

  * Support "traditional" (not `genreflex`) dictionary generation: specify
    headers and Linkdef.h via the `SOURCE` option. This is significantly
    more powerful than the—now deprecated—`cet_rootcint()` function because
    `build_dictionary()` leverages target properties to e.g. ensure
    invocation of `rootcling` with C-preprocessor definitions compatible
    with those configured for compilation.

  * Summary of new flags/options:

    * `GENERATED_SOURCE_FILENAME <filename>`

    * `LIB_TARGET <target>`

    * `MODULEMAP_INSTALL_DIR <dir>`

    * `SOURCE <source> ...`

    * `VERBOSE`

    * `VERBOSITY <n>`

* Source of deprecated `cet_make()` function relocated to
  `compat/CetMakeCommand.cmake`.

* `libexec/filter-output` -> `bin/` with link for backward
  compatibility.

* `Modules/CetExclude.cmake` -> `Modules/private/`.

* `cet_installed_path()` improvements:

  * Fix variable handling.

  * `BASE_SUBDIR` is now prepended to `<out-var>` as originally intended.

  * `BASE_SUBDIR` is no longer removed from `PATH`: this was due to
    faulty reasoning about the use cases for `cet_installed_path()`.

  * Detect failure to calculate relative install path.

* `cet_make_completions()` improvements:

  * [PR #12](#12):

    * More careful handling of target exec and derivatives.

    * Handle multiple user completion files.

  * [PR #10](#10): really
    prevent cycles in `cet_process_liblist()`

* Deprecate `cet_rootcint()` in favor of `build_dictionary()`.

* Update `ParseAndAddCatchTests.cmake` w.r. upstream.

* `parse_version_string()`: new options `INPUT_PREAMBLE` and `VERSION`.

* Improve version search in `FindSmc.cmake`.

* `process_smc()` improvements:

  * New option `NO_INSTALL_SOURCE`.

  * Requirement on `Smc` should not be transitive.

* In `CetTest.cmake`:

  * New functions `cet_test_env_prepend()` and `cet_test_env_mod()`
    ([PR #14](#14)).

  * `cet_test()` improvements:

    * Allow target names with `REF` ([PR #13](#13)).

    * Improve detection of cycles when expanding target names.

    * Rework `COMPILE_ONLY` tests to be built as separate projects to
      allow parallel execution.

* `install_scripts()`: follow: intent and documentation by defaulting to
  `SCRIPTS_DIR` instead of `BIN_DIR`.

* `cet_build_plugin()` improvements:

  * Consider `${${BASE}_builder}` first when looking for plugin
    builders.

  * Resolve variable interpolation issue.

* `check_class_version()` improvements:

  * Set `LD_LIBRARY_PATH` and `ROOT_INCLUDE_PATH`
    ([PR #15](#15)).

  * Preserve existing `LD_LIBRARY_PATH` entries and accommodate
    macOS ([PR #16](#16)).

* Ensure `cet_catch2_main.cpp` is available prior to installation.
greenc-FNAL added a commit that referenced this pull request Jan 3, 2024
Cetmodules 3.23.00

* During the Perl bootstrap stage of `setup_for_development`, `STDERR`
  and `STDOUT` are now both redirected to `bootstrap.log`.

* Many, many improvements to documentation generation, format and
  content: see https://fnalssi.github.io/cetmodules/ and
  https://fnalssi.github.io/cetmodules/latest/.

* Update `pmm.cmake`.

* Update BSD 3-clause license to a conforming copy to aid detection by
  GitHub.

* Proper support for `USE_PROJECT_NAME` in `basic_plugin()` for
  consistency with other functions.

* `cet_copy()` improvements:

  * New options `NO_ALL` and `TARGET_VAR`.

  * Detect use of single-source options (`NAME`, `NAME_AS_TARGET` and
    `TARGET_VAR` with multiple sources.

  * Make behavior of relative `DESTINATION` values conform to intent and
    documentation (relative to `${CMAKE_CURRENT_BINARY_DIR}` _vs_
    `${CMAKE_CURRENT_SOURCE_DIR}`.

* New CMake find module `FindM4.cmake`.

* `cet_make_library()` improvements:

  * Handle explicitly-scoped aliases.

  * `STRIP_LIBS` is incompatible with `INTERFACE` libraries.

* New function `cet_finalize()` to replace
  `cet_cmake_config(NO_CMAKE_CONFIG)`.

* Minor improvement to format of `warn_deprecated()` messages.

* `build_dictionary()` improvements:

  * Remove vestigial `REQUIRED_DICTIONARIES` option (also from
    `check_class_version()`).

  * `genreflex` -> `rootcling --reflex`

  * Allow for increased diagnostics from `rootcling` via `VERBOSE` or
    `VERBOSITY <n>` options.

  * Separate the internal concepts of `dictname` and `LIB_TARGET` to
    allow for better handling of `NO_LIBRARY`—especially where multiple
    generated dictionary sources might be added to the same external
    library target.

  * Generated source (whose name may now be specified with
    `GENERATED_SOURCE_FILENAME`) is added to the library target as a
    separate `target_sources()` call to account for `NO_LBIRARY`.

  * Allow for specification of the library target via `LIB_TARGET`, and
    return of a calculated library target name via `LIB_TARGET_VAR`.

  * Simplify `_generate_dictionary()` signature by relying on information
    inherited from `build_dictionary()`.

  * Relocate macOS `.rootmap` fix for older ROOT to ensure it is added
    at the appropriate time, and when (and only when) necessary.

  * Preliminary work to add PCM dictionary capability.

  * Generate late-executing targets to handle the concatenation of
    multiple `module.modulemap` files with the same `INSTALL`
    destination (which destination may be specified via
    `MODULEMAP_INSTALL_DIR`).

  * Support "traditional" (not `genreflex`) dictionary generation: specify
    headers and Linkdef.h via the `SOURCE` option. This is significantly
    more powerful than the—now deprecated—`cet_rootcint()` function because
    `build_dictionary()` leverages target properties to e.g. ensure
    invocation of `rootcling` with C-preprocessor definitions compatible
    with those configured for compilation.

  * Summary of new flags/options:

    * `GENERATED_SOURCE_FILENAME <filename>`

    * `LIB_TARGET <target>`

    * `MODULEMAP_INSTALL_DIR <dir>`

    * `SOURCE <source> ...`

    * `VERBOSE`

    * `VERBOSITY <n>`

* Source of deprecated `cet_make()` function relocated to
  `compat/CetMakeCommand.cmake`.

* `libexec/filter-output` -> `bin/` with link for backward
  compatibility.

* `Modules/CetExclude.cmake` -> `Modules/private/`.

* `cet_installed_path()` improvements:

  * Fix variable handling.

  * `BASE_SUBDIR` is now prepended to `<out-var>` as originally intended.

  * `BASE_SUBDIR` is no longer removed from `PATH`: this was due to
    faulty reasoning about the use cases for `cet_installed_path()`.

  * Detect failure to calculate relative install path.

* `cet_make_completions()` improvements:

  * [PR #12](#12):

    * More careful handling of target exec and derivatives.

    * Handle multiple user completion files.

  * [PR #10](#10): really
    prevent cycles in `cet_process_liblist()`

* Deprecate `cet_rootcint()` in favor of `build_dictionary()`.

* Update `ParseAndAddCatchTests.cmake` w.r. upstream.

* `parse_version_string()`: new options `INPUT_PREAMBLE` and `VERSION`.

* Improve version search in `FindSmc.cmake`.

* `process_smc()` improvements:

  * New option `NO_INSTALL_SOURCE`.

  * Requirement on `Smc` should not be transitive.

* In `CetTest.cmake`:

  * New functions `cet_test_env_prepend()` and `cet_test_env_mod()`
    ([PR #14](#14)).

  * `cet_test()` improvements:

    * Allow target names with `REF` ([PR #13](#13)).

    * Improve detection of cycles when expanding target names.

    * Rework `COMPILE_ONLY` tests to be built as separate projects to
      allow parallel execution.

* `install_scripts()`: follow: intent and documentation by defaulting to
  `SCRIPTS_DIR` instead of `BIN_DIR`.

* `cet_build_plugin()` improvements:

  * Consider `${${BASE}_builder}` first when looking for plugin
    builders.

  * Resolve variable interpolation issue.

* `check_class_version()` improvements:

  * Set `LD_LIBRARY_PATH` and `ROOT_INCLUDE_PATH`
    ([PR #15](#15)).

  * Preserve existing `LD_LIBRARY_PATH` entries and accommodate
    macOS ([PR #16](#16)).

* Ensure `cet_catch2_main.cpp` is available prior to installation.
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