PARSEC 3.0 Installation & Solution for Build Error

The Princeton Application Repository for Shared-Memory Computers (PARSEC) is a benchmark suite composed of multithreaded programs. The suite focuses on emerging workloads and was designed to be representative of next-generation shared-memory programs for chip-multiprocessors.

우선 설치에 필요한 기본 패키지를 설치한다.

$sudo apt-get install make gcc g++ m4 libxi-dev libxmu-dev libxt-dev libxext-dev libx11-dev libtbb-dev pkg-config gettext

PARSEC을 다운받아 압축 해제한다.

$wget http://parsec.cs.princeton.edu/download/3.0/parsec-3.0.tar.gz
$tar -xzvf ./parsec-3.0.tar.gz

다음 명령어로 PARSEC을 설치할 수 있다.

$cd ./parsec-3.0
$./env.sh
$parsecmgmt -a build -p blackscholes bodytrack canneal dedup facesim ferret fluidanimate freqmine raytrace streamcluster swaptions vips x264

 

ferret, raytrace, dedup의 빌드 과정에서 에러가 발생했으며,
아래와 같이 해결할 수 있었다.

1. Solution for Ferret Build Error
Ferret 빌드 과정에서 다음과 같은 에러가 발생한다. texinfo 프로그램의 버전 차이로 인한 문제인 듯 하다.

/home/gumdaeng/.Programs/parsec-3.0/pkgs/libs/gsl/src/doc/rng.texi:1394: warning: @itemize has text but no @item
/home/gumdaeng/.Programs/parsec-3.0/pkgs/libs/gsl/src/doc/qrng.texi:157: warning: @itemize has text but no @item
/home/gumdaeng/.Programs/parsec-3.0/pkgs/libs/gsl/src/doc/multimin.texi:137: must be after `@deftypefun' to use `@deftypefunx'
/home/gumdaeng/.Programs/parsec-3.0/pkgs/libs/gsl/src/doc/bspline.texi:151: warning: @itemize has text but no @item
make[2]: *** [/home/gumdaeng/.Programs/parsec-3.0/pkgs/libs/gsl/src/doc/gsl-ref.info] Error 1
make[2]: Leaving directory `/home/gumdaeng/.Programs/parsec-3.0/pkgs/libs/gsl/obj/amd64-linux.gcc/doc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/gumdaeng/.Programs/parsec-3.0/pkgs/libs/gsl/obj/amd64-linux.gcc'
make: *** [all] Error 2
[PARSEC] Error: 'env LIBS= -lm /usr/bin/make' failed.

 

이를 해결하기 위해서는 에러 메시지에서 보이는 파일들을 올바르게 수정해주면 된다.

./parsec-3.0/pkgs/libs/gsl/src/doc/rng.texi
./parsec-3.0/pkgs/libs/gsl/src/doc/qrng.texi
./parsec-3.0/pkgs/libs/gsl/src/doc/multimin.texi
./parsec-3.0/pkgs/libs/gsl/src/doc/bspline.texi

 

1) ./parsec-3.0/pkgs/libs/gsl/src/doc/rng.texi:1394

@itemize @asis
@item
P. L'Ecuyer, ``Random Number Generation'', Chapter 4 of the
Handbook on Simulation, Jerry Banks Ed., Wiley, 1998, 93--137.

 

2) ./parsec-3.0/pkgs/libs/gsl/src/doc/qrng.texi:157

@itemize @asis
@item
P. Bratley and B.L. Fox and H. Niederreiter, ``Algorithm 738: Programs
to Generate Niederreiter's Low-discrepancy Sequences'', @cite{ACM
Transactions on Mathematical Software}, Vol.@: 20, No.@: 4, December, 1994,
p.@: 494--495.
@end itemize

 

3) ./parsec-3.0/pkgs/libs/gsl/src/doc/multimin.texi:137

@deftypefun int gsl_multimin_fminimizer_set (gsl_multimin_fminimizer * @var{s}, gsl_multimin_function * @var{f}, const gsl_vector *
 @var{x}, const gsl_vector * @var{step_size})
@deftypefunx int gsl_multimin_fminimizer_set (gsl_multimin_fminimizer * @var{s}, gsl_multimin_function * @var{f}, const gsl_vector
* @var{x}, const gsl_vector * @var{step_size})
This function initializes the minimizer @var{s} to minimize the function
@var{f}, starting from the initial point
@var{x}. The size of the initial trial steps is given in vector
@var{step_size}. The precise meaning of this parameter depends on the
method used.
@end deftypefun

 

4) ./parsec-3.0/pkgs/libs/gsl/src/doc/bspline.texi:151

@itemize @asis
@item
C. de Boor, @cite{A Practical Guide to Splines} (1978), Springer-Verlag,
ISBN 0-387-90356-9.
@end itemize

 

2. Solution for Raytrace Build Error
Raytrace 워크로드 빌드 이전에 아래의 패키지를 설치해야 한다.

$sudo apt-get install libxi-dev libxmu-dev libxt-dev libxext-dev libx11-dev

./pkgs/apps/raytrace/src/RTTL/common/MapOptions.hxx 파일에 다음 코드를 추가해야 한다[12].

#include <unistd.h>

변경하지 않으면 다음과 같은 에러가 발생한다.

make[2]: *** [RTTL/CMakeFiles/RTTL.dir/common/MapOptions.o] Error 1
make[2]: Leaving directory `/home/gumdaeng/.Programs/parsec-3.0/pkgs/apps/raytrace/obj/amd64-linux.gcc'
make[1]: *** [RTTL/CMakeFiles/RTTL.dir/all] Error 2
make[1]: Leaving directory `/home/gumdaeng/.Programs/parsec-3.0/pkgs/apps/raytrace/obj/amd64-linux.gcc'
make: *** [all] Error 2
[PARSEC] Error: 'env version=pthreads CXXFLAGS=-I/home/gumdaeng/.Programs/parsec-3.0/pkgs/libs/mesa/inst/amd64-linux.gcc/include -O3 -g -funroll-loops -fprefetch-loop-arrays -fpermissive -fno-exceptions -static-libgcc -Wl,--hash-style=both,--as-needed -DPARSEC_VERSION=3.0-beta-20120904 -fexceptions -fno-strict-aliasing -fno-align-labels -DNDEBUG -D_MM_NO_ALIGN_CHECK LDFLAGS=-L/home/gumdaeng/.Programs/parsec-3.0/pkgs/libs/mesa/inst/amd64-linux.gcc/lib -L/usr/lib64 -L/usr/lib LIBS= -lGL -lGLU -lXmu -lXext -lXau -lX11 -ldl -lpthread /usr/bin/make' failed.

 

3. Solution for Dedup Build Error
dedup을 빌드하는 과정에서는 다음과 같은 에러가 발생한다.

md5-x86_64.s: Assembler messages:
md5-x86_64.s:41: Error: 0xd76aa478 out range of signed 32bit displacement
md5-x86_64.s:50: Error: 0xe8c7b756 out range of signed 32bit displacement
md5-x86_64.s:68: Error: 0xc1bdceee out range of signed 32bit displacement
md5-x86_64.s:77: Error: 0xf57c0faf out range of signed 32bit displacement
md5-x86_64.s:95: Error: 0xa8304613 out range of signed 32bit displacement
md5-x86_64.s:104: Error: 0xfd469501 out range of signed 32bit displacement
md5-x86_64.s:122: Error: 0x8b44f7af out range of signed 32bit displacement
md5-x86_64.s:131: Error: 0xffff5bb1 out range of signed 32bit displacement
md5-x86_64.s:140: Error: 0x895cd7be out range of signed 32bit displacement
md5-x86_64.s:158: Error: 0xfd987193 out range of signed 32bit displacement
md5-x86_64.s:167: Error: 0xa679438e out range of signed 32bit displacement
md5-x86_64.s:187: Error: 0xf61e2562 out range of signed 32bit displacement
md5-x86_64.s:196: Error: 0xc040b340 out range of signed 32bit displacement
md5-x86_64.s:214: Error: 0xe9b6c7aa out range of signed 32bit displacement
md5-x86_64.s:223: Error: 0xd62f105d out range of signed 32bit displacement
md5-x86_64.s:241: Error: 0xd8a1e681 out range of signed 32bit displacement
md5-x86_64.s:250: Error: 0xe7d3fbc8 out range of signed 32bit displacement
md5-x86_64.s:268: Error: 0xc33707d6 out range of signed 32bit displacement
md5-x86_64.s:277: Error: 0xf4d50d87 out range of signed 32bit displacement
md5-x86_64.s:295: Error: 0xa9e3e905 out range of signed 32bit displacement
md5-x86_64.s:304: Error: 0xfcefa3f8 out range of signed 32bit displacement
md5-x86_64.s:322: Error: 0x8d2a4c8a out range of signed 32bit displacement
md5-x86_64.s:332: Error: 0xfffa3942 out range of signed 32bit displacement
md5-x86_64.s:340: Error: 0x8771f681 out range of signed 32bit displacement
md5-x86_64.s:356: Error: 0xfde5380c out range of signed 32bit displacement
md5-x86_64.s:364: Error: 0xa4beea44 out range of signed 32bit displacement
md5-x86_64.s:380: Error: 0xf6bb4b60 out range of signed 32bit displacement
md5-x86_64.s:388: Error: 0xbebfbc70 out range of signed 32bit displacement
md5-x86_64.s:404: Error: 0xeaa127fa out range of signed 32bit displacement
md5-x86_64.s:412: Error: 0xd4ef3085 out range of signed 32bit displacement
md5-x86_64.s:428: Error: 0xd9d4d039 out range of signed 32bit displacement
md5-x86_64.s:436: Error: 0xe6db99e5 out range of signed 32bit displacement
md5-x86_64.s:452: Error: 0xc4ac5665 out range of signed 32bit displacement
md5-x86_64.s:463: Error: 0xf4292244 out range of signed 32bit displacement
md5-x86_64.s:481: Error: 0xab9423a7 out range of signed 32bit displacement
md5-x86_64.s:490: Error: 0xfc93a039 out range of signed 32bit displacement
md5-x86_64.s:508: Error: 0x8f0ccc92 out range of signed 32bit displacement
md5-x86_64.s:517: Error: 0xffeff47d out range of signed 32bit displacement
md5-x86_64.s:526: Error: 0x85845dd1 out range of signed 32bit displacement
md5-x86_64.s:544: Error: 0xfe2ce6e0 out range of signed 32bit displacement
md5-x86_64.s:553: Error: 0xa3014314 out range of signed 32bit displacement
md5-x86_64.s:571: Error: 0xf7537e82 out range of signed 32bit displacement
md5-x86_64.s:580: Error: 0xbd3af235 out range of signed 32bit displacement
md5-x86_64.s:598: Error: 0xeb86d391 out range of signed 32bit displacement
make[2]: *** [md5-x86_64.o] Error 1
make[2]: Leaving directory `/home/gumdaeng/tmp/parsec-3.0/pkgs/libs/ssl/obj/amd64-linux.gcc/crypto/md5'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/gumdaeng/tmp/parsec-3.0/pkgs/libs/ssl/obj/amd64-linux.gcc/crypto'
make: *** [build_crypto] Error 1
[PARSEC] Error: 'env PATH=/usr/bin:/home/gumdaeng/tmp/parsec-3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/gumdaeng/.Programs/parsec-3.0/bin /usr/bin/make' failed.

