Skip to content

fix: Update DieHard build to use CMake and correct library path#223

Merged
jvoisin merged 2 commits intodaanx:masterfrom
XueSongTap:master
May 25, 2025
Merged

fix: Update DieHard build to use CMake and correct library path#223
jvoisin merged 2 commits intodaanx:masterfrom
XueSongTap:master

Conversation

@XueSongTap
Copy link
Copy Markdown
Contributor

fix: Update DieHard build to use CMake and correct library path

  • Replace Makefile-based build with CMake (matches upstream)
  • Fix library path from src/libdieharder.so to src/build/libdieharder.so
  • Remove directory stack manipulation to fix popd error

Fixes #222

self test:

yxc@yxc-MS-7B89:~/code/2505/mimalloc-bench_dev$ ./build-bench-env.sh bench dh

building with 16 threads
--------------------------------------------
--------------------------------------------
build dh: version master
--------------------------------------------
~/code/2505/mimalloc-bench_dev/extern ~/code/2505/mimalloc-bench_dev
Cloning into 'dh'...
remote: Enumerating objects: 3091, done.
remote: Counting objects: 100% (117/117), done.
remote: Compressing objects: 100% (87/87), done.
remote: Total 3091 (delta 60), reused 66 (delta 30), pack-reused 2974 (from 1)
Receiving objects: 100% (3091/3091), 38.56 MiB | 7.66 MiB/s, done.
Resolving deltas: 100% (1338/1338), done.
Already on 'master'
Your branch is up to date with 'origin/master'.
[100%] Linking C executable espresso
[100%] Built target espresso


--------------------------------------------
installed allocators
--------------------------------------------

dh:   master,  975a067,   https://github.com/emeryberger/DieHard
lua:  v5.4.7,  1ab3208a,  https://github.com/lua/lua

--------------------------------------------
done in /home/yxc/code/2505/mimalloc-bench_dev
--------------------------------------------

run the cfrac benchmarks as:
> cd out/bench
> ../../bench.sh alla cfrac

to see all options use:
> ../../bench.sh help
yxc@yxc-MS-7B89:~/code/2505/mimalloc-bench_dev$ cd out/bench
yxc@yxc-MS-7B89:~/code/2505/mimalloc-bench_dev/out/bench$ ../../bench.sh alla cfrac
benchmarking on 16 cores.
use '-h' or '--help' for help on configuration options.

allocators:  sys dh
tests     :  cfrac
(excluded tests:  lean lean-mathlib)

---- 1: cfrac

run 1: cfrac sys: SYSMALLOC=1 ./cfrac 17545186520507317056371138836327483792789528
cfrac       sys   0:06.29 2900 6.28 0.00 0 424

run 1: cfrac dh: LD_PRELOAD=/home/yxc/code/2505/mimalloc-bench_dev/extern/dh/src/build/libdieharder.so ./cfrac 17545186520507317056371138836327483792789528
cfrac       dh    0:12.25 9496 12.24 0.00 0 1384

results written to: /home/yxc/code/2505/mimalloc-bench_dev/out/bench/benchres.csv

#------------------------------------------------------------------
# test    alloc   time  rss    user  sys  page-faults page-reclaims
cfrac       sys   06.29 2900 6.28 0.00 0 424
cfrac       dh    12.25 9496 12.24 0.00 0 1384

Signed-off-by: yexiaochuan <tap91624@gmail.com>
Comment thread build-bench-env.sh Outdated
Signed-off-by: yexiaochuan <tap91624@gmail.com>
@jvoisin jvoisin merged commit bf083fd into daanx:master May 25, 2025
2 of 4 checks passed
@jvoisin
Copy link
Copy Markdown
Collaborator

jvoisin commented May 25, 2025

Thanks!

derSteFfi pushed a commit to derSteFfi/mimalloc-bench that referenced this pull request Jul 1, 2025
…x#223)

* fix: Update DieHard build to use CMake and correct library path

Signed-off-by: yexiaochuan <tap91624@gmail.com>
derSteFfi pushed a commit to derSteFfi/mimalloc-bench that referenced this pull request Jul 18, 2025
…x#223)

* fix: Update DieHard build to use CMake and correct library path

Signed-off-by: yexiaochuan <tap91624@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix DieHard build

2 participants