Difference between revisions of "SpecOMP"

From gem5
Jump to: navigation, search
Line 1: Line 1:
 
How to run SpecOMP on M5
 
How to run SpecOMP on M5
 +
 +
  
 
A. build cross-compiler
 
A. build cross-compiler
 +
 
1. download crosstool-0.43.tar.gz from http://kegel.com/crosstool/#download (http://kegel.com/crosstool/crosstool-0.43.tar.gz)
 
1. download crosstool-0.43.tar.gz from http://kegel.com/crosstool/#download (http://kegel.com/crosstool/crosstool-0.43.tar.gz)
 +
 
2. untar it
 
2. untar it
 +
 
3. edit demo-alpha.sh
 
3. edit demo-alpha.sh
 +
 
-3.1 RESULT_TOP="your_alpha_compiler"
 
-3.1 RESULT_TOP="your_alpha_compiler"
 +
 
-3.2 GCC_LANGUAGE="c,c++" --> GCC_LANGUAGE="c,c++,fortran"
 
-3.2 GCC_LANGUAGE="c,c++" --> GCC_LANGUAGE="c,c++,fortran"
 +
 
-3.3 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
 
-3.3 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
 +
 
4. 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)
 
4. 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)
 +
 
5. run demo-alpha.sh
 
5. run demo-alpha.sh
 +
 
6. 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.
 
6. 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.
 +
 
7. after you modify the files, you should change demo-alpha.sh again
 
7. after you modify the files, you should change demo-alpha.sh again
 +
 
-7.1 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
 
-7.1 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
 
--nounpack flag avoids downloading the source again to overwrite you modification
 +
 
8. get a new cross-compiler for alpha supports openmp
 
8. get a new cross-compiler for alpha supports openmp
 +
 +
  
 
B. compile SpecOmp
 
B. compile SpecOmp
 +
 
because runspec may not work in M5, I compile the source directly
 
because runspec may not work in M5, I compile the source directly
 +
 
1. install specomp by following its document
 
1. install specomp by following its document
 +
 
2. change directory to benchspec
 
2. change directory to benchspec
 +
 
3. edit Makefile.defaults
 
3. edit Makefile.defaults
 +
 
-3.1 LIBS=-Lyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/lib
 
-3.1 LIBS=-Lyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/lib
 +
 
-3.2 CC=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gcc
 
-3.2 CC=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gcc
 +
 
-3.3 CFLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_CFLAGS) $(PORTABILITY) $(CPORTABILITY) -fopenmp -O3
 
-3.3 CFLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_CFLAGS) $(PORTABILITY) $(CPORTABILITY) -fopenmp -O3
 +
 
-3.4 CXX=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gcc
 
-3.4 CXX=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gcc
 +
 
-3.5 FC=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gfortran
 
-3.5 FC=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gfortran
 +
 
-3.6 FFLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_FFLAGS) $(PORTABILITY) $(FPORTABILITY) -fopenmp -O3
 
-3.6 FFLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_FFLAGS) $(PORTABILITY) $(FPORTABILITY) -fopenmp -O3
 +
 
-3.7 F77FLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_FFLAGS) $(PORTABILITY) $(FPORTABILITY) -fopenmp -O3
 
-3.7 F77FLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_FFLAGS) $(PORTABILITY) $(FPORTABILITY) -fopenmp -O3
 +
 
-3.8 LD=$(CC) $(CFLAGS) -Lyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/lib -fopenmp -O3
 
-3.8 LD=$(CC) $(CFLAGS) -Lyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/lib -fopenmp -O3
 +
 
4. change directory to OMPM2001/3xx.xxxx/src (e.g., 320.equake/src)
 
4. change directory to OMPM2001/3xx.xxxx/src (e.g., 320.equake/src)
 +
 
5. make and get the binary for alpha
 
5. make and get the binary for alpha
 +
 
6. the list which can be compiled without error: wupwise, swim, applu, equake, apsi, gafort (however, there is a segmentation fault during execution), art, ammp  
 
6. the list which can be compiled without error: wupwise, swim, applu, equake, apsi, gafort (however, there is a segmentation fault during execution), art, ammp  
 +
 +
  
 
C. put files into images
 
C. put files into images
 +
 
1. 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)
 
1. 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)
 +
 
2. copy the executables and input files of SpecOmp to another image and set it as the third disk image of M5
 
2. copy the executables and input files of SpecOmp to another image and set it as the third disk image of M5
 +
 +
  
 
D. run specomp
 
D. run specomp
 +
 
1. run M5
 
1. run M5
 +
 
2. mount the image containing the files of specomp
 
2. mount the image containing the files of specomp
 +
 
3. execute specomp executable with correspondent commands.
 
3. 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.
 
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.

Revision as of 11:06, 10 February 2009

How to run SpecOMP on M5


A. build cross-compiler

1. download crosstool-0.43.tar.gz from http://kegel.com/crosstool/#download (http://kegel.com/crosstool/crosstool-0.43.tar.gz)

2. untar it

3. edit demo-alpha.sh

-3.1 RESULT_TOP="your_alpha_compiler"

-3.2 GCC_LANGUAGE="c,c++" --> GCC_LANGUAGE="c,c++,fortran"

-3.3 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

4. 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)

5. run demo-alpha.sh

6. 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.

7. after you modify the files, you should change demo-alpha.sh again

-7.1 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

8. get a new cross-compiler for alpha supports openmp


B. compile SpecOmp

because runspec may not work in M5, I compile the source directly

1. install specomp by following its document

2. change directory to benchspec

3. edit Makefile.defaults

-3.1 LIBS=-Lyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/lib

-3.2 CC=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gcc

-3.3 CFLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_CFLAGS) $(PORTABILITY) $(CPORTABILITY) -fopenmp -O3

-3.4 CXX=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gcc

-3.5 FC=your_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/bin/alpha-unknown-linux-gnu-gfortran

-3.6 FFLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_FFLAGS) $(PORTABILITY) $(FPORTABILITY) -fopenmp -O3

-3.7 F77FLAGS=-Iyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/include $(EXTRA_FFLAGS) $(PORTABILITY) $(FPORTABILITY) -fopenmp -O3

-3.8 LD=$(CC) $(CFLAGS) -Lyour_alpha_compiler/gcc-4.2.4-glibc-2.3.6/alpha-unknown-linux-gnu/lib -fopenmp -O3

4. change directory to OMPM2001/3xx.xxxx/src (e.g., 320.equake/src)

5. make and get the binary for alpha

6. the list which can be compiled without error: wupwise, swim, applu, equake, apsi, gafort (however, there is a segmentation fault during execution), art, ammp


C. put files into images

1. 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)

2. copy the executables and input files of SpecOmp to another image and set it as the third disk image of M5


D. run specomp

1. run M5

2. mount the image containing the files of specomp

3. 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.