Makefile for running remote programs in Legion 1.6

Table of Contents
About this makefile
Sample makefile
Other on-line tutorials & documentation
Click on the to move to the selected text.

Depending on how your system is set up, you may need to set up your access to your system before you can run Legion commands. This will probably involve running a command such as this:
$ . ~legion/setup.sh
$ source ~legion/setup.csh
The exact syntax will depend on what kind of shell you are using and where your Legion files are installed (i.e., the value of ~legion will depend on your individual Legion net). Consult your system administrator for more information.

The following style conventions are used in these tutorials:

About this makefile

This makefile is for use with both legacy and Legion-aware programs that will be executed with either legion_run or legion_run_multi. In the sample below we started with a legacy C++ code, gnomad.c, and modified it to use the Legion I/O libraries. This allows the application to manipulate context space directly rather than copying a lot of files around. A copy of the original program was kept in the file gnomad_orig.c.

The makefile has targets for five platforms: intel, sgi, solaris, ibm, and alpha_linux. The make targets are slightly different for each machine because the c++/g++ compiler sits in different places and may not be found by the default search path. Therefore, we hard-wired each target to known paths. If these paths don't work for you, log on to a compilation box and get the path directly.

Each make target uses legion_make to start a make on the desired platform. The make target then compiles and registers both the pure legacy code and the Legion-aware code. After each code is compiled, the resulting binary is registered in Legion space in the desired directory, in this case in /home/grimshaw.

Sample makefile

CC	= g++

include $(LEGION)/src/macros/$(LEGION_ARCH).macros

include $(LEGION)/src/macros/$(LEGION_ARCH).$(CC).macros

CFLAGS	= -I$(LEGION)/include -L$(LEGION)/lib/$(LEGION_ARCH)/g++ 
LIB = -lBasicFiles -lLegionClientStubs $(LIB_LEGION_LFLAGS)

	g++ -O $(CFLAGS) gnomad.c -o gnomad $(LIB)
	g++ -O $(CFLAGS) gnomad_orig.c -o gnomad_orig $(LIB)

intel:	gnomad.c
	legion_make -a linux usr_path 
	touch intel

all_platforms: solaris ibm intel alpha_linux sgi
	make intel alpha_linux solaris sgi

	/gnu/bin/g++ -O $(CFLAGS) gnomad.c -o gnomad $(LIB) 
	legion_register_program /home/grimshaw/gnomad ./gnomad $(LEGION_ARCH)
	/gnu/bin/g++ -O $(CFLAGS) gnomad_orig.c -o gnomad_orig $(LIB) 
	legion_register_program /home/grimshaw/gnomad_orig ./gnomad_orig $(LEGION_ARCH)

	/usr/local/bin/g++  -O $(CFLAGS) gnomad.c -o gnomad $(LIB) 
	legion_register_program /home/grimshaw/gnomad ./gnomad $(LEGION_ARCH)
	/usr/local/bin/g++  -O $(CFLAGS) gnomad_orig.c -o gnomad_orig $(LIB) 
	legion_register_program /home/grimshaw/gnomad_orig ./gnomad_orig $(LEGION_ARCH)

	/usr/bin/g++  -O $(CFLAGS) gnomad.c -o gnomad $(LIB) 
	legion_register_program /home/grimshaw/gnomad ./gnomad $(LEGION_ARCH)
	/usr/bin/g++  -O $(CFLAGS) gnomad_orig.c -o gnomad_orig $(LIB) 
	legion_register_program /home/grimshaw/gnomad_orig ./gnomad_orig $(LEGION_ARCH)

solaris:	gnomad.c
	legion_make -a solaris -e /gnu/bin/make gnu_path
	touch solaris

ibm:	gnomad.c
	legion_make -a rs6000 -e /gnu/bin/make gnu_path
	touch ibm

sgi:	gnomad.c
	legion_make -h /hosts/bluebox.cs.virginia.edu -e /gnu/bin/make gnu_path
	touch sgi

alpha_linux:	gnomad.c
	legion_make -a alpha_linux usr_local_path
	touch alpha_linux

	legion_register_program /home/grimshaw/gnomad ./gnomad $(LEGION_ARCH)

	rm -f gnomad solaris ibm sgi intel alpha_linux

	legion_run -IN ribo.x -IN ribo.d -IN params -OUT tmaplow -OUT tmapfinal gnomad ribo

Other relevant on-line documents:
Click on the to go to the page.
Logging in to a running Legion system
Introduction to Legion context space
Context-related commands
Legion tty objects
Running a PVM code in Legion
Running a Legion MPI code
Running native MPI code
Quick list of all 1.7 Legion commands
Usage of all 1.7 Legion commands
FAQs for running programs in Legion
Starting a new Legion system
Legion security
Legion host and vault objects
Adding host and vault objects
Brief descriptions of all on-line tutorials

Last modified: Wed Jun 9 15:03:39 1999


[Home] [General] [Documentation] [Software]
[Testbeds] [Et Cetera] [Map/Search]