[3]에는 OpenSSL의 소스 코드를 교체해주면 된다고 쓰여 있지만, 내 실험 환경에서는 이것으로 문제를 해결할 수 없었다.

 

문제는 크게 세 가지였는데,
1) PARSEC 3.0에서 사용하는 perl 코드에 버그가 있는 것[5]. (gcc의 변경으로 인한 버그)
– ./parsec-3.0/pkgs/libs/ssl/src/crypto/md5/asm/md5-x86_64.pl [6]
– ./parsec-3.0/pkgs/libs/ssl/src/crypto/sha/asm/sha1-x86_64.pl [7]
2) PARSEC 3.0에서 사용하는 pod 파일에 버그가 있는 것.
3) parsec-3.0/pkgs/kernels/dedup/src/encoder.c 파일을 수정해야 하는 것.

 

구체적으로 아래와 같이 문제를 해결할 수 있다.

1) PARSEC 3.0에서 사용하는 perl 코드에 버그가 있는 것[5] (gcc의 변경으로 인한 버그)
diff 명령의 결과가 아래와 같도록 md5-x86_64.pl, sha1-x86_64.pl를 수정한다.
수정된 md5-x86_64sha1-x86_64 다운로드
(우클릭으로 다운받은 다음, 확장자를 .pl로 변경)

