Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation of relic fails with “size of array element is not a multiple of its alignment” #29

Open
gnull opened this issue May 29, 2021 · 4 comments

Comments

@gnull
Copy link

gnull commented May 29, 2021

I was trying to compile the current ENCRYPTO_utils master (331c22f) and got this error while compiling relic.

To reproduce the error, I ran

mkdir build
cd build
cmake ..
make

from the project root.

@gnull
Copy link
Author

gnull commented May 29, 2021

Interestingly, if I

  1. upgrade to the latest version of relic by

    cd extern/relic
    git checkout main
    git pull
    
  2. and then comment out the lines

    set(DEBUG off CACHE BOOL "Build relic with debugging support")
    set(PROFL off CACHE BOOL "Build relic with profiling support")
    set(CHECK off CACHE BOOL "Build relic with error-checking support")
    set(ALIGN "16" CACHE STRING "Relic align")
    set(ARCH "X64" CACHE STRING "Architecture to be used in relic")
    set(ARITH "curve2251-sse" CACHE STRING "arithmetic utils used in relic")
    set(FB_POLYN ${ecclvl} CACHE INTEGER "security level of the ecc binary curve in relic")
    set(FB_METHD "INTEG;INTEG;QUICK;QUICK;QUICK;QUICK;LOWER;SLIDE;QUICK" CACHE STRING "Methods for fb in relic")
    set(FB_PRECO on CACHE BOOl "fb preco for relic")
    set(FB_SQRTF off CACHE BOOL "sqrtf for relic")
    set(EB_METHD "PROJC;LODAH;COMBS;INTER" CACHE STRING "Methods for eb in relic")
    set(EC_METHD "CHAR2" CACHE STRING "Methods for ec in relic")
    set(COMP "-O3 -funroll-loops -fomit-frame-pointer -march=core2 -msse4.2 -mpclmul" CACHE STRING "Relic compiler options")
    set(TIMER "CYCLE" CACHE STRING "Relic timer")
    set(WITH "MD;DV;BN;FB;EB;EC" CACHE STRING "Relic algorithms")
    set(WSIZE "64" CACHE STRING "Relic word size in bits")
    set(TESTS "0" CACHE STRING "Relic amount of random tests, 0 for disable")
    set(BENCH "0" CACHE STRING "Relic amount of benchmarks on random values, 0 for disable")
    set(SHLIB off CACHE BOOL "Relic shared library")
    set(STLIB on CACHE BOOL "Relic static library")

    in CMakeLists.txt,

the compilation succeeds.

Hope this helps.

@gnull
Copy link
Author

gnull commented May 29, 2021

Also, if I only upgrade relic to main but don't comment out the mentioned lines, I get a “target specific option mismatch” error. It could be related to relic-toolkit/relic#177.

But I'm almost sure this isn't a relic bug, because I can compile relic with cmake .. && make on my machine. Could something be wrong with the compile options that ENCRYPTO_utils uses to build relic?

@TKussel
Copy link

TKussel commented Jun 17, 2021

This problem is known and fixed with recent relic commits: relic-toolkit/relic#202
Please consider updating the relic submodule.

@hros
Copy link

hros commented May 27, 2022

I am facing the same problem in another project (OTExtension) that depends on this project.
It is failing in the same place while compiling relic.
Any chance of updating the relic dependency in this project, otherwise building this project and other dependent projects would need workaround in the build scrips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants