Closed mwaxmonsky closed 2 months ago
Closing this as this is not possible at this time.
Currently, the CMake documentation states to not use this to load build time requirements (https://cmake.org/cmake/help/latest/module/FindEnvModules.html). After some testing, there is the ability to add the module load/unload ...
commands to the ALL
target that will be called before each target during the make ...
phase, but this has two problems:
1) Each target Makefile
is hardcoded to use /bin/sh
(https://github.com/Kitware/CMake/blob/de8911120eea6aa8df5e156bce2643c819e7c10f/Source/cmLocalUnixMakefileGenerator3.cxx#L658) which does not throw an error when calling . /path/to/lmod/init/sh
but does throw an error when calling module load ...
saying module
command not found.
2) Even if we could migrate to setting /bin/bash
in the Makefile
's, each target is made in a unique shell session and the Makefiles would have to be modified to share environments so the module load ...
's could be propagated through the targets which is non-trivial and would require manual changes to Makefiles after the configure step if it's possible at all.
Adds preset file and now to target derecho a100 gpu, we can simply run
cmake --preset=derecho-gpu
with the following output: