Chia-Network / bls-signatures

BLS signatures in C++, using the blst library for BLS12-381
Apache License 2.0
298 stars 212 forks source link

BUG: Build fails on Fedora based system - blake2.h "error: size of array element is not a multiple of its alignment" #194

Closed Chewbakka-Wakka closed 3 years ago

Chewbakka-Wakka commented 3 years ago

py2pack fetch blspy py2pack generate blspy

I have then make a simple spec file as none exist on Fedora and attempted to build python-blspy.spec ... %build %py3_build

%install %py3_install

%check

%__python3 setup.py test

%pytest

%tox

...

[ 81%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/md/relic_md_blake2s.c.o In file included from /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2s-ref.c:18: /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:101:5: error: size of array element is not a multiple of its alignment 101 | blake2s_state S[8][1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:102:5: error: size of array element is not a multiple of its alignment 102 | blake2s_state R[1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:109:5: error: size of array element is not a multiple of its alignment 109 | blake2b_state S[4][1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:110:5: error: size of array element is not a multiple of its alignment 110 | blake2b_state R[1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2s-ref.c: In function ‘blake2s’: /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2s-ref.c:329:3: error: size of array element is not a multiple of its alignment 329 | blake2s_state S[1]; | ^~~~~ [ 82%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/md/relic_md_hmac.c.o [ 82%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/md/relic_md_kdf.c.o gmake[2]: [_deps/relic-build/src/CMakeFiles/relic_s.dir/build.make:2630: _deps/relic-build/src/CMakeFiles/relic_s.dir/md/blake2s-ref.c.o] Error 1 gmake[2]: Waiting for unfinished jobs.... In file included from /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/relic_md_blake2s.c:38: /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:101:5: error: size of array element is not a multiple of its alignment 101 | blake2s_state S[8][1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:102:5: error: size of array element is not a multiple of its alignment 102 | blake2s_state R[1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:109:5: error: size of array element is not a multiple of its alignment 109 | blake2b_state S[4][1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:110:5: error: size of array element is not a multiple of its alignment 110 | blake2b_state R[1]; | ^~~~~ gmake[2]: [_deps/relic-build/src/CMakeFiles/relic_s.dir/build.make:2643: _deps/relic-build/src/CMakeFiles/relic_s.dir/md/relic_md_blake2s.c.o] Error 1 gmake[1]: [CMakeFiles/Makefile2:338: _deps/relic-build/src/CMakeFiles/relic_s.dir/all] Error 2 gmake: * [Makefile:149: all] Error 2 Traceback (most recent call last): File "setup.py", line 206, in setup( File "/usr/lib/python3.8/site-packages/setuptools/init.py", line 144, in setup return distutils.core.setup(attrs) File "/usr/lib64/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib64/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib64/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib64/python3.8/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/usr/lib64/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib64/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "setup.py", line 38, in run self.build_extension(ext) File "setup.py", line 70, in build_extension subprocess.check_call( File "/usr/lib64/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j', '6']' returned non-zero exit status 2. error: Bad exit status from /var/tmp/rpm-tmp.umIiva (%build)

Chewbakka-Wakka commented 3 years ago

Latest release 1.0.2 I am still seeing this

madMAx43v3r commented 3 years ago

use gcc version <11

emlowe commented 3 years ago

I believe this was fixed with PR #207 was merged.

ckti commented 3 years ago

just re-tried building with gcc 11 and it's the same error as above

Chewbakka-Wakka commented 3 years ago

This issue has not been confirmed as fixed, this remains in 1.0.3. - Can you reopen please? As shown here: $ rpm -q gcc gcc-11.1.1-6.fc35.x86_64

[ 81%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/md/relic_md_blake2s.c.o In file included from /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2s-ref.c:18: /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:101:5: error: size of array element is not a multiple of its alignment 101 | blake2s_state S[8][1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:102:5: error: size of array element is not a multiple of its alignment 102 | blake2s_state R[1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:109:5: error: size of array element is not a multiple of its alignment 109 | blake2b_state S[4][1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:110:5: error: size of array element is not a multiple of its alignment 110 | blake2b_state R[1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2s-ref.c: In function ‘blake2s’: /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2s-ref.c:329:3: error: size of array element is not a multiple of its alignment 329 | blake2s_state S[1]; | ^~~~~ gmake[2]: [_deps/relic-build/src/CMakeFiles/relic_s.dir/build.make:2834: _deps/relic-build/src/CMakeFiles/relic_s.dir/md/blake2s-ref.c.o] Error 1 gmake[2]: Waiting for unfinished jobs.... [ 82%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/md/relic_md_hmac.c.o In file included from /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/relic_md_blake2s.c:38: /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:101:5: error: size of array element is not a multiple of its alignment 101 | blake2s_state S[8][1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:102:5: error: size of array element is not a multiple of its alignment 102 | blake2s_state R[1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:109:5: error: size of array element is not a multiple of its alignment 109 | blake2b_state S[4][1]; | ^~~~~ /home/ss/rpmbuild/BUILD/blspy-1.0.3/build/temp.linux-x86_64-3.8/_deps/relic-src/src/md/blake2.h:110:5: error: size of array element is not a multiple of its alignment 110 | blake2b_state R[1]; | ^~~~~ gmake[2]: [_deps/relic-build/src/CMakeFiles/relic_s.dir/build.make:2848: _deps/relic-build/src/CMakeFiles/relic_s.dir/md/relic_md_blake2s.c.o] Error 1 gmake[1]: [CMakeFiles/Makefile2:306: _deps/relic-build/src/CMakeFiles/relic_s.dir/all] Error 2 gmake: *** [Makefile:136: all] Error 2 Traceback (most recent call last): File "setup.py", line 206, in

hoffmang9 commented 3 years ago

Can you confirm that you actually have the 1.0.3 tag checked out? Also, what are the results of pip wheel .

Chewbakka-Wakka commented 3 years ago

Yes, I'm obtaining this from https://files.pythonhosted.org/packages/source/b/blspy/blspy-1.0.3.tar.gz or manually using git clone then pip wheel . This fails with an error. Can see attached. bls-error.txt

hoffmang9 commented 3 years ago

This is why we're assuming it is fixed - https://github.com/relic-toolkit/relic/issues/202

madMAx43v3r commented 3 years ago
set(ENV{RELIC_MAIN} "1")
add_subdirectory(lib/bls-signatures)

does the trick for us

hoffmang9 commented 3 years ago

We meant to update the Relic version specified in cmake but it slipped through the cracks. Will PR shortly.

That work around works.