I am seeking assistance with an error I encountered while building OpenFHE on a Windows system using MinGW64. Below are the details of my setup and the error message.
I followed the instructions here:
Steps I followed:
- download MSYS2
- start MSYS2 MINGW64
- pacman –Syu
- pacman –S mingw-w64-x86_64-gcc
- pacman –S mingw-w64-x86_64-cmake
- pacman –S make
- pcaman –S git
- git clone GitHub - openfheorg/openfhe-development: This is the development repository for the OpenFHE library. The current (stable) version is v1.2.0 (released on June 25, 2024).
- cd openfhe-development
- mkdir build
- cd build
- cmake … (something reports ‘failed’)
- pacman -S autoconf
- make –j
Error Message: While running the make
command, I encountered the following error:
In file included from C:/msys64/mingw64/include/c++/14.1.0/bits/stl_uninitialized.h:63,
from C:/msys64/mingw64/include/c++/14.1.0/memory:69,
from C:/msys64/home/TechSavyy/openfhe-development/src/pke/include/encoding/coefpackedencoding.h:40,
from C:/msys64/home/TechSavyy/openfhe-development/src/pke/lib/encoding/coefpackedencoding.cpp:36:
In static member function ‘static _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = long long unsigned int; _Up = long long unsigned int; bool _IsMove = false]’,
inlined from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = long long unsigned int*; _OI = long long unsigned int*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl_algobase.h:521:30,
inlined from ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = long long unsigned int*; _OI = long long unsigned int*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl_algobase.h:548:42,
inlined from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = long long unsigned int*; _OI = long long unsigned int*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl_algobase.h:555:31,
inlined from ‘std::copy(_II, _II, _OI) [with _II = long long unsigned int*; _OI = long long unsigned int*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl_algobase.h:651:7,
inlined from ‘static _ForwardIterator std::__uninitialized_copy::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = long long unsigned int*; _ForwardIterator = long long unsigned int*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl_uninitialized.h:147:27,
inlined from ‘std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = long long unsigned int*; _ForwardIterator = long long unsigned int*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl_uninitialized.h:185:15,
inlined from ‘std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = long long unsigned int*; _ForwardIterator = long long unsigned int*; _Tp = long long unsigned int]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl_uninitialized.h:373:37,
inlined from ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long unsigned int; _Alloc = std::allocator]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/vector.tcc:257:35,
inlined from ‘bigintdyn::ubint<limb_t>& bigintdyn::ubint<limb_t>::operator=(const bigintdyn::ubint<limb_t>&) [with limb_t = long long unsigned int]’ at C:/msys64/home/TechSavyy/openfhe-development/src/core/include/math/hal/bigintdyn/ubintdyn.h:230:17,
inlined from ‘void lbcrypto::encodeVec(P&, const PlaintextModulus&, int64_t, int64_t, const std::vector&, SCHEME) [with P = PolyImpl<bigintdyn::mubintvec<bigintdyn::ubint > >]’ at C:/msys64/home/TechSavyy/openfhe-development/src/pke/lib/encoding/coefpackedencoding.cpp:67:17,
inlined from ‘virtual bool lbcrypto::CoefPackedEncoding::Encode()’ at C:/msys64/home/TechSavyy/openfhe-development/src/pke/lib/encoding/coefpackedencoding.cpp:85:18:
C:/msys64/mingw64/include/c++/14.1.0/bits/stl_algobase.h:452:30: error: ‘void* __builtin_memmove(void*, const void*, long long unsigned int)’ forming offset 8 is out of the bounds [0, 8] [-Werror=array-bounds=]
452 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
| ~~~~~~~~~~~~~~~~~~~~~~~^
cc1plus.exe: all warnings being treated as errors
make[2]: *** [src/pke/CMakeFiles/pkeobj.dir/build.make:167: src/pke/CMakeFiles/pkeobj.dir/lib/encoding/coefpackedencoding.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:841: src/pke/CMakeFiles/pkeobj.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Could anyone provide guidance on how to resolve this error? Any help or pointers would be greatly appreciated.