johanns / sha3

SHA3 for Ruby is a XKCP based native (C) binding to SHA3 (FIPS 202) cryptographic hashing algorithm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error whille Installing on Raspbian OS

x011 opened this issue · comments

commented

Hi there,
I've getting an error while installing sha3 gen on a raspeberry pi:

current directory: /var/lib/gems/2.3.0/gems/sha3-1.0.1/ext/sha3
/usr/bin/ruby2.3 -r ./siteconf20180309-2241-ivy7ku.rb extconf.rb
checking for sha3.h... yes
checking for digest.h... yes
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/var/lib/gems/2.3.0/extensions/arm-linux/2.3.0/sha3-1.0.1/mkmf.log

current directory: /var/lib/gems/2.3.0/gems/sha3-1.0.1/ext/sha3
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/sha3-1.0.1/ext/sha3
make "DESTDIR="
compiling KeccakF-1600-reference.c
gcc: error: unrecognized argument in option ‘-march=nocona’
gcc: note: valid arguments to ‘-march=’ are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j
armv6k armv6kz armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m armv7ve armv8-a armv8-a+crc armv8.1-a armv8.1-a+crc
iwmmxt iwmmxt2 native
Makefile:239: recipe for target 'KeccakF-1600-reference.o' failed
make: *** [KeccakF-1600-reference.o] Error 1

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0/gems/sha3-1.0.1 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/arm-linux/2.3.0/sha3-1.0.1/gem_make.out

An error occurred while installing sha3 (1.0.1), and Bundler cannot continue.
Make sure that gem install sha3 -v '1.0.1' succeeds before bundling.

Any idea how to solve this?

Hi @x011 Unfortunately, I'm out of town, and won't be able to investigate and/or add support for ARM CPU until this weekend. Meanwhile, this may help (note: I cannot test this):

gem install sha3 -v '1.0.1' -- --with-cflags=\"-O3 -g0 -march=native\"

Another option would be to clone, modify and build the project. If you decide to do this, you'll need to edit line 20 of extconf.rb found /ext/sha3 directory, removing -march=nocona from the file before building the gem.

Hello,

quite old but I ran in the same error. The command from johanns do not help. Any ideas?

Here is what I see on an raspberry pi 4:

_$ sudo gem install sha3 -v '1.0.1' --source 'https://rubygems.org/'
Building native extensions. This could take a while...
ERROR: Error installing sha3:
ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.7.0/gems/sha3-1.0.1/ext/sha3

/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20201118-9223-1snxz3z.rb extconf.rb
checking for sha3.h... yes
checking for digest.h... yes
creating Makefile

current directory: /var/lib/gems/2.7.0/gems/sha3-1.0.1/ext/sha3
make "DESTDIR=" clean

current directory: /var/lib/gems/2.7.0/gems/sha3-1.0.1/ext/sha3
make "DESTDIR="
compiling KeccakF-1600-reference.c
cc1: error: unknown value ‘nocona’ for ‘-march’
cc1: note: valid arguments are: armv8-a armv8.1-a armv8.2-a armv8.3-a armv8.4-a armv8.5-a armv8.6-a native
make: *** [Makefile:245: KeccakF-1600-reference.o] Error 1

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.7.0/gems/sha3-1.0.1 for inspection.
Results logged to /var/lib/gems/2.7.0/extensions/aarch64-linux/2.7.0/sha3-1.0.1/gem_make.out_

@StephanHarrer I'll add ARM CPU/Raspberry PI support as soon as I receive required hardware next week.

Released a new gem version (1.0.2) to address the native extension compilation issue on non-x86 CPUs (including Raspberry PI).