Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
docs: tiny improvement about cmake+SMPI in user code
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 2 Oct 2022 21:39:59 +0000 (23:39 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 2 Oct 2022 21:48:38 +0000 (23:48 +0200)
docs/source/Start_your_own_project.rst

index cb70ef0..4fa7172 100644 (file)
@@ -24,8 +24,9 @@ to the template itself.
 Building your project with CMake
 --------------------------------
 
-Here is a `CMakeLists.txt` that you can use as a starting point for
-your project. It builds two simulators from a given set of source files.
+Here is a `CMakeLists.txt` that you can use as a starting point for your S4U
+project (see below for MPI projects). It builds two simulators from a given set
+of source files.
 
 .. code-block:: cmake
 
@@ -59,11 +60,13 @@ also refer to the file header for more information.
 
 MPI projects should include ``find_package (MPI)`` in CMakeLists.txt. Then, the
 variables ``MPI_C_COMPILER``, ``MPI_CXX_COMPILER``, and ``MPI_Fortran_COMPILER`` should
-point to the full path of smpicc, smpicxx, and smpiff respectively. Example:
+point to the full path of smpicc, smpicxx, and smpiff respectively.
+It is however not advised to set these variables from the CMakeLists.txt file directly.
+In addition, you may need to set ``SMPI_PRETEND_CC=1`` to please cmake when it tests the compiler.
 
 .. code-block:: console
 
-   $ cmake -DMPI_C_COMPILER=/opt/simgrid/bin/smpicc -DMPI_CXX_COMPILER=/opt/simgrid/bin/smpicxx -DMPI_Fortran_COMPILER=/opt/simgrid/bin/smpiff .
+   $ SMPI_PRETEND_CC=1 cmake -DMPI_C_COMPILER=/opt/simgrid/bin/smpicc -DMPI_CXX_COMPILER=/opt/simgrid/bin/smpicxx -DMPI_Fortran_COMPILER=/opt/simgrid/bin/smpiff .
 
 
 Building your project with Makefile