A-1.0 Sample makefile

The sample makefile in Figure 12, below, is for both legacy and Legion-aware programs that will be executed with either legion_run or legion_run_multi. The sample 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 (here in /home/grimshaw).

Sample makefile for legacy and Legion-aware programs

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

Directory of Legion 1.8 Manuals
[Home] [General] [Documentation] [Software]
[Testbeds] [Et Cetera] [Map/Search]

Free JavaScripts provided by The JavaScript Source