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

error compiling with make on apple silicon Sonoma 14.2.1 #13

Open
godfriedt opened this issue Apr 21, 2024 · 1 comment
Open

error compiling with make on apple silicon Sonoma 14.2.1 #13

godfriedt opened this issue Apr 21, 2024 · 1 comment

Comments

@godfriedt
Copy link

[crxunch@mac] bruteforce-enigma % make crack_enigma     
clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated [-Wdeprecated]
Building build/bruteforce.o .../usr/bin/time: illegal option -- -
usage: time [-al] [-h | -p] [-o file] utility [argument ...]
make: *** [build/bruteforce.o] Error 1
@the-lambda-way
Copy link
Owner

Hi, I encountered this problem before on macOS (see Issue #5) and thought I had fixed it, but I guess Macs don't use the GNU time command at all. I don't have a Mac to test on, so

  • If you don't care about the cracking time, you can change the makefile where ever you see @$(TIME) --format=$(TIME_FORMAT) -- $(COMPILE) to @$(COMPILE).
  • If you want the cracking time you can either adjust $(TIME) --format=$(TIME_FORMAT) -- to a Mac-compatible timing command, if you know it, or
  • Install gtime, which is GNU-compatible like the time command on my system. In the makefile, replace TIME = /usr/bin/time with TIME = /usr/local/bin/gtime. I got this from a helpful AI generated response on Google.

The error message "usr/bin/time illegal option" means that you are trying to use an option with the time command that is not supported on macOS. The time command on macOS is a BSD-like command that does not accept all of the same options as the GNU time command.

If you need to use an option that is not supported by the macOS time command, you can use the gtime command instead. The gtime command is a GNU-compatible time command that is available on macOS through Homebrew.
To install gtime, open Terminal and run the following command:

brew install gtime

I don't know how to make the time command work across the three major OSes. If you figure out a good cross-platform solution, please let me know.

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