Skip to content

Instantly share code, notes, and snippets.

@cyyself
Last active November 9, 2023 07:46
Show Gist options
  • Save cyyself/4cee148ad11081dde7b938e3584b4536 to your computer and use it in GitHub Desktop.
Save cyyself/4cee148ad11081dde7b938e3584b4536 to your computer and use it in GitHub Desktop.

Build SPECCPU 2017 Tools for LoongArch64

Tested on LoongArch Archlinux (2023-10-09).

Fix config.guess

wget -O config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
wget -O config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
cp config.* ./make-4.2.1/config/
cp config.* ./tar-1.28/build-aux/
cp config.* ./specsum/build-aux/
cp config.* ./specinvoke/
cp config.* ./rxp-1.5.0/
cp config.* ./expat-2.1.0/conftools/
cp config.* ./xz-5.2.2/build-aux/

Fix glob

sed -i 's/_GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION/_GNU_GLOB_INTERFACE_VERSION >= GLOB_INTERFACE_VERSION/g' make-4.2.1/glob/glob.c

ref: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00027.html

Fix run_make_tests.pl

sed -i 's/require \"/require \".\//g' make-4.2.1/tests/run_make_tests.pl

ref: https://lists.gnu.org/archive/html/bug-make/2017-03/msg00040.html

Fix specmake

sed -i 's/gl->gl_stat = local_stat;/gl->gl_stat = local_stat;\n  gl->gl_lstat = lstat;/g' make-4.2.1/dir.c

ref: https://jia.je/software/2023/08/02/spec-cpu-2006/#%E5%85%B6%E4%BB%96-isa

Warning: The related error will only happen on specmake runtime. You will not see errors during compilation if you do not apply this patch.

Fix miniperl

sed -i 's/1\*)/1.\*)/g' perl-5.24.0/Configure

ref: https://jia.je/software/2023/08/02/spec-cpu-2006/#%E5%85%B6%E4%BB%96-isa

Fix gettime.t

sed -i 's/timegm(0,0,0,1,0,70)/timegm(0,0,0,1,0,1970)/g' TimeDate-2.30/t/getdate.t

ref: Perl/perl5#16431

Failed

lib/Tie/Scalar ................................................ ok
lib/Tie/SubstrHash ............................................ ok
lib/Time/gmtime ............................................... ok
lib/Time/localtime ............................................ ok
lib/Unicode/UCD ............................................... ok
lib/User/grent ................................................ ok
lib/User/pwent ................................................ ok
lib/utf8 ...................................................... ok
lib/vars_carp ................................................. ok
lib/vars ...................................................... ok
lib/vmsish .................................................... ok
lib/warnings .................................................. ok
Failed 2 tests out of 2243, 99.91% okay.
        ../cpan/Time-Local/t/Local.t
        ../ext/GDBM_File/t/fatal.t
### Since not all tests were successful, you may want to run some of
### them individually and examine any diagnostic messages they produce.
### See the INSTALL document's section on "make test".
### You have a good chance to get more information by running
###   ./perl harness
### in the 't' directory since most (>=80%) of the tests succeeded.
### You may have to set your dynamic library search path,
### LD_LIBRARY_PATH, to point to the build directory:
###   setenv LD_LIBRARY_PATH `pwd`:$LD_LIBRARY_PATH; cd t; ./perl harness
###   LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd t; ./perl harness
###   export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; cd t; ./perl harness
### for csh-style shells, like tcsh; or for traditional/modern
### Bourne-style shells, like bash, ksh, and zsh, respectively.
Elapsed: 511 sec
u=5.35  s=1.11  cu=258.17  cs=11.92  scripts=2243  tests=850960
make: *** [makefile:812: test] Error 1
+ '[' 2 -ne 0 ']'
+ set +x


Hey!  Some of the Perl tests failed!
If you think this is okay, enter y now:

Press y and continue.

Package

cd ../../
mkdir config
source shrc
packagetools linux-loongarch64

Fix omnetpp error

Add the the following lines to Benchmark-specific portability in spec/config/$YOURCONFIG.cfg.

520.omnetpp_r:
   CXXPORTABILITY = -Wno-error=register -std=c++14

Ref: ccelio/Speckle#21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment