Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / doc / doxygen / install.doc
index cf3c3eb..17922db 100644 (file)
-/*!
-@page install Installing Simgrid
+/*! @page install Installing Simgrid
 
 @tableofcontents
 
-The easiest way to install SimGrid is to go for a binary package.
-Under Debian or Ubuntu, this is very easy as SimGrid is directly
-integrated to the official repositories. Under Windows, SimGrid can be
-installed in a few clicks once you downloaded the installer from
-gforge. If you just want to use Java, simply copy the jar file on your
-disk and you're set.
-
-Recompiling an official archive is not much more complex, actually.
-SimGrid has very few dependencies and rely only on very standard
-tools.  First, download the *@SimGridRelease.tar.gz* archive
-from [the download page](https://gforge.inria.fr/frs/?group_id=12).
-Then, recompiling the archive should be done in a few lines:
+SimGrid should work out of the box on Linux, Mac OSX, FreeBSD, and Windows (under windows, only the Java interfaces are
+available at the moment).
 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.sh}
-tar xf @SimGridRelease.tar.gz
-cd @SimGridRelease
-cmake -DCMAKE_INSTALL_PREFIX=/opt/simgrid .
-make
-make install
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If you want to stay on the bleeding edge, you should get the latest
-git version, and recompile it as you would do for an official archive.
-Depending on the files you change in the source tree, some extra
-tools may be needed.
+The easiest way to install SimGrid is to go for a @ref install_binary "binary package". Under Debian or Ubuntu, this is 
+very easy as SimGrid is directly integrated to the official repositories. For other Linux variants, you probably want 
+to go for a @ref install_src "source install". Please contact us if you want to contribute the build scripts for your 
+preferred distribution. If you just want to use @ref install_binary_java "Java", simply copy the jar file on your disk 
+and you're set.
 
 @section install_binary Installing a binary package
 
 @subsection install_binary_linux Binary packages for linux
 
-Most of the developers use a Debian or Ubuntu system, and some of us
-happen to be Debian Maintainers, so the packages for these systems are
-well integrated with these systems and very up-to-date. To install them,
-simply type:
+Most of the developers use a Debian or Ubuntu system, and some of us happen to be Debian Maintainers, so the packages 
+for these systems are well integrated with these systems and very up-to-date. To install them, simply type:
 
 @verbatim
 apt-get install simgrid
 @endverbatim
 
-On other Linux variants, you probably want to go for a source install.
-Please contact us if you want to contribute the build scripts for your
-preferred distribution.
-
-@subsection install_binary_win Installation wizard for Windows
-
-Before starting the installation, make sure that you have the following dependencies:
-  @li cmake 2.8 <a href="http://www.cmake.org/cmake/resources/software.html">(download page)</a>
-  @li MinGW <a href="http://sourceforge.net/projects/mingw/files/MinGW/">(download page)</a>
-  @li perl <a href="http://www.activestate.com/activeperl/downloads">(download page)</a>
-  @li git <a href="http://msysgit.googlecode.com/files/Git-1.7.4-preview20110204.exe">(download page)</a>
-
-Then download the package <a href="https://gforge.inria.fr/frs/?group_id=12">SimGrid Installer</a>,
-execute it and follow instructions.
+@subsection install_binary_java Using the binary jar file
 
-@image html win_install_01.png Step 1: Accept the license.
-@image html win_install_02.png Step 2: Select packets to install.
-@image html win_install_03.png Step 3: Choice where to install packets previously selected. Please don't use spaces in path.
-@image html win_install_04.png Step 4: Add CLASSPATH to environment variables.
-@image html win_install_05.png Step 5: Add PATH to environment variables.
-@image html win_install_06.png Step 6: Restart your computer to take in consideration environment variables.
+The easiest way to install the Java bindings of SimGrid is to grab the jar file from the 
+[download page](https://gforge.inria.fr/frs/?group_id=12) and copy it in your classpath (typically, in the same 
+directory as your source code). If you go for that version, there is no need to install the C library as it is already 
+bundled within the jar file. Actually, only a bunch of architectures are supported this way to keep the jar file size 
+under control and because we don't have access to every exotic architectures ourselves.
 
-@subsection install_binary_java Using the binary jar file
+If the jarfile fails on you, complaining that your architecture is not supported, drop us an email on 
+<mailto:simgrid-devel@lists.gforge.inria.fr>. We may extend the jarfile for you, provided we have access to this 
+particular architecture to build SimGrid on it.
 
-The easiest way to install the Java bindings of SimGrid is to grab the
-jar file from the
-<a href="https://gforge.inria.fr/frs/?group_id=12">Download page</a>,
-and copy it in your classpath (typically, in the same directory than
-your source code). If you go for that version, there is no need to
-install the C library as it is bundled within the jar file. Actually,
-only a bunch of architectures are supported this way to keep the
-jar file size under control and because we don't have access to every
-exotic architectures ourselves.
+If the error message is about the boost-context library, then you should install that library on your machine. This is 
+a known issue in the 3.12 release that will be fixed in the next release.
 
-If the jarfile fails on you, complaining that your architecture is not
-supported, drop us an email: we may extend the jarfile for you, if we
-have access to your architecture to build SimGrid on it.
+You can retrieve a nightly build of the jar file from our autobuilders. 
+For Windows, head to [AppVeyor](https://ci.appveyor.com/project/mquinson/simgrid).
+Click on the artefact link on the right, and grab your file. If the latest build failed, there will be no artefact. Then
+you will need to first click on "History" on the top and search for the last successful build.
+For non-Windows systems (Linux, Mac or FreeBSD), head to [Jenkins](https://ci.inria.fr/simgrid/job/SimGrid-Multi).
+In the build history, pick the last green (or at least yellow) build that is not blinking (i.e., not currently under 
+build). In the list, pick a system that is close to yours, and click on the ball in the Debug row. The build artefact 
+will appear on the top of the resulting page.
 
 @section install_src Installing from source
 
 @subsection install_src_deps Resolving the dependencies
 
-SimGrid only uses very standard tools:
+Recompiling an official archive is not much more complex. SimGrid only uses very standard tools:
   - C compiler, C++ compiler, make and friends.
   - perl (but you may try to go without it)
   - We use cmake to configure our compilation
-      (<a href="http://www.cmake.org/cmake/resources/software.html">download page</a>).
-      You need cmake version 2.8 or higher. You may want to use ccmake
+      ([download page](http://www.cmake.org/cmake/resources/software.html)).
+      You need cmake version 2.8.8 or higher. You may want to use ccmake
       for a graphical interface over cmake.
   - LibBoost:
-    - osX: with <a href="http://www.finkproject.org/">fink</a>: `sudo fink install boost1.53.nopython`
-    - debian: `apt-get install libboost-dev`
-
-On MacOSX, it is advised to use the clang compiler (version 3.0 or
-higher), from either MacPort or XCode. If you insist on using gcc on
-this system, you still need a recent version of this compiler, so you
-need an unofficial gcc47 from MacPort because the version provided by
-Apple is ways to ancient to suffice. See also @ref install_cmake_mac.
-
-On Windows, it is strongly advised to use the
-<a href="http://sourceforge.net/projects/mingw/files/MinGW/">MinGW
-environment</a> to build SimGrid, with <a href="http://www.mingw.org/wiki/MSYS">
-MSYS tools</a> installed. Any other compilers are not tested
-(and thus probably broken). We usually use the
-<a href="http://www.activestate.com/activeperl/downloads">activestate</a>
-version of Perl, and the
-<a href="http://msysgit.googlecode.com/files/Git-1.7.4-preview20110204.exe">msys</a>
-version of git on this architecture, but YMMV. See also @ref install_cmake_win.
+    - osX: with [fink](http://www.finkproject.org/): `fink install boost1.53.nopython`,
+      or with homebrew: `brew install boost`
+    - debian/ubuntu: `apt-get install libboost-dev libboost-context-dev`
+  - Java (only needed if you want to use the Java bindings): Grab a
+    [full JDK](http://www.oracle.com/technetwork/java/javase/downloads)
+
+For platform specific details, please see  @ref install_cmake_mac and @ref install_cmake_windows.
 
-@subsection install_src_fetch Retrieving the source
+@subsection install_src_fetch Getting the sources
 
-If you just want to use SimGrid, you should probably grab the latest
-stable version available from the
-<a href="https://gforge.inria.fr/frs/?group_id=12">download page</a>.
-We do our best to release soon and release often, but sometimes you
-need to install the developer version of SimGrid, directly from the
-git repository. Avoid the git version if you are not sure, as it may
-break on you, or even worse.
+You can download the *@SimGridRelease.tar.gz* archive from the 
+[download page](https://gforge.inria.fr/frs/?group_id=12).
+Then, recompiling the archive should be done in a few lines:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.sh}
+tar xf @SimGridRelease.tar.gz
+cd @SimGridRelease
+cmake -DCMAKE_INSTALL_PREFIX=/opt/simgrid .
+make
+make install
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you want to stay on the bleeding edge, you should get the latest git version, and recompile it as you would do for 
+an official archive. Depending on the files you change in the source tree, some extra tools may be needed.
 
 @verbatim
 git clone git://scm.gforge.inria.fr/simgrid/simgrid.git simgrid
@@ -127,35 +89,31 @@ git clone git://scm.gforge.inria.fr/simgrid/simgrid.git simgrid
 
 @subsection install_src_config Configuring the build
 
-Note that compile-time options are very different from @ref options
-"run-time options".
+Note that compile-time options are very different from @ref options "run-time options".
 
 \subsubsection install_cmake_howto Setting compilation options
 
-The default configuration should be ok for most usages, but if you
-need to change something, there is several ways to do so. First, you
-can use environment variables. For example, you can change the used
-compilers by issuing these commands before launching cmake:
+The default configuration should be fine for most usages, but if you need to change something, there are several ways 
+to do so. First, you can use environment variables. For example, you can change the compilers used by issuing these 
+commands before launching cmake:
 
 @verbatim
 export CC=gcc-4.7
 export CXX=g++-4.7
 @endverbatim
 
-Note that other variables are available, such as CFLAGS and CXXFLAGS to add
-options for respectively the C compiler and the C++ compiler.
+Note that other variables are available, such as CFLAGS and CXXFLAGS to add options respectively for the C and C++ 
+compilers.
 
-Another way to do so is to use the -D argument of cmake as follows.
-Note that the terminating dot is mandatory (see @ref
+Another way to do so is to use the -D argument of cmake as follows. Note that the terminating dot is mandatory (see @ref
 install_cmake_outsrc to understand its meaning).
 
 @verbatim
 cmake -DCC=clang -DCXX=clang++ .
 @endverbatim
 
-Finally, you can use a graphical interface such as ccmake to change
-these settings. Simply follow the instructions after starting the
-interface.
+Finally, you can use a graphical interface such as ccmake to change these settings. Simply follow the instructions after
+starting the interface.
 
 @verbatim
 ccmake .
@@ -163,92 +121,72 @@ ccmake .
 
 \subsubsection install_cmake_list SimGrid compilation options
 
-In addition to the classical cmake configuration variables, SimGrid
-accepts several options, as listed below.
-
-  @li <b>CMAKE_INSTALL_PREFIX</b> (path): Where to install SimGrid
-      (e.g. /usr/local or /opt).
-
-  @li <b>enable_compile_optimizations</b> (ON/OFF): request the
-      compiler to produce efficient code. You want to activate it,
-      unless you want to debug SimGrid itself (as efficient code may
-      be appear mangled to the debuggers).
-
-  @li <b>enable_debug</b> (ON/OFF): disable this if simulation speed
-      really matters to you. All log messages of gravity debug or
-      below will be discarded at compilation time. Since there is
-      quite a bunch of such log messages in SimGrid itself, this can
-      reveal faster than discarding them at runtime as usually. But of
-      course, it is then impossible to get any debug message from
-      SimGrid if something goes wrong.
-
-  @li <b>enable_model-checking</b> (ON/OFF): Only enable this if you
-      actually plan to use the model-checking aspect of SimGrid. This
-      mode of execution is still under heavy work, but it should be
-      rather usable now. Be <b>warned</b> that this option will hinder
-      your simulation speed even if you simulate without activating
-      the model-checker. We are working on improving this situation.
-
-  @li <b>enable_compile_warnings</b> (ON/OFF): request the compiler to
-      issue error message whenever the source code is not perfectly
-      clean. If you develop SimGrid itself, you must activate it to
-      ensure the code quality, but as a user, that option will only
-      bring you issues.
-
-  @li <b>enable_maintainer_mode</b> (ON/OFF): you only need to set
-      this option if you modify very specific parts of SimGrid itself
-      (the XML parsers and other related elements). Adds an extra
-      dependency on flex and flexml.
-
-  @li <b>enable_tracing</b> (ON/OFF): disable this if you have issues
-      with the tracing module. But this module is now very stable and
-      you really should try to enjoy this beauty.
-
-  @li <b>enable_smpi</b> (ON/OFF): disable this if you have issues
-      with the module allowing to run MPI code on top of SimGrid. This
-      module very stable, but if you really don't need it, you can
-      disable it.
-
-  @li <b>enable_mallocators</b> (ON/OFF): disable this when tracking
-      memory issues within SimGrid, or the caching mechanism used
-      internally will fool the debuggers.
-
-  @li <b>enable_jedule</b> (ON/OFF): enable this to get SimDag
-      producing traces that can then be visualized with the Jedule
-      external tool.
-
-  @li <b>enable_lua</b> (ON/OFF): enable this if you want to enjoy the
-      lua bindings of SimGrid. Adds an extra dependency on lua library
+In addition to the classical cmake configuration variables, SimGrid accepts several options, as listed below.
+
+  @li <b>CMAKE_INSTALL_PREFIX</b> (path): Where to install SimGrid (/opt/simgrid, /usr/local, or elsewhere).
+
+  @li <b>enable_compile_optimizations</b> (ON/OFF) to request the compiler to produce efficient code. You want to 
+      activate it, unless you plan to debug SimGrid itself. Indeed, efficient code may be appear mangled to debuggers.
+
+  @li <b>enable_compile_warnings</b> (ON/OFF) to request the compiler to issue error messages whenever the source code
+      is not perfectly clean. If you are a SimGrid developer, you have to activate this option to enforce the code 
+      quality. As a regular user, this option is likely to bring you issues only.
+
+  @li <b>enable_debug</b> (ON/OFF) allows to discard all log messages of gravity debug or below at compile time, if 
+      simulation speed matters. As there is quite a bunch of such log messages in SimGrid internals, this can reveal 
+      faster than discarding them at runtime as usual. However, it obviously becomes impossible to get any debug 
+      message from SimGrid if something goes wrong.
+
+  @li <b>enable_documentation</b> (ON/OFF) to generate the documentation pages.
+
+  @li <b>enable_java</b> (ON/OFF) to enjoy the java bindings of SimGrid.
+
+  @li <b>enable_jedule</b> (ON/OFF) to get SimDag producing execution traces that can then be visualized with the 
+      Jedule external tool.
+
+  @li <b>enable_lua</b> (ON/OFF) to enjoy the lua bindings of SimGrid. It adds an extra dependency on the lua library 
       and developer header files.
 
+  @li <b>enable_lib_in_jar</b> (ON/OFF) to XXX
+
+  @li <b>enable_lto</b> (ON/OFF) to XXX
+
+  @li <b>enable_maintainer_mode</b> (ON/OFF) is only needed if you plan to modify very specific parts of SimGrid
+      (e.g., the XML parsers and other related elements). Moreover, this adds an extra dependency on flex and flexml.
+
+  @li <b>enable_mallocators</b> (ON/OFF) has to be disabled when tracking memory issues within SimGrid, or the caching 
+      mechanism used internally will fool the debuggers.
+
+  @li <b>enable_model-checking</b> (ON/OFF) if you actually plan to use the model-checking feature of 
+      SimGrid. This execution mode is still under heavy work, but should be rather usable now. Be <b>warned</b> that 
+      this option will hinder simulation speed even if you simulate without activating the model-checker. We are 
+      working on improving this situation.
+
+  @li <b>enable_ns3</b> (ON/OFF) if you want to use ns-3. See section @ref pls_simgrid_configuration_ns3.
 
-  @li <b>enable_ns3</b> (ON/OFF): whether you want to use ns3.
-      See section @ref pls_simgrid_configuration_ns3.
-  @li <b>NS3_HINT</b> (path): Where to search for NS3 (eg /usr or /opt).
-  @li <b>enable_latency_bound_tracking</b> (ON/OFF): enable it if you
-      want to be warned when communications are limited by round trip
-      time while doing packet-level simulation.
-  @li <b>enable_documentation</b> (ON/OFF) : whether the documentation should be
-       generated during the compilation. Default is ON.
+  @li <b>enable_smpi</b> (ON/OFF) has to be disabled if you have issues with the module allowing to run MPI code on 
+      top of SimGrid. This module is very stable, but if you don't really need it, you can disable it safely.
+
+  @li <b>enable_smpi_ISP_testsuite</b> (ON/OFF) to XXX
+
+  @li <b>enable_smpi_MPICH3_testsuite</b> (ON/OFF) to XXX
 
 \subsubsection install_cmake_reset Resetting the compilation configuration
 
-If you need to empty the cache of values saved by cmake (either
-because you added a new library or because something seriously went
-wrong), you can simply delete the file CMakeCache.txt that is created
-at the root of the source tree. You may also want to edit this file
-directly in some circumstances.
+If you need to empty the cache of values saved by cmake (either because you added a new library or because something 
+seriously went wrong), you can simply delete the file CMakeCache.txt that is created at the root of the source tree. 
+You may also want to directly edit this file in some circumstances.
 
 \subsubsection install_cmake_outsrc Compiling into a separate directory
 
 By default, the files produced during the compilation are placed in
-the source directory. As the compilation generates a lot of files, it
-is advised to to put them all in a separate directory. It is then
+the source directory. As compilation generates a lot of files, it
+is advised to put them all in a separate directory. It is then
 easier to cleanup, and this allows to compile several configurations
 out of the same source tree. For that, simply enter the directory
 where you want the produced files to land, and invoke cmake (or
 ccmake) with the full path to the SimGrid source as last argument.
-This approach is called "compilation out of source tree".
+This approach is called "out-of-source-tree compilation".
 
 @verbatim
 mkdir build
@@ -257,19 +195,9 @@ cmake [options] ..
 make
 @endverbatim
 
-\subsubsection install_cmake_win Cmake on Windows (with MinGW + MSYS)
+\subsubsection install_cmake_mac Building on Mac OS X
 
-Cmake can produce several kind of of makefiles. Under Windows, it has
-no way of determining what kind you want to use, so you have to hint it:
-
-@verbatim
-cmake -G "MSYS Makefiles" (other options) .
-make
-@endverbatim
-
-\subsubsection install_cmake_mac Cmake on Mac OS X
-
-SimGrid compiles like a charm with clang on Mac OS X:
+SimGrid compiles like a charm with clang (version 3.0 or higher) on Mac OS X:
 
 @verbatim
 cmake -DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++ .
@@ -288,7 +216,30 @@ warning that the "-pthread" argument is not used, if it appears.
 CMAKE_OSX_SYSROOT:PATH=/Applications/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer
 @endverbatim
 
-\subsection install_src_compil Compiling SimGrid
+In the El Capitan version of Max OS X, Apple decided that users don't
+need no /usr/include directory anymore. If you are hit by this pure
+madness, just run the following command to restore that classical
+UNIX directory: `xcode-select -install`
+
+\subsubsection install_cmake_windows Building on Windows
+
+Building from the source on Windows, may be something of an adventure.
+We never managed to compile SimGrid with something else than MinGW-64
+ourselves. We usually use the
+<a href="http://www.activestate.com/activeperl/downloads">activestate</a>
+version of Perl, and the
+<a href="http://msysgit.googlecode.com/files/Git-1.7.4-preview20110204.exe">msys</a>
+version of git on this architecture, but YMMV. You can have a look at
+the configuration scripts in the appveyor.yml file, but you are
+basically on your own here. Sorry. We are not fluent with Windows so
+we cannot really help. 
+
+The drawback of MinGW-64 is that the produced DLL are not compatible
+with MS Visual C. If you need it, <a href="http://clang.llvm.org/docs/MSVCCompatibility.html">clang-cl</a>
+sounds promising. If you manage to get something working, please tell
+us how you achieved it.
+
+\subsection install_src_compil SimGrid main compilation targets
 
 In most cases, compiling and installing SimGrid is enough:
 
@@ -301,7 +252,7 @@ In addition, several compilation targets are provided in SimGrid. If
 your system is well configured, the full list of targets is available
 for completion when using the Tab key. Note that some of the existing
 targets are not really for public consumption so don't worry if some
-stuff don't work for you.
+stuff doesn't work for you.
 
 @verbatim
 make simgrid                   Build only the SimGrid library and not any example
@@ -311,7 +262,7 @@ make install                        Install the project (doc/ bin/ lib/ include/)
 make uninstall                 Uninstall the project (doc/ bin/ lib/ include/)
 make dist                      Build a distribution archive (tgz)
 make distcheck                 Check the dist (make + make dist + tests on the distribution)
-make doc                       Create SimGrid documentation
+make documentation             Create SimGrid documentation
 @endverbatim
 
 If you want to see what is really happening, try adding VERBOSE=1 to
@@ -325,15 +276,13 @@ make VERBOSE=1
 
 Once everything is built, you may want to test the result. SimGrid
 comes with an extensive set of regression tests (see @ref
-inside_cmake_addtest "that page of the insider manual" for more
+inside_tests "that page of the insider manual" for more
 details). Running the tests is done using the ctest binary that comes
-with cmake. These tests are run every night and the result is publicly
-<a href="http://cdash.inria.fr/CDash/index.php?project=Simgrid">available</a>.
+with cmake. These tests are run for every commit and the result is
+publicly <a href="https://ci.inria.fr/simgrid/">available</a>.
 
 \verbatim
 ctest                    # Launch all tests
-ctest -D Experimental     # Launch all tests and report the result to
-                          # http://cdash.inria.fr/CDash/index.php?project=SimGrid
 ctest -R msg              # Launch only the tests which name match the string "msg"
 ctest -j4                 # Launch all tests in parallel, at most 4 at the same time
 ctest --verbose           # Display all details on what's going on
@@ -345,8 +294,6 @@ ctest -R msg- -j5 --output-on-failure # You changed MSG and want to check that y
 
 \section install_setting_own Setting up your own code
 
-\subsection install_setting_MSG MSG code on Unix (Linux or Mac OSX)
-
 Do not build your simulator by modifying the SimGrid examples.  Go
 outside the SimGrid source tree and create your own working directory
 (say <tt>/home/joe/SimGrid/MyFirstScheduler/</tt>).
@@ -374,103 +321,89 @@ Makefile. It is a generic Makefile that we have used many times with
 our students when we teach the C language.
 
 \verbatim
+# The first rule of a Makefile is the default target. It will be built when make is called with no parameter
+# Here, we want to build the binary 'masterslave'
 all: masterslave
+
+# This second rule lists the dependencies of the masterslave binary
+# How this dependencies are linked is described in an implicit rule below
 masterslave: masterslave.o sched.o
 
-INSTALL_PATH = $$HOME
-CC = gcc
-PEDANTIC_PARANOID_FREAK =       -O0 -Wshadow -Wcast-align \
-                               -Waggregate-return -Wmissing-prototypes -Wmissing-declarations \
-                               -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
-                               -Wmissing-noreturn -Wredundant-decls -Wnested-externs \
-                               -Wpointer-arith -Wwrite-strings -finline-functions
-REASONABLY_CAREFUL_DUDE =      -Wall
-NO_PRAYER_FOR_THE_WICKED =     -w -O2
-WARNINGS =                     $(REASONABLY_CAREFUL_DUDE)
-CFLAGS = -g $(WARNINGS)
-
-INCLUDES = -I$(INSTALL_PATH)/include
-DEFS = -L$(INSTALL_PATH)/lib/
-LDADD = -lm -lsimgrid
-LIBS =
+# These third give the dependencies of the each source file
+masterslave.o: masterslave.c sched.h # list every .h that you use
+sched.o: sched.c sched.h
 
-%: %.o
-       $(CC) $(INCLUDES) $(DEFS) $(CFLAGS) $^ $(LIBS) $(LDADD) -o $@
+# Some configuration
+SIMGRID_INSTALL_PATH = /opt/simgrid # Where you installed simgrid
+CC = gcc                            # Your compiler
+WARNING = -Wshadow -Wcast-align -Waggregate-return -Wmissing-prototypes \
+          -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes \
+          -Wmissing-declarations -Wmissing-noreturn -Wredundant-decls \
+          -Wnested-externs -Wpointer-arith -Wwrite-strings -finline-functions
+
+# CFLAGS = -g -O0 $(WARNINGS) # Use this line to make debugging easier
+CFLAGS = -g -O2 $(WARNINGS) # Use this line to get better performance
 
+# No change should be mandated past that line
+#############################################
+# The following are implicit rules, used by default to actually build
+# the targets for which you listed the dependencies above.
+
+# The blanks before the $(CC) must be a Tab char, not spaces
+%: %.o
+       $(CC) -L$(SIMGRID_INSTALL_PATH)/lib/    $(CFLAGS) $^ -lsimgrid -o $@
 %.o: %.c
-       $(CC) $(INCLUDES) $(DEFS) $(CFLAGS) -c -o $@ $<
+       $(CC) -I$(SIMGRID_INSTALL_PATH)/include $(CFLAGS) -c -o $@ $<
 
 clean:
-       rm -f $(BIN_FILES) *.o *~
-.SUFFIXES:
+       rm -f *.o *~
 .PHONY: clean
-
-\endverbatim
-
-The first two lines indicates what should be build when typing make
-(<tt>masterslave</tt>) and of which files it is to be made of
-(<tt>masterslave.o</tt> and <tt>sched.o</tt>). This makefile assumes
-that you have set up correctly your <tt>LD_LIBRARY_PATH</tt> variable
-(look, there is a <tt>LDADD = -lm -lsimgrid</tt>). If you prefer using
-the static version, remove the <tt>-lsimgrid</tt> and add a
-<tt>$(INSTALL_PATH)/lib/libsimgrid.a</tt> on the next line, right
-after the <tt>LIBS = </tt>.
-
-More generally, if you have never written a Makefile by yourself, type
-in a terminal: <tt>info make</tt> and read the introduction. The
-previous example should be enough for a first try but you may want to
-perform some more complex compilations...
-
-
-\subsection install_setting_win_provided Compile the "HelloWorld" project on Windows
-
-In the SimGrid install directory you should have an HelloWorld project to explain you how to start
-compiling a source file. There are:
-\verbatim
-- HelloWorld.c         The example source file.
-- CMakeLists.txt       It allows to configure the project.
-- README               This explanation.
 \endverbatim
 
-Now let's compile this example:
-\li Run windows shell "cmd".
-\li Open HelloWorld Directory ('cd' command line).
-\li Create a build directory and change directory. (optional)
-\li Type 'cmake -G"MinGW Makefiles" \<path_to_HelloWorld_project\>'
-\li Run mingw32-make
-\li You should obtain a runnable example ("HelloWorld.exe").
+The comments of this file should be enough to understand what's going
+on. If you are completely new to makefiles, you should install the
+<tt>make-doc</tt> package and type this command in a terminal: 
+<tt>info make</tt>.
 
-For compiling your own code you can simply copy the HelloWorld project and rename source name. It will
-create a target with the same name of the source.
+Sometimes, the following error message (or similar) will be produced.
+@verbatim
+masterworker.c:209: undefined reference to `sg_version_check'
+masterworker.c:209: undefined reference to `MSG_init_nocheck'
+(and possibly many other undefined references)
+@endverbatim
 
+It means that the system does not manage to find simgrid when it tries
+to execute your programs. Specify where to search with the
+<tt>LD_LIBRARY_PATH</tt> variable. Try running the following command
+before executing your code. If it helps, you should add this line to
+your ~/.bashrc so that it gets executed each time you log into your
+computer.
 
-\subsection install_setting_win_new Adding and Compiling a new example on Windows
+@verbatim
+export LD_LIBRARY_PATH=/opt/simgrid/lib
+@endverbatim
 
-\li Put your source file into the helloWord directory.
-\li Edit CMakeLists.txt by removing the Find Targets section and add those two lines into this section
-\verbatim
-################
-# FIND TARGETS #
-################
-#It creates a target called 'TARGET_NAME.exe' with the sources 'SOURCES'
-add_executable(TARGET_NAME SOURCES)
-#Links TARGET_NAME with simgrid
-target_link_libraries(TARGET_NAME simgrid)
-\endverbatim
-\li To initialize and build your project, you'll need to run
-\verbatim
-cmake -G"MinGW Makefiles" <path_to_HelloWorld_project>
-\endverbatim
-\li Run "mingw32-make"
-\li You should obtain "TARGET_NAME.exe".
+@subsection install_src_32 Compiling a 32 bit version
 
-\subsection install_Win_ruby Setup a virtualbox to use SimGrid-Ruby on windows
+On a multiarch x86_64 Linux, it should be possible to compile a 32 bit
+version of SimGrid with something like:
 
-Allan Espinosa made these set of Vagrant rules available so that you
-can use the SimGrid Ruby bindings in a virtual machine using
-VirtualBox. Thanks to him for that. You can find his project here:
-https://github.com/aespinosa/simgrid-vagrant
+@verbatim
+CFLAGS=-m32 \
+CXXFLAGS=-m32 \
+PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig/ \
+cmake . \
+-DCMAKE_SYSTEM_PROCESSOR=i386 \
+-DCMAKE_Fortran_COMPILER=/some/path/to/i686-linux-gnu-gfortran \
+-DGFORTRAN_EXE=/some/path/to/i686-linux-gnu-gfortran \
+-DCMAKE_Fortran_FLAGS=-m32
+@endverbatim
 
+where i686-linux-gnu-gfortran can be implemented as:
 
+@verbatim
+#!/bin/sh
+exec gfortran -m32 "$@"
+@endverbatim
 
 */