From 36244692fd0e4d40b0d55a7cb90f6e6e68514e22 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 5 Feb 2018 08:09:47 -0600 Subject: [PATCH] Use mpicc and mpicxx for MPI configurations --- docs/source/usersguide/install.rst | 13 +++++++------ tools/ci/travis-install.py | 4 +++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index 48188928cf..638d425014 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -263,14 +263,15 @@ should be used: Compiling with MPI ++++++++++++++++++ -To compile with MPI, set the :envvar:`FC` and :envvar:`CC` environment variables -to the path to the MPI Fortran and C wrappers, respectively. For example, in a -bash shell: +To compile with MPI, set the :envvar:`FC`, :envvar:`CC`, and :envvar:`CXX` +environment variables to the path to the MPI Fortran, C, and C++ wrappers, +respectively. For example, in a bash shell: .. code-block:: sh - export FC=mpif90 + export FC=mpifort export CC=mpicc + export CXX=mpicxx cmake /path/to/openmc Note that in many shells, environment variables can be set for a single command, @@ -278,7 +279,7 @@ i.e. .. code-block:: sh - FC=mpif90 CC=mpicc cmake /path/to/openmc + FC=mpifort CC=mpicc CXX=mpicxx cmake /path/to/openmc Selecting HDF5 Installation +++++++++++++++++++++++++++ @@ -354,7 +355,7 @@ follows: .. code-block:: sh mkdir build && cd build - FC=ifort CC=icc FFLAGS=-mmic cmake -Dopenmp=on .. + FC=ifort CC=icc CXX=icpc FFLAGS=-mmic cmake -Dopenmp=on .. make Note that unless an HDF5 build for the Intel Xeon Phi (Knights Corner) is diff --git a/tools/ci/travis-install.py b/tools/ci/travis-install.py index bd7f886dbc..15e4d576b7 100644 --- a/tools/ci/travis-install.py +++ b/tools/ci/travis-install.py @@ -33,9 +33,11 @@ def install(omp=False, mpi=False, phdf5=False): if not omp: cmake_cmd.append('-Dopenmp=off') - # For MPI, we just need to change the Fortran compiler + # Use MPI wrappers when building in parallel if mpi: os.environ['FC'] = 'mpifort' if which('mpifort') else 'mpif90' + os.environ['CC'] = 'mpicc' + os.environ['CXX'] = 'mpicxx' # Tell CMake to prefer parallel HDF5 if specified if phdf5: