[Embench] New embench user - building the benchmarks

Paolo Savini paolo.savini at embecosm.com
Tue Feb 8 16:24:35 CET 2022


Hi David,

thank you for your email and sorry for the delay.

> Hello!  We’re new to embench and trying to bring it up on a RISC-V core we are designing at Harvey Mudd College.
This sounds very interesting. You should join the zoom Embench call on 
the 21st of February and meet the team.
>
> Is there documentation or an example script or Makefile of how to build embench for RISC-V?  We’d really like an example command that works out of the box, and also demonstrates eliminating library code and using preferred optimization flags, so we know we are benchmarking consistently with other reported results.
>
> We cloned the embench-iot repo and are attempting to build with:
>
> ./build_all.py --arch riscv32 --chip generic --board ri5cyverilator --cc riscv64-unknown-elf-gcc
>
> We get a bunch of undefined references listed below.  It looks like it might be prematurely trying to link.
>
> We tried adding some cflags shown below, and many of the benchmarks now build, but cubic, nbody, and st fail missing some math functions.  We tried adding --ldflags “-lm” but got error messages from build_all.
>
> ./build_all.py --arch riscv32 --chip generic --board ri5cyverilator --cflags “-O2 -nostartfiles -c” --cc riscv64-unknown-elf-gcc

Generally yes that's the way we call the script. Only we include the 
libraries (e.g. -lm) with --user-libs="-lm", not --ldflags.

This shouldn't be a problem but we are well aware that the scripts 
aren't perfect yet, and there's ongoing work to improve them.

As an example here is a command line used to generate the baseline results:

./build_all.py --arch riscv32 --chip generic --board ri5cyverilator --cc riscv32-unknown-elf-gcc --cflags="-c -O2 -ffunction-sections -march=rv32imc -mabi=ilp32" --ldflags="-Wl,-gc-sections" --user-libs="-lm"

As you can notice I put "=" to initialize --user-libs as you need to do 
with these arguments if you provide only one value in the quotes. You'd 
see the same errors if for instance you did --cflags "-c". The reason is 
in how the arguments are parsed. Detail that needs to be fixed.

Thanks for the input anyway, we always welcome active users and 
contributors.

Feel free to join the call on the 21st 4pm UTC if you are available. 
Here are the details:

Join Zoom Meeting
https://us02web.zoom.us/j/557006550?pwd=eTFJNWszZDZhMGRwOCs4RDY3ZTFYQT09

Meeting ID: 557 006 550
Passcode: 329513
One tap mobile
+442080806592,,557006550#,,,,*329513# United Kingdom
+443300885830,,557006550#,,,,*329513# United Kingdom

Dial by your location
         +44 208 080 6592 United Kingdom
         +44 330 088 5830 United Kingdom
         +44 131 460 1196 United Kingdom
         +44 203 481 5237 United Kingdom
         +44 203 481 5240 United Kingdom
         +44 203 901 7895 United Kingdom
         +44 208 080 6591 United Kingdom
         +1 253 215 8782 US (Tacoma)
         +1 301 715 8592 US (Washington DC)
         +1 312 626 6799 US (Chicago)
         +1 346 248 7799 US (Houston)
         +1 646 558 8656 US (New York)
         +1 669 900 9128 US (San Jose)
Meeting ID: 557 006 550
Passcode: 329513
Find your local number:https://us02web.zoom.us/u/kbsfJcZ8Ql


Best wishes

Paolo Savini


>
> Thank you!
>
> David Harris
>
>
> Warning: Compilation of main.c from source directory /home/harris/riscv-wally/addins/embench-iot
> /support to binary directory /home/harris/riscv-wally/addins/embench-iot/bd/support failed
> Command was:
> riscv64-unknown-elf-gcc -I/home/harris/riscv-wally/addins/embench-iot/support -I/home/harris/ris
> cv-wally/addins/embench-iot/config/riscv32/boards/ri5cyverilator -I/home/harris/riscv-wally/addi
> ns/embench-iot/config/riscv32/chips/generic -I/home/harris/riscv-wally/addins/embench-iot/config
> /riscv32 -DCPU_MHZ=1 -DWARMUP_HEAT=1 -o main.o /home/harris/riscv-wally/addins/embench-iot/suppo
> rt/main.c
>
> /opt/riscv/riscv-gnu-toolchain/lib/gcc/riscv64-unknown-elf/11.1.0/../../../../riscv64-unknown-el
> f/bin/ld: /tmp/cc5hnmDt.o: in function `main':
> main.c:(.text+0x12): undefined reference to `initialise_board'
> /opt/riscv/riscv-gnu-toolchain/lib/gcc/riscv64-unknown-elf/11.1.0/../../../../riscv64-unknown-el
> f/bin/ld: main.c:(.text+0x1a): undefined reference to `initialise_benchmark'
> /opt/riscv/riscv-gnu-toolchain/lib/gcc/riscv64-unknown-elf/11.1.0/../../../../riscv64-unknown-el
> f/bin/ld: main.c:(.text+0x24): undefined reference to `warm_caches'
> /opt/riscv/riscv-gnu-toolchain/lib/gcc/riscv64-unknown-elf/11.1.0/../../../../riscv64-unknown-el
> f/bin/ld: main.c:(.text+0x2c): undefined reference to `start_trigger'
> /opt/riscv/riscv-gnu-toolchain/lib/gcc/riscv64-unknown-elf/11.1.0/../../../../riscv64-unknown-el
> f/bin/ld: main.c:(.text+0x34): undefined reference to `benchmark'
> /opt/riscv/riscv-gnu-toolchain/lib/gcc/riscv64-unknown-elf/11.1.0/../../../../riscv64-unknown-el
> f/bin/ld: main.c:(.text+0x42): undefined reference to `stop_trigger'
> /opt/riscv/riscv-gnu-toolchain/lib/gcc/riscv64-unknown-elf/11.1.0/../../../../riscv64-unknown-el
> f/bin/ld: main.c:(.text+0x52): undefined reference to `verify_benchmark'
> collect2: error: ld returned 1 exit status
>
> Compilation of benchmark "aha-mont64" successful
> Warning: Unable to find support library /home/harris/riscv-wally/addins/embench-iot/bd/support/m
> ain.o
> Warning: Link of benchmark "aha-mont64" failed
>
> riscv64-unknown-elf-gcc: fatal error: no input files
> compilation terminated.
>
> In directory "/home/harris/riscv-wally/addins/embench-iot/bd/src/aha-mont64"
> Command was:
> riscv64-unknown-elf-gcc -o aha-mont64
> Warning: Compilation of crc_32.c from source directory /home/harris/riscv-wally/addins/embench-i
> ot/src/crc32 to binary directory /home/harris/riscv-wally/addins/embench-iot/bd/src/crc32 failed
> Command was:
> riscv64-unknown-elf-gcc -I/home/harris/riscv-wally/addins/embench-iot/support -I/home/harris/ris
> cv-wally/addins/embench-iot/config/riscv32/boards/ri5cyverilator -I/home/harris/riscv-wally/addi
> ns/embench-iot/config/riscv32/chips/generic -I/home/harris/riscv-wally/addins/embench-iot/config
> /riscv32 -DCPU_MHZ=1 -DWARMUP_HEAT=1 -o crc_32.o /home/harris/riscv-wally/addins/embench-iot/src
> /crc32/crc_32.c
>
> /opt/riscv/riscv-gnu-toolchain/lib/gcc/riscv64-unknown-elf/11.1.0/../../../../riscv64-unknown-el
> f/bin/ld: /opt/riscv/riscv-gnu-toolchain/lib/gcc/riscv64-unknown-elf/11.1.0/../../../../riscv64-
> unknown-elf/lib/crt0.o: in function `.L0 ':
> (.text+0x38): undefined reference to `main'
> /opt/riscv/riscv-gnu-toolchain/lib/gcc/riscv64-unknown-elf/11.1.0/../../../../riscv64-unknown-el
> f/bin/ld: /tmp/ccQ4pL57.o: in function `.L3':
> crc_32.c:(.text+0x16): undefined reference to `rand_beebs'
> /opt/riscv/riscv-gnu-toolchain/lib/gcc/riscv64-unknown-elf/11.1.0/../../../../riscv64-unknown-el
> f/bin/ld: /tmp/ccQ4pL57.o: in function `benchmark_body':
> crc_32.c:(.text+0xd0): undefined reference to `srand_beebs'
> collect2: error: ld returned 1 exit status
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.librecores.org/pipermail/embench/attachments/20220208/2f64cada/attachment.htm>


More information about the Embench mailing list