bjornedstrom / python-sha3

Python implementation of FIPS SHA3 and SHAKE
Other
44 stars 20 forks source link

Issue when build this code #3

Closed zhaodelong closed 8 years ago

zhaodelong commented 8 years ago

My linux terminal met this issue and freeze at the last line when I try to install this.

root@peds-csc-gurwlp:~/python-sha3# python setup.py build running build running build_py creating build creating build/lib.linux-i686-2.7 creating build/lib.linux-i686-2.7/sha3 copying sha3/init.py -> build/lib.linux-i686-2.7/sha3 running build_ext building '_sha3' extension creating build/temp.linux-i686-2.7 creating build/temp.linux-i686-2.7/src i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c sha3.c -o build/temp.linux-i686-2.7/sha3.o sha3.c: In function ‘init_sha3’: sha3.c:324:26: warning: unused variable ‘st’ [-Wunused-variable] struct module_state *st = GETSTATE(module); ^ i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/KeccakHash.c -o build/temp.linux-i686-2.7/src/KeccakHash.o i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/KeccakSponge.c -o build/temp.linux-i686-2.7/src/KeccakSponge.o i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/KeccakF-1600-opt64.c -o build/temp.linux-i686-2.7/src/KeccakF-1600-opt64.o

bjornedstrom commented 8 years ago

Cool, thanks! It's probably related to the 64 bit specific code. I will have a look about making it build regardless of machine architecture.

zhaodelong commented 8 years ago

Finally it finished built and installed. It's working. It seems it's only send the warning message but still works.

bjornedstrom commented 8 years ago

Oh cool. Yeah it's a bit slow to build because it's heavily unrolled. I will anyhow when time permits look into adding options for building a more portable (less optimized) version.

bjornedstrom commented 8 years ago

@zhaodelong: Could you try to build again, changing

src/KeccakF-1600-opt64-settings.h

from

#define FullUnrolling

to

#define Unrolling 6

And see how much faster it takes to build? Thanks :-)

zhaodelong commented 8 years ago

I tried to build again. It's better. Thanks.

But still have this warning sha3.c:324:26: warning: unused variable ‘st’ [-Wunused-variable] struct module_state *st = GETSTATE(module); ^

here is the screen

root@denon:~/python-sha3# python setup.py build running build running build_py creating build creating build/lib.linux-i686-2.7 creating build/lib.linux-i686-2.7/sha3 copying sha3/init.py -> build/lib.linux-i686-2.7/sha3 running build_ext building '_sha3' extension creating build/temp.linux-i686-2.7 creating build/temp.linux-i686-2.7/src creating build/temp.linux-i686-2.7/src/64 i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Isrc/ -Isrc/64 -I/usr/include/python2.7 -c sha3.c -o build/temp.linux-i686-2.7/sha3.o sha3.c: In function ‘init_sha3’: sha3.c:324:26: warning: unused variable ‘st’ [-Wunused-variable] struct module_state *st = GETSTATE(module); ^ i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Isrc/ -Isrc/64 -I/usr/include/python2.7 -c src/KeccakHash.c -o build/temp.linux-i686-2.7/src/KeccakHash.o i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Isrc/ -Isrc/64 -I/usr/include/python2.7 -c src/KeccakSponge.c -o build/temp.linux-i686-2.7/src/KeccakSponge.o i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Isrc/ -Isrc/64 -I/usr/include/python2.7 -c src/64/KeccakF-1600-opt64.c -o build/temp.linux-i686-2.7/src/64/KeccakF-1600-opt64.o i586-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-i686-2.7/sha3.o build/temp.linux-i686-2.7/src/KeccakHash.o build/temp.linux-i686-2.7/src/KeccakSponge.o build/temp.linux-i686-2.7/src/64/KeccakF-1600-opt64.o -o build/lib.linux-i686-2.7/_sha3.so root@denon:~/python-sha3# python setup.py install running install running build running build_py running build_ext running install_lib copying build/lib.linux-i686-2.7/_sha3.so -> /usr/local/lib/python2.7/dist-packages creating /usr/local/lib/python2.7/dist-packages/sha3 copying build/lib.linux-i686-2.7/sha3/init.py -> /usr/local/lib/python2.7/dist-packages/sha3 byte-compiling /usr/local/lib/python2.7/dist-packages/sha3/init.py to init.pyc running install_egg_info Writing /usr/local/lib/python2.7/dist-packages/_sha3-0.2.egg-info root@denon:~/python-sha3