[CMake] "find_package(MPI)" overriding "set(MPIEXEC)" in CmakeList.txt

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Fri Jan 10 06:33:31 EST 2014


Hi,

Did Den 09. jan. 2014 22:49, skrev Pettey . Lucas:
> Hello,
>
> On a Cray XE6, I am using find_package(MPI REQUIRED) in my CMakeLists.txt. It correctly finds all of the MPI stuff, except that it sets the MPIEXEC to the login node mpiexec command. I would like to override this behavior and set the MPIEXEC command to the "aprun" wrapper, but it is not working. I have tried using set(MPIEXEC "aprun") both before and after the find_package(MPI REQUIRED) in my CMakeLists.txt.
>
> Thanks
> Lucas

Hi,

Did you try to use find_program? I think this will "override" the
find_program inside FindMPI.cmake:

find_program(MPIEXEC aprun)
find_package(MPI REQUIRED)
message("MPI exec: ${MPIEXEC}")

Cheers,
Yngve




More information about the CMake mailing list