Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building problems on macOS #5

Closed
louy2 opened this issue Feb 29, 2020 · 3 comments
Closed

Building problems on macOS #5

louy2 opened this issue Feb 29, 2020 · 3 comments

Comments

@louy2
Copy link
Contributor

louy2 commented Feb 29, 2020

Documenting some problems I've had building this. In order of appearance.

OS: macOS Catalina 10.15.3

zsh: command not found: llvm-config

Fix: brew install llvm then export PATH="/usr/local/opt/llvm/bin:$PATH"

./vendor/xxhash/xxhash.h:663:10: fatal error: 'stdlib.h' file not found

Fix: Running xcode-select --install

benchmark.sh: line 86: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]

Fix: Use zsh ./benchmark.sh instead of bash ./benchmark.sh

uniq 2 huniq2-rust time: illegal option -- f
uniq 2 huniq2-rust usage: time [-lp] command.

Infinite loop.
Fix: Run brew install gnu-time then export PATH="/usr/local/opt/gnu-time/libexec/gnubin:$PATH"

Benchmark Result

uniq 1 huniq2-rust 0.09 10324
uniq 1 huniq1-c++  0.76 10824
uniq 1 awk-sys     0.66 23216
uniq 1 shell       1.37 52812

uniq 2 huniq2-rust 0.07 10324
uniq 2 huniq1-c++  1.06 10196
uniq 2 awk-sys     1.19 23224
uniq 2 shell       3.29 101620

uniq 5 huniq2-rust 0.25 10324
uniq 5 huniq1-c++  2.69 11992
uniq 5 awk-sys     3.12 23252
uniq 5 shell       9.75 247944

uniq 10 huniq2-rust 0.28 10344
uniq 10 huniq1-c++  5.13 11200
uniq 10 awk-sys     6.02 23212
uniq 10 shell       20.89 491792

uniq 50 huniq2-rust 1.34 10324
uniq 50 huniq1-c++  24.28 11044
uniq 50 awk-sys     29.55 23216
uniq 50 shell       120.39 2411632

Didn't wanna wait for the rest of it.

@koraa
Copy link
Owner

koraa commented Mar 1, 2020

The benchmarks do take a bit of patience; glad to see the results from other platforms confirm the claims…

Regarding your issues:

  1. Sure that is in the scope of this project? Seems like a general perquisite for building C code on OS X?
  2. Same here.
  3. Bash introduced associative arrays in version 4 – which was released 2009. How did you get your hands on a version of bash that's older than a decade? oO
  4. Yeah, unfortunately the script is gnu specific at the moment. I would welcome a PR porting it to OS X!

It's a bit unfortunate, that the benchmarks are the least advanced part of huniq at the moment…I do have some plans to improve the benchmarks a lot but I haven't had the time to deal with that yet.

@koraa
Copy link
Owner

koraa commented Mar 1, 2020

I've opened up a ticket on how to implement benchmarking properly, if you are interested: #8

@louy2
Copy link
Contributor Author

louy2 commented Mar 1, 2020

Bash introduced associative arrays in version 4 – which was released 2009. How did you get your hands on a version of bash that's older than a decade? oO

$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.

😆 macOS default bash

@louy2 louy2 closed this as completed Mar 3, 2020
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

No branches or pull requests

2 participants