Skip to content

Commit

Permalink
ATDM: Add Trilinos_ROOT to load_matching_env.sh (#7125)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlettroscoe committed Apr 8, 2020
1 parent 3cb3a8b commit 890cd44
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
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@

0 comments on commit 890cd44

Please sign in to comment.