[CMake] MPI Module

Alexander Neundorf a.neundorf-work at gmx.net
Mon Sep 8 17:08:22 EDT 2008


On Monday 08 September 2008, Robert Kubrick wrote:
> 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++.

You can set the CC and CXX environment variables before running cmake to the 
mpi variant. 
Does this work for you ?

Alex


More information about the CMake mailing list