simple-crypto / SCALib

Side-Channel Analysis Library
GNU Affero General Public License v3.0
74 stars 19 forks source link

Build error for Intel Xeon E5-2697 #153

Closed RafKarr closed 6 months ago

RafKarr commented 8 months ago

Describe the bug Build failed for Intel Xeon E5-2697

To Reproduce Build SCALib from repository with usual steps. Also tried make wheel_local without success.

Observed behavior

/home/SCALib/.cargo_build/release/build/blis-src-78c932744102424d/out/blis_x86_64-unknown-linux-gnu/kernels/haswell/3/sup/bli_gemmsup_rd_haswell_asm_d6x8m.c: In function ‘bli_dgemmsup_rd_haswell_asm_6x4m’:
  /home/SCALib/.cargo_build/release/build/blis-src-78c932744102424d/out/blis_x86_64-unknown-linux-gnu/kernels/haswell/3/sup/bli_gemmsup_rd_haswell_asm_s6x16n.c: In function ‘bli_sgemmsup_rd_haswell_asm_3x16n’:
  /home/SCALib/.cargo_build/release/build/blis-src-78c932744102424d/out/blis_x86_64-unknown-linux-gnu/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8m.c: In function ‘bli_dgemmsup_rv_haswell_asm_6x6m’:
  /home/SCALib/.cargo_build/release/build/blis-src-78c932744102424d/out/blis_x86_64-unknown-linux-gnu/kernels/haswell/3/sup/bli_gemmsup_rd_haswell_asm_d6x8m.c:1296:1: error: bp cannot be used in asm here
   }
   ^
  compilation terminated due to -Wfatal-errors.

Expected behavior Correct build

Environment (please complete the following information):

cassiersg commented 8 months ago

This issue appears to be caused by some interaction between C compiler version, C compiler flags and the BLIS library.

It appears that disabling lto and requiring the omission of frame pointers can be a fix (https://src.fedoraproject.org/rpms/blis/blob/rawhide/f/blis.spec https://bugzilla.redhat.com/show_bug.cgi?id=2041796 https://aur.archlinux.org/packages/blis#comment-853371). In order to see what is actually compiled, can you run CC_ENABLE_DEBUG_OUTPUT=1 make wheel_local ?

As a more direct workaround, you can build without using BLIS by removing lines 42-43 in setup.py. That may lead to slightly worse performance in some operations that heavily depend on matrix multiplications as it will use a less optimized matrix multiplication library -- perf is still ok, tough, and this is actually what we always do on windows and mac os.

RafKarr commented 8 months ago

I'm still having an issue with the compilation of cxx, but it is due to my old version of GCC that it does not implement entirely C++11, specifically type properties in the std library. Having a GCC > 5 should fix this. Maybe you should put this in the requirements ? I think that after this it should work, but I can't verify it at the moment because of IT bureaucracy. I'm sorry. Nevertheless, the new release in PIP works perfectly

RafKarr commented 6 months ago

Could use GCC > 5 and problem was fixed. Closing issue.