Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't pass property set to the storage constructor, there is no need
[simgrid.git] / INSTALL
diff --git a/INSTALL b/INSTALL
index 7c5877f..2586170 100644 (file)
--- a/INSTALL
+++ b/INSTALL
-************************************************
-* Installation information specific to SimGrid *
-************************************************
-
-The main source of information to compile SimGrid is the project FAQ.
-It is available online from http://simgrid.gforge.inria.fr/doc/faq.html or
-in the doc/ directory of this archive.
-
-Quick way to compile
-====================
-
-In short, the way to compile SimGrid depends on whether you are
-compiling a tar.gz archive or directly from the SVN. In the latter
-case, you have to do an extra step (noted 0 below).
-
-(0) regenerate the autotools files (only needed from SVN):
-$ ./bootstrap
-
-(1) configure SimGrid (both in SVN and archives)
-$ ./configure <all options>
-Main options are:
-  --prefix=<path>: specify where to install SimGrid
-  --with-pthreads: use pthreads instead of Unix contextes (less
-                   efficient but maybe easier to debug)
-  --enable-maintainer-mode: get the makefiles regenerated automatically
-  --disable-compiler-optimizations: compile with -O0 instead of -O3
-See below for other configure options which are common to any project,
-not only SimGrid related.
-
-(2) Compile it
-$ make
-
-(3) Test it (optional)
-$ make check 
-     or
-$ ./checkall
-
-(4) Install it
-$ make install
-
-
-Dependencies
-============
-SimGrid archives do not have any firm dependencies. 
-
-If you want to compile from the svn, you have to have autotool,
-automake and libtool installed.
-
-If you want to compile the java bindings, you have to have a java
-compiler, and the jni.h header file (available from the JDK)
-
-If you want to compile the GTNetS backend, you have to have a patched
-version of GTNetS installed. The patch lives in the contrib section of
-the SVN.
-
-Again, you should check the FAQ for more information.
-
-****************************************************************************
-* Generic Installation information from autotools                          *
-* (provided for completion at the step where you have to launch configure) *
-****************************************************************************
-
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
-Foundation, Inc.
-
-   This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
-
-Basic Installation
-==================
-
-   These are generic installation instructions.
-
-   The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation.  It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions.  Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
-   It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  (Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.)
-
-   If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release.  If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
-   The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
-  1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.  If you're
-     using `csh' on an old version of System V, you might need to type
-     `sh ./configure' instead to prevent `csh' from trying to execute
-     `configure' itself.
-
-     Running `configure' takes awhile.  While running, it prints some
-     messages telling which features it is checking for.
-
-  2. Type `make' to compile the package.
-
-  3. Optionally, type `make check' to run any self-tests that come with
-     the package.
-
-  4. Type `make install' to install the programs and any data files and
-     documentation.
-
-  5. You can remove the program binaries and object files from the
-     source code directory by typing `make clean'.  To also remove the
-     files that `configure' created (so you can compile the package for
-     a different kind of computer), type `make distclean'.  There is
-     also a `make maintainer-clean' target, but that is intended mainly
-     for the package's developers.  If you use it, you may have to get
-     all sorts of other programs in order to regenerate files that came
-     with the distribution.
-
-Compilers and Options
-=====================
-
-   Some systems require unusual options for compilation or linking that
-the `configure' script does not know about.  Run `./configure --help'
-for details on some of the pertinent environment variables.
-
-   You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment.  Here
-is an example:
-
-     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
-
-   *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
-   You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory.  To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'.  `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
-   If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory.  After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
-
-Installation Names
-==================
-
-   By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc.  You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
-
-   You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files.  If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
-   In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
-kinds of files.  Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
-   If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
-   Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System).  The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
-   For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
-   There may be some features `configure' cannot figure out
-automatically, but needs to determine by the type of machine the package
-will run on.  Usually, assuming the package is built to be run on the
-_same_ architectures, `configure' can figure that out, but if it prints
-a message saying it cannot guess the machine type, give it the
-`--build=TYPE' option.  TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
-     CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
-     OS KERNEL-OS
-
-   See the file `config.sub' for the possible values of each field.  If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
-   If you are _building_ compiler tools for cross-compiling, you should
-use the `--target=TYPE' option to select the type of system they will
-produce code for.
-
-   If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
-<   If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists.  Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
-   Variables not defined in a site shell script can be set in the
-environment passed to `configure'.  However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost.  In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'.  For example:
-
-     ./configure CC=/usr/local2/bin/gcc
-
-will cause the specified gcc to be used as the C compiler (unless it is
-overridden in the site shell script).
-
-`configure' Invocation
-======================
-
-   `configure' recognizes the following options to control how it
-operates.
-
-`--help'
-`-h'
-     Print a summary of the options to `configure', and exit.
-
-`--version'
-`-V'
-     Print the version of Autoconf used to generate the `configure'
-     script, and exit.
-
-`--cache-file=FILE'
-     Enable the cache: use and save the results of the tests in FILE,
-     traditionally `config.cache'.  FILE defaults to `/dev/null' to
-     disable caching.
-
-`--config-cache'
-`-C'
-     Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
-     Do not print messages saying which checks are being made.  To
-     suppress all normal output, redirect it to `/dev/null' (any error
-     messages will still be shown).
-
-`--srcdir=DIR'
-     Look for the package's source code in directory DIR.  Usually
-     `configure' can determine that directory automatically.
-
-`configure' also accepts some other, not widely useful, options.  Run
-`configure --help' for more details.
-
+This page summarizes how to compile SimGrid. The full Install
+documentation is available in doc/html/install.html or online at
+
+              http://simgrid.gforge.inria.fr/
+
+Getting the Dependencies
+------------------------
+SimGrid only uses very standard tools:
+ - C compiler, C++ compiler, make and friends.
+ - perl (but you may try to go without it)
+ - cmake (version 2.8.8 or higher). You may want to use ccmake for a graphical interface over cmake.
+ - boost:
+   - Max OS X: with fink: fink install boost1.53.nopython, or with homebrew: brew install boost
+   - Debian / Ubuntu: apt-get install libboost-dev libboost-context-dev
+ - Java (if you want to build the Java bindings):
+   - Mac OS X or Windows: Grab a full JDK
+   - Debian / Ubuntu: apt-get install default-jdk
+
+Build Configuration
+-------------------
+Note that compile-time options are very different from run-time options.
+
+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:
+
+  export CC=gcc-4.7
+  export CXX=g++-4.7
+
+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 ending dot is mandatory (see Out of Tree Compilation).
+
+  cmake -DCC=clang -DCXX=clang++ .
+  
+Finally, you can use the ccmake graphical interface to change these settings.
+
+  ccmake .
+
+Existing compilation options
+----------------------------
+
+ CMAKE_INSTALL_PREFIX (path)
+   Where to install SimGrid (/opt/simgrid, /usr/local, or elsewhere).
+ enable_compile_optimizations (ON/OFF)    
+   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.
+ enable_compile_warnings (ON/OFF) 
+   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 will bring you nothing.
+ enable_debug (ON/OFF)
+   Disable this option toto discard all log messages of gravity debug
+   or below at compile time. The resulting code is faster than if you
+   discarding these messages at runtime. However, it obviously becomes
+   impossible to get any debug info from SimGrid if something goes
+   wrong.   
+ enable_documentation (ON/OFF) 
+   Generate the documentation pages.
+ enable_java (ON/OFF) 
+   To enjoy the java bindings of SimGrid.
+ enable_jedule (ON/OFF) 
+   To get SimDag producing execution traces that can then be
+   visualized with the Jedule external tool. 
+ enable_lua (ON/OFF) 
+   To enjoy the lua bindings to the SimGrid internals.
+ enable_lib_in_jar (ON/OFF) 
+   Bundle the native java bindings in the jar file.
+ enable_lto (ON/OFF) 
+   Enable the Link Time Optimization of the C compiler. This feature
+   really speeds up the produced code, but it is fragile with some
+   versions of GCC. 
+ enable_maintainer_mode (ON/OFF) 
+   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.   
+ enable_mallocators (ON/OFF) 
+   Disabled this when tracking memory issues within SimGrid, or our
+   internal memory caching mechanism will fool the debuggers.
+ enable_model-checking (ON/OFF) 
+   This execution gear is very usable now, but enabling this option at
+   compile time will hinder simulation speed even when the
+   model-checker is not activated at run time. 
+ enable_ns3 (ON/OFF) 
+   Allow to use ns-3 as a SimGrid network model.
+ enable_smpi (ON/OFF) 
+   Allow to run MPI code on top of SimGrid.
+ enable_smpi_ISP_testsuite (ON/OFF) 
+   Add many extra tests for the model-checker module.
+ enable_smpi_MPICH3_testsuite (ON/OFF) 
+   Add many extra tests for the MPI module.
+   
+Reset the build configuration
+-----------------------------
+
+To empty the cmake cache (either when you add a new library or when
+things go seriously wrong), simply delete your CMakeCache.txt. You may
+also want to directly edit this file in some circumstances.
+
+Out of Tree Compilation
+-----------------------
+
+By default, the files produced during the compilation are placed in
+the source directory. It is however often better to put them all in a
+separate directory: cleaning the tree becomes as easy as removing this
+directory, and you can have several such directories to test several
+parameter sets or architectures. For that, go to the directory where
+the files should be produced, and invoke cmake (or ccmake) with the
+full path to the SimGrid source as last argument.
+
+  mkdir build
+  cd build
+  cmake [options] ..
+  make
+
+Mac OS X Builds
+---------------
+SimGrid compiles like a charm with clang (version 3.0 or higher) on Mac OS X:
+
+  cmake -DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++ .
+  make
+  
+With the XCode version of clang 4.1, you may get the following error message: 
+CMake Error: Parse error in cache file build_dir/CMakeCache.txt. Offending entry: /SDKs/MacOSX10.8.sdk
+
+In that case, edit the CMakeCache.txt file directly, so that the
+CMAKE_OSX_SYSROOT is similar to the following. Don't worry about the
+warning that the "-pthread" argument is not used, if it appears.
+CMAKE_OSX_SYSROOT:PATH=/Applications/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer
+
+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
+
+Windows Builds
+--------------
+
+Building SimGrid on Windows may be something of an adventure: We only
+manage to do so ourselves with MinGW-64, ActiveState Perl and msys
+git). Have a look at out configuration scripts in appveyor.yml, but
+don't expect too much from us: we are really not fluent with Windows.
+Actually your help is welcome. 
+
+The drawback of MinGW-64 is that the produced DLL are not compatible
+with MS Visual C. clang-cl sounds promising to fix this. If you get
+something working, please tell us.
+
+Build the Java bindings
+-----------------------
+
+Once you have the full JDK installed (on Debian/Ubuntu, grab the
+package default-jdk for that), things should be as simple as:
+
+    cmake -Denable_java=ON .    
+    make 
+    
+After the compilation, the file simgrid.jar is produced in the root
+directory. If you only want to build the jarfile and its dependencies,
+type make simgrid-java_jar. It will save you the time of building
+every C examples and other things that you don't need for Java.
+
+Sometimes, the build system fails to find the JNI headers:
+ Error: jni could not be found. 
+
+In this case, you need to first locate them as follows:
+    $ locate jni.h    
+    /usr/lib/jvm/java-7-openjdk-amd64/include/jni.h    
+    /usr/lib/jvm/java-8-openjdk-amd64/include/jni.h
+
+Then, set the JAVA_INCLUDE_PATH environment variable to the right
+path, and relaunch cmake. If you have several version of jni installed
+(as above), use the right one (check the java version you use with
+javac -version).
+
+    export JAVA_INCLUDE_PATH=/usr/lib/jvm/java-8-openjdk-amd64/include/   
+    cmake -Denable_java=ON .    
+    make
+    
+Note that the filename jni.h was removed from the path.
+
+32 bits Builds on Multi-arch Linux
+----------------------------------
+
+On a multiarch x86_64 Linux, it should be possible to compile a 32 bit version of SimGrid with something like:
+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
+If needed, implement i686-linux-gnu-gfortran as a script:
+#!/bin/sh
+exec gfortran -m32 "$@"
+
+Existing Compilation Targets
+----------------------------
+In most cases, compiling and installing SimGrid is enough:
+  make
+  make install # try "sudo make install" if you don't have the permission to write
+  
+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 doesn't work for you.
+
+make simgrid                    Build only the SimGrid library and not any example
+make app-masterworker           Build only this example (works for any example)
+make clean                      Clean the results of a previous compilation
+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 documentation              Create SimGrid documentation
+
+If you want to see what is really happening, try adding VERBOSE=1 to your compilation requests:
+
+  make VERBOSE=1
+  
+Testing your build
+------------------
+
+Once everything is built, you may want to test the result. SimGrid
+comes with an extensive set of regression tests (as described in the
+insider manual). The tests are run with ctest, that comes with CMake.
+We run them every commit and the results are on our Jenkins.
+
+ctest                     # Launch all tests
+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
+ctest --output-on-failure # Only get verbose for the tests that fail
+ctest -R msg- -j5 --output-on-failure # You changed MSG and want to check that you didn't break anything, huh?
+                                      # That's fine, I do so all the time myself.