Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Improve code coverage
[simgrid.git] / doc / doxygen / bindings.doc
index ebc4084..1283603 100644 (file)
@@ -1,9 +1,9 @@
 /*! \page bindings Bindings
 
-\section bindings_binding_Ruby Ruby Binding
+\section MSG_Ruby Ruby Binding
 Check online for our specific [Simgrid-Ruby documentation](http://simgrid.gforge.inria.fr/documentation.html).
 
-\section bindings_binding_Java Java Binding
+\section MSG_Java Java Binding
 Simgrid-java is a java API that let you use [Simgrid](http://simgrid.gforge.inria.fr/)
 MSG API in your favorite language (java). Without it, you would be forced to
 use C or one of the other bindings provided.
@@ -51,44 +51,15 @@ C crashes mainly for 2 reasons:
 \subsection bindings_binding_java_install How to install Simgrid-java
 
 To use java with Simgrid you have to install some dependencies:
-- Simgrid (see [install Simgrid](http://simgrid.gforge.inria.fr/simgrid/latest/doc/install.html).
-  You should set the `SIMGRID_ROOT` environment variable to the path where you installed SimGrid.
 - Java JDK packages, such as `openjdk7` or `sun-java6-jdk` (with `libgcj10-dev` or another
   version of gcj). For maximal performance and scalability, use a coroutine-enabled JVM (see
   \ref bindings_binding_java_coroutines).
  
-Then Download and install package Simgrid-java:
+Then build Simgrid with the Java bindings enabled:
 ~~~~{.sh}
-git clone git://scm.gforge.inria.fr/simgrid/simgrid-java.git
-cd simgrid-java
-cmake -DCMAKE_INSTALL_PREFIX=$HOME/Install/simgrid-java/ .
-make install
+cmake -Denable_java=ON .
 ~~~~
  
-Cmake output
-~~~~{.sh}
--- SITE        : Linux_2.6.38-8-generic_x86_64
--- BUILDNAME   : Simgrid-Java
--- Looking for lib SimGrid
--- Looking for lib SimGrid - found
--- Simgrid version : 3.8.1
--- Looking for gras.h
--- Looking for gras.h - found
--- Found Tesh: /home/user/Bureau/simgrid/git/bin/tesh
--- Found gras_stub_generator: /home/user/Bureau/simgrid/git/bin/gras_stub_generator
--- Java version 1.6.0.22 configured successfully!
--- Looking for jni.h
--- Looking for jni.h - found
--- Add flags -I/usr/lib/jvm/java-6-openjdk/include
--- Looking for jni_md.h
--- Looking for jni_md.h - found
--- Found javac: /usr/bin/javac
--- Found jar: /usr/bin/jar
--- Configuring done
--- Generating done
--- Build files have been written to: /home/user/workspace/simgrid-java/build
-~~~~
-
 If cmake complains that **jni could not be found**, you need to tell it where
 JNI header files are located. the following command should tell you:
 
@@ -112,18 +83,17 @@ $ cmake .
 \subsubsection bindings_binding_java_use How to use Simgrid-java
 
 To execute the examples you need to add the path where you installed
-the generated `libSG_java` library (`<build_dir>/lib`) and `libsimgrid`
-(`$SIMGRID_ROOT/lib`) into the `LD_LIBRARY_PATH`.
+the generated `libsimgrid-java` and `libsimgrid` libraries
+into the `LD_LIBRARY_PATH`.
 
 Be careful on Mac, this variable is called `DYLD_LIBRARY_PATH` and not
 `LD_LIBRARY_PATH`.
 
 ~~~~{.sh}
 $ export SIMGRID_ROOT="$HOME/Install/simgrid/" # change it to the path where you installed the SimGrid library
-$ export SIMGRID_JAVA_ROOT="$HOME/Install/simgrid-java" # change it to the path where you installed the java bindings of SimGrid 
-$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$SIMGRID_ROOT/lib:$SIMGRID_JAVA_ROOT/java
+$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$SIMGRID_ROOT/lib
 $ cd examples
-$ java -cp .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml
+$ java -classpath .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml
 ~~~~
 
 If you want to make these settings permanent even after a reboot, you
@@ -158,7 +128,7 @@ http://graal.ens-lyon.fr/~jrouzaud/files/corosimple-linux-amd64-20120914.tgz
 ~~~~{.sh}
 sudo apt-get install mercurial ksh libfreetype6-dev libcups2-dev libasound2-dev gawk openjdk-7-jdk libxext-dev libxrender-dev libxtst-dev
 # Grab the forest extension: we need to source-install it
-hg clone https://bitbucket.org/gxti/hgforest hgforest \endverbatim
+hg clone https://bitbucket.org/gxti/hgforest hgforest
 ~~~~
  -# Configure the mercurial extensions: Edit ~/.hgrc and paste the
     following lines. Don't forget to change the /path/to/forest.py to
@@ -193,13 +163,12 @@ ls -i patches/hotspot/series sources/hotspot/.hg/patches/series
 #  9707849 patches/hotspot/series  
 #  9707849 sources/hotspot/.hg/patches/series
 
-
 # Specify what to compile. 
-export davinci=$(pwd) guards="buildable testable coro-simple"
+export davinci=${pwd} guards="buildable testable coro-simple"
 # Apply the patches
-sh patches/make/each-patch-repo.sh hg qselect --reapply $guards '$(sh $davinci/patches/make/current-release.sh)'
+sh patches/make/each-patch-repo.sh hg qselect --reapply $guards `sh $davinci/patches/make/current-release.sh`
 # Check that it understood that you want the patch applied:
-grep GLOBAL_GUARDS patches/make/* -r
+grep -r GLOBAL_GUARDS patches/make/
 # this should display something like the following (maybe amonst other unrelated lines)
 # GLOBAL_GUARDS=buildable testable coro-simple
 # If this does not work, edit patches/make/Makefile,
@@ -208,9 +177,10 @@ grep GLOBAL_GUARDS patches/make/* -r
 
 
 # Finish the setup
-(cd patches/make; make setup && make force && make && make FORCE_VERSIONS=1 && echo "Sources are properly setup")
-# If this last command failed, check your mercurial config within ~/.hgrc (see above)
-~~~~       
+cd patches/make;
+make setup && make force && make && make FORCE_VERSIONS=1 && echo "Sources are properly setup"
+# If this last command failed, check your mercurial config within ~/.hgrc (see above)
+~~~~
  -# Compile it all
 ~~~~{.sh}
 unset LD_LIBRARY_PATH
@@ -233,16 +203,16 @@ factory if your JVM support it, so you will just need to execute your
 simulation with the correct JVM. The selected context factory gets
 displayed automatically.
 ~~~~{.sh}
-export LD_LIBRARY_PATH=/path/to/simgrid.so:/path/to/libSG_java.so
+export LD_LIBRARY_PATH=/path/to/simgrid.so:/path/to/libsimgrid-java.so
 cd examples
-$PATH_TO_COROUTINE_JVM/java -cp .:../simgrid.jar masterslave.Masterslave masterslave/ masterslaveDeployment.xml platform.xml
+$PATH_TO_COROUTINE_JVM/java -classpath .:../simgrid.jar masterslave.Masterslave masterslave/ masterslaveDeployment.xml platform.xml
 ~~~~
 
 Note that you may have to adjust the "coro.stacksPerThread"
 configuration option to run large simulations. The default is 100 and
 you want to increase it to run more processes.
 ~~~~{.sh}
-$ $PATH_TO_COROUTINE_JVM/java -Dcoro.stacksPerThread=$STACKS_NUMBER -cp .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml
+$ $PATH_TO_COROUTINE_JVM/java -Dcoro.stacksPerThread=$STACKS_NUMBER -classpath .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml
 ~~~~
 
 If you reach the point where the creation of new simulated processes