./parsec-3.0/pkgs/libs/ssl/src/crypto/md5/asm/md5-x86_64.pl

$diff -ur original_md5-x86_64.pl modified_md5-x86_64.pl
@@ -19,6 +19,7 @@
 sub round1_step
 {
 my ($pos, $dst, $x, $y, $z, $k_next, $T_i, $s) = @_;
+ $T_i = unpack("l",pack("l", hex($T_i))); # convert to 32-bit signed decimal
 $code .= " mov 0*4(%rsi), %r10d /* (NEXT STEP) X[0] */\n" if ($pos == -1);
 $code .= " mov %edx, %r11d /* (NEXT STEP) z' = %edx */\n" if ($pos == -1);
 $code .= <<EOF;
@@ -42,6 +43,7 @@
 sub round2_step
 {
 my ($pos, $dst, $x, $y, $z, $k_next, $T_i, $s) = @_;
+ $T_i = unpack("l",pack("l", hex($T_i))); # convert to 32-bit signed decimal
 $code .= " mov 1*4(%rsi), %r10d /* (NEXT STEP) X[1] */\n" if ($pos == -1);
 $code .= " mov %ecx, %r11d /* (NEXT STEP) y' = %ecx */\n" if ($pos == -1);
 $code .= <<EOF;
@@ -65,6 +67,7 @@
 sub round3_step
 {
 my ($pos, $dst, $x, $y, $z, $k_next, $T_i, $s) = @_;
+ $T_i = unpack("l",pack("l", hex($T_i))); # convert to 32-bit signed decimal
 $code .= " mov 5*4(%rsi), %r10d /* (NEXT STEP) X[5] */\n" if ($pos == -1);
 $code .= " mov %ecx, %r11d /* (NEXT STEP) y' = %ecx */\n" if ($pos == -1);
 $code .= <<EOF;
@@ -87,6 +90,7 @@
 sub round4_step
 {
 my ($pos, $dst, $x, $y, $z, $k_next, $T_i, $s) = @_;
+ $T_i = unpack("l",pack("l", hex($T_i))); # convert to 32-bit signed decimal
 $code .= " mov 0*4(%rsi), %r10d /* (NEXT STEP) X[0] */\n" if ($pos == -1);
 $code .= " mov \$0xffffffff, %r11d\n" if ($pos == -1);
 $code .= " xor %edx, %r11d /* (NEXT STEP) not z' = not %edx*/\n"

./parsec-3.0/pkgs/libs/ssl/src/crypto/sha/asm/sha1-x86_64.pl

$diff -ur original_sha1-x86_64.pl modified_sha1-x86_64.pl
@@ -143,7 +143,7 @@
 sub BODY_20_39 {
 my ($i,$a,$b,$c,$d,$e,$f)=@_;
 my $j=$i+1;
-my $K=($i<40)?0x6ed9eba1:0xca62c1d6;
+my $K=($i<40)?0x6ed9eba1:0x359d3e2a;
 $code.=<<___ if ($i<79);
 	lea	$K($xi,$e),$f
 	mov	`4*($j%16)`(%rsp),$xi
@@ -180,7 +180,7 @@
 my ($i,$a,$b,$c,$d,$e,$f)=@_;
 my $j=$i+1;
 $code.=<<___;
-	lea	0x8f1bbcdc($xi,$e),$f
+	lea	0x70e44324($xi,$e),$f
 	mov	`4*($j%16)`(%rsp),$xi
 	mov	$b,$t0
 	mov	$b,$t1

 

2) PARSEC 3.0에서 사용하는 pod 파일에 버그가 있는 것
[9]에 있는 것처럼, OpenSSL의 pod 파일을 수정해 주어야 한다.
=item 0와 같이 되어 있는 것을 =item C와 같이 바꾼다.
./parsec-3.0 디렉토리 아래에서 다음 쉘 스크립트를 실행하면 된다.

FILES=./pkgs/libs/ssl/src/doc/apps/*.pod
for f in $FILES
do
  echo "Processing $f file..."
  sed 's/\=item\ \([0-9]\)/\=item\ C<\1>/g' $f > tmp
  cat tmp > $f
  rm tmp
done

FILES=./pkgs/libs/ssl/src/doc/ssl/*.pod
for f in $FILES
do
  echo "Processing $f file..."
  sed 's/\=item\ \([0-9]\)/\=item\ C<\1>/g' $f > tmp
  cat tmp > $f
  rm tmp
done

 

3) parsec-3.0/pkgs/kernels/dedup/src/encoder.c 파일을 수정해야 하는 것.
[10]에 나와 있듯이,  parsec-3.0/pkgs/kernels/dedup/src/encoder.c에 #include 를 추가한다.

#include <strings.h>
#include <math.h>
#include <limits.h>
#include <sys/stat.h> // + Added line
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>

 

References :
[1] Princeton University, PARSEC, http://parsec.cs.princeton.edu/
[2] Christian Bienia, Kai Li, The PARSEC Benchmark Suite Tutorial, http://parsec.cs.princeton.edu/download/tutorial/2.0/parsec-2.0-tutorial.pdf
[3] Abhishek Sagar, PARSEC : md5-x86_64.s:41: Error: 0xd76aa478 out range of signed 32bit displacement, http://abhishek-sagar.blogspot.kr/2012/06/parsec-md5-x8664s41-error-0xd76aa478.html
[4] OpenSSL, http://www.openssl.org/source/
[5] [parsec-users] Trouble building dedup, https://lists.cs.princeton.edu/pipermail/parsec-users/2011-October/001250.html
[6] #2094: BUG: 0.9.8x md5-x86_64.s:41: Error: 0xd76aa478 out range of signed 32bit displacement, http://rt.openssl.org/Ticket/Display.html?id=2094
[7] #2095: BUG: sha1-x86_64: out range of signed 32bit displacement, http://rt.openssl.org/Ticket/Display.html?id=2095
[8] Documentation fixes for openssl-1.0.1g (Ubuntu 14.04), https://github.com/openssl/openssl/issues/57
[9]  martensms / 1.0.1g-docfixes-diff.patch, https://gist.github.com/martensms/10107481
[10] [parsec-users] I was unable to build parsec.dedup package of parsec 3.0 with gcc on ubuntu 12.04, https://lists.cs.princeton.edu/pipermail/parsec-users/2013-January/001487.html
[11] PARSEC man page, http://parsec.cs.princeton.edu/doc/man/
[12] parsec-3.0beta raytrace compile error, https://lists.cs.princeton.edu/pipermail/parsec-users/2012-September/001427.html

Advertisements
Tagged with: , , ,
Posted in 2) Computer Engineering

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

누적 방문자 수
  • 93,229 hits
%d bloggers like this: