1 /*! \page install Java Binding
3 \section bindings_binding_java_install How to install Simgrid-java
5 To use java with Simgrid you have to install some dependencies:
6 \li Simgrid (see <a href="http://simgrid.gforge.inria.fr/simgrid/3.7/doc/install.html">install
7 Simgrid</a>). You should set the SIMGRID_ROOT environment
8 variable to the path where you installed SimGrid.
9 \li Java JDK packages, such as sun-java6-jdk (with libgcj10-dev or
10 another version of gcj) or openjdk6.
12 Then Download and install package Simgrid-java:
14 git clone git://scm.gforge.inria.fr/simgrid/simgrid-java.git
16 cmake -DCMAKE_INSTALL_PREFIX=$HOME/Install/simgrid-java/ .
22 -- SITE : Linux_2.6.38-8-generic_x86_64
23 -- BUILDNAME : Simgrid-Java
24 -- Looking for lib SimGrid
25 -- Looking for lib SimGrid - found
26 -- Simgrid version : 3.6
28 -- Looking for gras.h - found
29 -- Found Tesh: /home/user/Bureau/simgrid/git/bin/tesh
30 -- Found gras_stub_generator: /home/user/Bureau/simgrid/git/bin/gras_stub_generator
31 -- Java version 1.6.0.22 configured successfully!
33 -- Looking for jni.h - found
34 -- Add flags -I/usr/lib/jvm/java-6-openjdk/include
35 -- Looking for jni_md.h
36 -- Looking for jni_md.h - found
37 -- Found javac: /usr/bin/javac
38 -- Found jar: /usr/bin/jar
41 -- Build files have been written to: /home/user/workspace/simgrid-java/build
44 \section bindings_binding_java_use How to use Simgrid-java
46 To execute the examples you need to add the path where you installed
47 the generated libSG_java library (<build_dir>/lib) and libsimgrid
48 ($SIMGRID_ROOT/lib) into the LD_LIBRARY_PATH.
50 Be careful on Mac, this variable is called DYLD_LIBRARY_PATH and not
54 $ export SIMGRID_ROOT="$HOME/Install/simgrid/"
55 $ export SIMGRID_JAVA_ROOT="$HOME/Install/simgrid-java"
56 $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SIMGRID_ROOT/lib:$SIMGRID_JAVA_ROOT/java
58 $ java -cp .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml
61 \section bindings_binding_java_coroutines How to use the coroutines context factory
63 You may want to use the coroutines context factory, if speed maters to
64 you (since it's about 5 times faster than the default thread-based
67 First, remember that the coroutines context factory is still
70 To use the coroutines context factory, you need a Java virtual machine
73 Our implementation rely on a JVM patch made by Lukas Stadler, which
74 you can find <a href="http://ssw.jku.at/General/Staff/LS/coro/">here</a>. You
75 can either recompile the JVM yourself or use the offered pre-built
78 SimGrid Java will automatically switch to the coroutine context
79 factory if your JVM support it, so you will just need to execute your
80 simulation with the correct JVM:
82 $ $PATH_TO_COROUTINE_JVM/java -cp .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml
85 Note that you may have to adjust the "coro.stacksPerThread" configuration option to run large simulations:
87 $ $PATH_TO_COROUTINE_JVM/java -Dcoro.stacksPerThread=$STACKS_NUMBER -cp .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml