Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reindent
[simgrid.git] / doc / install.doc
1 /*! \page install Java Binding
2
3 \section bindings_binding_java_install How to install Simgrid-java
4
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.
11  
12 Then Download and install package Simgrid-java:
13 \verbatim
14 git clone git://scm.gforge.inria.fr/simgrid/simgrid-java.git
15 cd simgrid-java
16 cmake -DCMAKE_INSTALL_PREFIX=$HOME/Install/simgrid-java/ .
17 make install
18 \endverbatim
19  
20 Cmake output
21 \verbatim
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
27 -- Looking for gras.h
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!
32 -- Looking for jni.h
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
39 -- Configuring done
40 -- Generating done
41 -- Build files have been written to: /home/user/workspace/simgrid-java/build
42 \endverbatim
43
44 \section bindings_binding_java_use How to use Simgrid-java
45
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.
49
50 Be careful on Mac, this variable is called DYLD_LIBRARY_PATH and not
51 LD_LIBRARY_PATH.
52
53 \verbatim
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
57 $ cd examples
58 $ java -cp .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml
59 \endverbatim
60
61 \section bindings_binding_java_coroutines How to use the coroutines context factory
62
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
65 context factory).
66
67 First, remember that the coroutines context factory is still
68 experimental work.
69
70 To use the coroutines context factory, you need a Java virtual machine
71 which supports it.
72
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
76 binaries.
77
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:
81 \verbatim
82 $ $PATH_TO_COROUTINE_JVM/java -cp .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml
83 \endverbatim
84
85 Note that you may have to adjust the "coro.stacksPerThread" configuration option to run large simulations:
86 \verbatim
87 $ $PATH_TO_COROUTINE_JVM/java -Dcoro.stacksPerThread=$STACKS_NUMBER -cp .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml
88 \endverbatim 
89  */