ssvb / tinymembench

Simple benchmark for memory throughput and latency

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues running under FreeBSD 11

snigel opened this issue · comments

Tried running tinymembench under FreeBSD 11.

Firstly:

$ make
make: "/home/adam/tinymembench-master/Makefile" line 3: Need an operator
make: "/home/adam/tinymembench-master/Makefile" line 5: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /home/adam/tinymembench-master`

The solution to this was running gmake instead of make.

Secondly:

$ gmake
cc -O2 -c util.c
cc -O2 -c asm-opt.c
cc -O2 -c x86-sse2.S
cc -O2 -c arm-neon.S
:2:1: error: unknown directive
.func aligned_block_read_neon
^
arm-neon.S:43:1: note: while in macro instantiation
asm_function aligned_block_read_neon
^
arm-neon.S:69:1: error: unknown directive
.endfunc`

This is due to clang not supporting those directives.
https://llvm.org/bugs/show_bug.cgi?id=20424

The solution to that was just setting CC = gcc in the make file, but maybe it's possible to omit the .func directives.

After this tinymembench compiles and runs, but it does not run the NEON/VFP/ARM benchmarks.

The problem is in asm-opt.c. The parse_proc_cpuinfo function cannot return sane results on FreeBSD since there is no proc filesystem, so the CPU defaults to ARMv4.
Hardcoding the bench_info *get_asm_benchmarks(void) function to return arm_neon indeed executes the asm benchmarks.

Thanks for your feedback. You can submit a patch to address these issues. Regarding the runtime CPU features detection in FreeBSD, what is the recommended method to do it there?