How to compile and run SALSA programs

 

How to Start Salsa Programs

If you are using a compiled source distribution subsitute the src/ directory of the distribution for the jar file in class path specifications.  Be sure to replace salsa<version>.jar with the appropriate jar file if you are using a newer version.

The class path may be specified using the -cp option for java and the -classpath option for javac. If you are using MSWindows use semi-colon (';') as a class path delimiter, if you are using just about anything else, use colon (':'). For instance:

 

Compilation

Often it is easier to create an alias for the SalsaCompiler invocation if the shell you are using allows it. The class path specification includes . for the current directory so that the demo package is included in the class path. Assume host1 is used for compilation. One should key in: 

host1$ java -cp salsa<version>.jar:. salsac.SalsaCompiler demo/*.salsa

...

host1$ javac -classpath salsa<version>.jar:. demo/*.java

 

Note that "host1$" is the terminal prompt on host1.

 

Stand-alone execution. (HelloWorld.salsa etc)

Make sure the compiled class files are placed in the directory "demo". Then back to the parent directory and execute the  following command:

host1$ java -cp salsa<version>.jar:. demo.HelloWorld

 

 

Starting Name Server

The SALSA name server is required for migration and remote message sending. The name server will output the port it is listening on. The default port number is 3030. One can use "-p" option to set the listening port. For instance:

host1$ java -cp salsa<version>.jar:. wwc.naming.WWCNamingServer -p 3030

 

 

 

Multiple theatre execution. (Migrate.salsa etc).

The theaters will output the hostname and port they are bound to at startup. It is important in some environments that the fully qualified domain name be used when specifying locations and name servers.

Step 1: start one theater.

host1$ java -cp salsa<version>.jar:. wwc.messaging.Theater 4040

 

 

Step 2: start another theater.

host2$ java -cp salsa<version>.jar:. wwc.messaging.Theater 4040

 

 

Step 3: start the name server.

host3$ java -cp salsa<version>.jar:. wwc.naming.WWCNamingServer

 

 

Step 4: start the distributed SALSA application.

host4$ java -cp salsa<version>.jar:. demo.Migrate uan://host3.cs.rpi.edu:3030/m rmsp://host1.cs.rpi.edu:4040/a rmsp://host2.cs.rpi.edu:4040/b

 

 

return to the salsa home page.