SpecOMP
From gem5
					
										
					
					How to run SpecOMP on M5
-  build cross-compiler
- download crosstool-0.43.tar.gz from http://kegel.com/crosstool/#download (http://kegel.com/crosstool/crosstool-0.43.tar.gz)
- untar it
-  edit demo-alpha.sh
- RESULT_TOP="your_alpha_compiler"
- GCC_LANGUAGE="c,c++" --> GCC_LANGUAGE="c,c++,fortran"
- eval `cat ...dat ...dat` sh all.sh --> eval `cat alpha.dat gcc-4.2.4-glibc-2.3.6-tls.dat` sh all.sh --notest
 
- set gcc to gcc-3.4 instead of gcc-4.3 (when I use gcc-4.3 to build the cross-compiler, there is a segmentation fault)
- run demo-alpha.sh
- there may be some errors (a header file (.h) missing " or some things like that). You can modify the files directly and fix these errors.
-  after you modify the files, you should change demo-alpha.sh again
-  eval `cat alpha.dat gcc-4.2.4-glibc-2.3.6-tls.dat` sh all.sh --notest --> eval `cat alpha.dat gcc-4.2.4-glibc-2.3.6-tls.dat` sh all.sh --nounpack -notest
- --nounpack flag avoids downloading the source again to overwrite you modification
 
 
-  eval `cat alpha.dat gcc-4.2.4-glibc-2.3.6-tls.dat` sh all.sh --notest --> eval `cat alpha.dat gcc-4.2.4-glibc-2.3.6-tls.dat` sh all.sh --nounpack -notest
- get a new cross-compiler for alpha supports openmp
 
-  compile SpecOmp
- because runspec may not work in M5, I compile the source directly
 - install specomp by following its document
- change directory to benchspec
-  edit Makefile.defaults
- LIBS=-Lyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/lib
- CC=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gcc
- CFLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_CFLAGS) $(PORTABILITY) $(CPORTABILITY) -fopenmp -O3
- CXX=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gcc
- FC=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gfortran
- FFLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_FFLAGS) $(PORTABILITY) $(FPORTABILITY) -fopenmp -O3
- F77FLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_FFLAGS) $(PORTABILITY) $(FPORTABILITY) -fopenmp -O3
- LD=$(CC) $(CFLAGS) -Lyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/lib -fopenmp -O3
 
- change directory to OMPM2001/3xx.xxxx/src (e.g., 320.equake/src)
- make and get the binary for alpha
- the list which can be compiled without error: wupwise, swim, applu, equake, apsi, gafort (however, there is a segmentation fault during execution), art, ammp
 
-  put files into images
- copy all files and directories from your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/alpha-unknown-linux-gnu/lib to /lib of the linux image for M5 (e.g., linux-latest.img)
- copy the executables and input files of SpecOmp to another image and set it as the third disk image of M5
 
-  run specomp
- run M5
- mount the image containing the files of specomp
- execute specomp executable with correspondent commands.
 
I am not very sure that I remember everything. However, the operation flow may help others who want to do the same thing. If there is any missing steps or mistakes, please correct me.
