[CMake] MPI Module

Robert Kubrick robertkubrick at gmail.com
Mon Sep 8 16:40:57 EDT 2008


I'm having some problems with the MPI module:

#
# MPI
#
FIND_PACKAGE(MPI REQUIRED)
INCLUDE(CMakeForceCompiler)
CMAKE_FORCE_CXX_COMPILER(mpicxx "MPI C++ Compiler")

The code above works. It invokes the mpicc wrapper to compile my MPI  
project. However I figured there must be a simpler way to run mpicc  
without using the ForceCompiler module? If I don't force the  
compiler, the generated makefile invokes my default compiler, g++.

Also I want to add some options to the wrapper. This doesn't work:

SET(MPI_COMPILE_FLAGS -mpe=mpianim)

How can I run 'mpicxx -mpe-mpianim'?


More information about the CMake mailing list