Open sanpii opened 10 years ago
Hi, same issue on a Wheezy related with SSE2 instructions. Any tips?
export CC="gcc -msse2"; npm install scrypt-hash worked for me.
Another way to resolve this on Ubuntu 12 and node 4:
Check your gcc --version
. if it is below 4.8
then you need to do the following (update gcc to 4.8):
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update; sudo apt-get install gcc-4.8 g++-4.8
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
Now check gcc again, it should be:
root@c062b0b57054:/# gcc --version
gcc (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Now install scrypt-hash again:
root@c062b0b57054:/# npm i scrypt-hash@1.1.13
\
> scrypt-hash@1.1.13 install /node_modules/scrypt-hash
> node-gyp rebuild
make: Entering directory `/node_modules/scrypt-hash/build'
CC(target) Release/obj.target/scrypt/crypto_scrypt-sse.o
CXX(target) Release/obj.target/scrypt/node_scrypt.o
SOLINK_MODULE(target) Release/obj.target/scrypt.node
COPY Release/scrypt.node
make: Leaving directory `/node_modules/scrypt-hash/build'
scrypt-hash@1.1.13 node_modules/scrypt-hash
├── bindings@1.2.1
└── nan@2.0.9
root@c062b0b57054:/#
Ref http://ubuntuhandbook.org/index.php/2013/08/install-gcc-4-8-via-ppa-in-ubuntu-12-04-13-04/
$ sudo apt install build-essentials
Fixed the issue for me. I did not have make installed.
Build fails on Debian Stretch i386:
../crypto_scrypt-sse.c: In function ‘blkxor’: ../crypto_scrypt-sse.c:102:8: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi] D[i] = _mm_xor_si128(D[i], S[i]);
In file included from ../crypto_scrypt-sse.c:33:0: /usr/lib/gcc/i686-linux-gnu/6/include/emmintrin.h:1286:1: error: inlining failed in call to always_inline ‘_mm_xor_si128’: target specific option mismatch _mm_xor_si128 (__m128i __A, __m128i __B) ^~~~~~~~~~~~~ ../crypto_scrypt-sse.c:102:10: note: called from here D[i] = _mm_xor_si128(D[i], S[i]); ^~~~~~~~~~~~~~~~~~~~~~~~~ scrypt.target.mk:103: recipe for target 'Release/obj.target/scrypt/crypto_scrypt-sse.o' failed make: *** [Release/obj.target/scrypt/crypto_scrypt-sse.o] Error 1 make: Leaving directory '/home/mozsync/mozsync/fxa-auth-server/node_modules/scrypt-hash/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
builds successfully with export CFLAGS="-msse4.1"
The compilation failed on debian stable i386:
Of course, my CPU has sse2 flag: