| 1 | = Installation = |
| 2 | |
| 3 | The recent bundle of MUSCLE can be downloaded from the [[http://apps.man.poznan.pl/trac/muscle/downloads|Downloads section]]. The bundled package contains the source code, documentation and precompiled Java archives (jar). |
| 4 | |
| 5 | The offered version of MUSCLE in several places extends and improve the [[http://muscle.berlios.de/|package]] provided by Jan Hegewald. We can list here the following elements: |
| 6 | * improved installation procedure (some dependencies are already included in the bundle), |
| 7 | * added support for generation of OTF trace logs, |
| 8 | * implemented Port Range traversing technique for cross-cluster execution. |
| 9 | == Dependencies == |
| 10 | The core functionality of the MUSCLE is written in Java. To be able to integrate native code with the MUSCLE, there is also a native part which is written in C++. Bootstrapping and platform independent configuration is done with a flexible setup mechanism written in Ruby. |
| 11 | |
| 12 | In order to use the MUSCLE, you need a recent Java runtime. You can obtain it at either http://www.java.com/en/download/index.jsp (Sun-Java) or http://openjdk.java.net/ (Open-JDK). |
| 13 | |
| 14 | A Ruby installation can be downloaded from: [[http://www.ruby-lang.org/en/downloads/] (MUSCLE does currently not work with Ruby 1.9.1 or newer). |
| 15 | |
| 16 | == General Instructions == |
| 17 | If the dependencies are in place, you are ready to use MUSCLE. In general, for Java applications, no compilation is required. |
| 18 | Extract the download, e.g. |
| 19 | {{{ |
| 20 | #!div style="font-size: 90%" |
| 21 | {{{#!sh |
| 22 | $ unzip muscle-1.0.1.zip |
| 23 | }}} |
| 24 | }}} |
| 25 | Change your working directory to the the MUSCLE directory: |
| 26 | {{{ |
| 27 | #!div style="font-size: 90%" |
| 28 | {{{#!sh |
| 29 | $ cd muscle-1.0.1 |
| 30 | }}} |
| 31 | }}} |
| 32 | Invoke MUSCLE installation (we are installing muscle to the /opt/muscle directory which is default, type ./build.rb for more options): |
| 33 | {{{ |
| 34 | #!div style="font-size: 90%" |
| 35 | {{{#!sh |
| 36 | $ ./build.rb --target=install |
| 37 | }}} |
| 38 | }}} |
| 39 | See if MUSCLE is working correctly: |
| 40 | {{{ |
| 41 | #!div style="font-size: 90%" |
| 42 | {{{#!sh |
| 43 | $ /opt/muscle/bin/muscle --version |
| 44 | }}} |
| 45 | }}} |
| 46 | |
| 47 | In case you plan to use MUSCLE with native code, you will have to compile the native library part of MUSCLE using a C++ compiler (such as g++). The build script belonging to MUSCLE also has a target to build the native libraries. This requires a C++ compiler and CMake (http://www.cmake.org/) to be available. You can also use your favourite IDE/build system instead. |
| 48 | |
| 49 | == What’s in the bundle? == |
| 50 | The MUSCLE download bundle contains the following items: |
| 51 | * '''build''' - This directory contains the compiled Java bytecode and C++ libraries. |
| 52 | * '''build.rb''' - The build script. It can compile the java sources, build jar archives build the native shared libraries. |
| 53 | * '''CMakeLists.txt''' - The configuration file for cmake. Only needed if the native libraries are to be built. This file is used by the build.rb, you do not have to call cmake manually. |
| 54 | * '''doc''' - The documentation files. |
| 55 | * '''OTF''' - The configuration and helper scripts for OTF trace logger. |
| 56 | * '''src''' - This directory contains the MUSCLE source code. |
| 57 | * '''thirdparty''' - The MUSCLE will automatically load third-party libraries which are in this directory. |
| 58 | |
| 59 | == Installation example - Scientific Linux 5.6 == |
| 60 | '''Note:''' Some part of the presented installation procedure requires to be invoked by root. |
| 61 | |
| 62 | 1. Check if proper version of ruby is already installed in the system, otherwise install it: |
| 63 | {{{ |
| 64 | #!div style="font-size: 90%" |
| 65 | {{{#!sh |
| 66 | ruby --version |
| 67 | -bash: ruby: command not found |
| 68 | |
| 69 | yum install ruby |
| 70 | ... |
| 71 | ruby --version |
| 72 | ruby 1.8.5 (2006-08-25) [x86_64-linux] |
| 73 | }}} |
| 74 | }}} |
| 75 | |
| 76 | 2. Ensure if you have a c++ compiler available on your system. If you have not, install this: |
| 77 | {{{ |
| 78 | #!div style="font-size: 90%" |
| 79 | {{{#!sh |
| 80 | yum install gcc-c++ |
| 81 | }}} |
| 82 | }}} |
| 83 | |
| 84 | 3. Check if cmake is available, otherwise install cmake: |
| 85 | {{{ |
| 86 | #!div style="font-size: 90%" |
| 87 | {{{#!sh |
| 88 | yum install cmake |
| 89 | }}} |
| 90 | }}} |
| 91 | '''Note:''' you may need to add the reference to the repositorium with extra packages. To do this you need to create the file 'epel.repo' in the /etc/yum.repos.d directory. The content of the file may look as follows: |
| 92 | {{{ |
| 93 | #!div style="font-size: 90%" |
| 94 | {{{#!sh |
| 95 | [epel] |
| 96 | name=Extra Packages for Enterprise Linux 5 - $basearch |
| 97 | |
| 98 | #baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch |
| 99 | mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch |
| 100 | failovermethod=priority |
| 101 | enabled=1 |
| 102 | gpgcheck=0 |
| 103 | }}} |
| 104 | }}} |
| 105 | |
| 106 | 4. Check if recent Java SE Runtime Environment (JRE) or Java SE Development Kit (JDK) are present in your system. As the precompiled MUSCLE package is already included at build/muscle.jar you may not need to compile the Java sources and JRE should be sufficient. Hovewer, if you want to recompile the Java part of the MUSCLE (recommended), a recent Java compiler is also required. |
| 107 | {{{ |
| 108 | #!div style="font-size: 90%" |
| 109 | {{{#!sh |
| 110 | yum install jdk |
| 111 | }}} |
| 112 | }}} |
| 113 | |
| 114 | 5. Set required environment variables, e.g. |
| 115 | {{{ |
| 116 | #!div style="font-size: 90%" |
| 117 | {{{#!sh |
| 118 | export JAVA_HOME=/usr/java/jdk1.6.0_26 |
| 119 | export PATH=$JAVA_HOME/bin:$PATH |
| 120 | }}} |
| 121 | }}} |
| 122 | |
| 123 | 6. Download the muscle bundle from [[http://apps.man.poznan.pl/trac/muscle/downloads|Downloads section]], e.g. |
| 124 | {{{ |
| 125 | #!div style="font-size: 90%" |
| 126 | {{{#!sh |
| 127 | wget http://apps.man.poznan.pl/trac/muscle/downloads/muscle-1.0.1.zip |
| 128 | }}} |
| 129 | }}} |
| 130 | |
| 131 | 7. Extract the package: |
| 132 | {{{ |
| 133 | #!div style="font-size: 90%" |
| 134 | {{{#!sh |
| 135 | unzip muscle-1.0.1.zip |
| 136 | }}} |
| 137 | }}} |
| 138 | |
| 139 | 8. Recompile entire MUSCLE: |
| 140 | {{{ |
| 141 | #!div style="font-size: 90%" |
| 142 | {{{#!sh |
| 143 | cd muscle-1.0.1 |
| 144 | ./build.rb all |
| 145 | }}} |
| 146 | }}} |
| 147 | |
| 148 | 9. See if the MUSCLE is working: |
| 149 | {{{ |
| 150 | #!div style="font-size: 90%" |
| 151 | {{{#!sh |
| 152 | ./src/ruby/muscle.rb --version |
| 153 | }}} |
| 154 | }}} |
| 155 | |
| 156 | == Sample execution == |
| 157 | There are some examples which belong to the MUSCLE bundle. Example code for kernels can be found in the directories java/examples and cpp/examples. There are also prepared configurations for coupled examples CxA (MUSCLE simulations), which can be found in the cxa directory. |
| 158 | |
| 159 | === Hello World === |
| 160 | |
| 161 | ==== Sender ==== |
| 162 | At java/examples/simplejava/Sender we provide a minimalist kernel written in Java, which sends data (an array of double). |
| 163 | |
| 164 | ==== Receiver ==== |
| 165 | At java/examples/simplejava/ConsoleWriter we provide a simple kernel written in Java. It receives data (an array of double) and prints its content to the standard output. |
| 166 | |
| 167 | ==== CxA (coupling schema) ==== |
| 168 | The configuration cxa/SimpleExample.cxa.rb configures a minimal CxA which couples the java/examples/simplejava/Sender and java/examples/simplejava/ConsoleWriter kernels. |
| 169 | |
| 170 | ==== Execution ==== |
| 171 | To run the simmulation defined in cxa/SimpleExample.cxa.rb use the following command: |
| 172 | {{{ |
| 173 | #!div style="font-size: 90%" |
| 174 | {{{#!sh |
| 175 | ./src/ruby/muscle.rb --cxa_file src/cxa/SimpleExample.cxa.rb --main plumber w r --autoquit |
| 176 | }}} |
| 177 | }}} |
| 178 | |
| 179 | == Further reading == |
| 180 | For more information how to install and run MUSCLE see doc/muscle_developers_guide.pdf included in the MUSCLE bundle. |
| 181 | For more information how to install and run MUSCLE see doc/muscle_developers_guide.pdf. |