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

ATDM: Simplify finding and using TrilinosConfig.cmake (#7125) #7126

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions cmake/std/atdm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,10 @@ $ source <install-prefix>/load_matching_env.sh

Sourcing this file loads the compilers, MPI, and TPLs and sets up the various
`ATDM_CONG_` environment variables described above. It also sets the
environment variable:

```
$ export ATDM_TRILINOS_INSTALL_PREFIX=<install-prefix>
```

that clients can use to point back to the Trilinos installation directory.
environment variable `export Trilinos_ROOT=<install-prefix>` that clients can
use to point back to the Trilinos installation directory. Also, this variable
will allow `find_package(Trilinos)` to automatically find the right Trilinos
installation with no further action.

The install location `<install-prefix>` can be set using the CMake cache
variable:
Expand All @@ -354,29 +351,23 @@ or by setting the environment variable:
$ export ATDM_CONFIG_TRIL_CMAKE_INSTALL_PREFIX=<install-prefix>
```

when configuring Trilinos.

If the environment variable `ATDM_CONFIG_TRIL_CMAKE_INSTALL_PREFIX` is set,
then it will be used to set `CMAKE_INSTALL_PREFIX` internally and override any
value that might be passed in or set otherwise. (This is a `FORCE`D cache
variable set on `CMAKE_INSTALL_PREFIX` so this value will appear in the
`CMakeCache.txt` file.)

The name of the installed script `load_matching_env.sh` and the environment
variable `ATDM_TRILINOS_INSTALL_PREFIX` that it exports can be changed at
configure-time using the CMake cache variables:
The name of the installed script `load_matching_env.sh` can be changed at
configure-time using the CMake cache variable:

```
-D ATDM_INSTALLED_ENV_LOAD_SCRIPT_NAME=<load-matching-env-sh> \
-D ATDM_TRILINOS_INSTALL_PREFIX_ENV_VAR_NAME=<trilinos-install-prefix-var-name> \
```

where

* If the CMake cache variable `ATDM_INSTALLED_ENV_LOAD_SCRIPT_NAME` is not
specified, then it is given the name `load_matching_env.sh` by default.

* If the CMake cache variable `ATDM_TRILINOS_INSTALL_PREFIX_ENV_VAR_NAME` is
not specified, then it is given the name `ATDM_TRILINOS_INSTALL_PREFIX` by
default.
whereif the CMake cache variable `ATDM_INSTALLED_ENV_LOAD_SCRIPT_NAME` is not
specified, then it is given the name `load_matching_env.sh` by default.


## Parallel build and test processes
Expand Down
5 changes: 4 additions & 1 deletion cmake/std/atdm/utils/load_matching_env.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@

source @ATDM_CONFIG_SCRIPTS_INSTALL_DIR@/load-env.sh @ATDM_BUILD_NAME@ @ATDM_CUSTOM_CONFIG_DIR_ARG@

export @ATDM_TRILINOS_INSTALL_PREFIX_ENV_VAR_NAME@=@CMAKE_INSTALL_PREFIX@
export Trilinos_ROOT=@CMAKE_INSTALL_PREFIX@
export PATH=@CMAKE_INSTALL_PREFIX@/bin:${PATH}

# WARNING: This is deprecated. Use Trilinos_ROOT instead!
export @ATDM_TRILINOS_INSTALL_PREFIX_ENV_VAR_NAME@=@CMAKE_INSTALL_PREFIX@