Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / docs / source / Start_your_own_project.rst
index cb70ef0..68e70e9 100644 (file)
@@ -24,12 +24,13 @@ to the template itself.
 Building your project with CMake
 --------------------------------
 
 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
 
 
 .. code-block:: cmake
 
-   cmake_minimum_required(VERSION 2.8.8)
+   cmake_minimum_required(VERSION 2.8.12)
    project(MyFirstSimulator)
 
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
    project(MyFirstSimulator)
 
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
@@ -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
 
 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
 
 
 .. 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
 
 
 Building your project with Makefile
@@ -127,27 +130,6 @@ in the CDT GCC Built-in compiler settings.
 .. image:: /img/eclipseScreenShot.png
    :align: center
 
 .. image:: /img/eclipseScreenShot.png
    :align: center
 
-
-Building the Java examples in Eclipse
--------------------------------------
-
-If you want to build our Java examples in Eclipse, get the whole
-source code and open the archive on your disk. In Eclipse, select
-the menu "File / Import", and then in the wizard "General / Existing
-Project into Workspace". On the next page, select the directory
-"examples/deprecated/java" that you can find in the SimGrid source tree as a root
-directory and finish the creation.
-
-The file ``simgrid.jar`` must be in the root directory of the SimGrid
-tree. That's where it is built by default, but if you don't want to
-compile it yourself, just grab that file from the SimGrid website and
-copy it in here.
-
-Please note that once you better understand SimGrid, you should not
-modify the examples directly but instead create your own project in
-eclipse. This will make it easier to upgrade to another version of
-SimGrid.
-
 .. _install_yours_troubleshooting:
 
 Troubleshooting your Project Setup
 .. _install_yours_troubleshooting:
 
 Troubleshooting your Project Setup
@@ -178,7 +160,6 @@ Many undefined references
 .. code-block:: console
 
   masterworker.c:209: undefined reference to `sg_version_check'
 .. code-block:: console
 
   masterworker.c:209: undefined reference to `sg_version_check'
-  masterworker.c:209: undefined reference to `MSG_init_nocheck'
   (and many other undefined references)
 
 This happens when the linker tries to use the wrong library. Use
   (and many other undefined references)
 
 This happens when the linker tries to use the wrong library. Use