Comments (14)
Hi @Francis-zlh
能提供一下具体的 repro steps 吗
from yacl.
links@links-virtual-machine:~/yacl/yacl-main$ bazel build //... -c opt
Starting local Bazel server and connecting to it...
INFO: Analyzed 218 targets (110 packages loaded, 9500 targets configured).
INFO: Found 218 targets...
ERROR: /home/links/yacl/yacl-main/yacl/crypto/utils/BUILD.bazel:19:16: Compiling yacl/crypto/utils/rand.cc failed: (Exit 1): gcc failed: error executing command (from target //yacl/crypto/utils:rand) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 46 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from ./yacl/crypto/utils/rand.h:27,
from yacl/crypto/utils/rand.cc:15:
./yacl/base/dynamic_bitset.h: In instantiation of 'constexpr yacl::dynamic_bitset<Block, Allocator>::dynamic_bitset(yacl::dynamic_bitset<Block, Allocator>::size_type, uint128_t, const allocator_type&) [with Block = __int128 unsigned; Allocator = std::allocator<__int128 unsigned>; yacl::dynamic_bitset<Block, Allocator>::size_type = long unsigned int; uint128_t = __int128 unsigned; yacl::dynamic_bitset<Block, Allocator>::allocator_type = std::allocator<__int128 unsigned>]':
yacl/crypto/utils/rand.cc:156:1: required from here
./yacl/base/dynamic_bitset.h:2294:20: error: division by zero is not a constant expression
2294 | constexpr size_t init_val_required_blocks = u128_bits_number/bits_per_block;
| ^~~~~~~~~~~~~~~~~~~~~~~~
INFO: Elapsed time: 20.630s, Critical Path: 13.60s
INFO: 13 processes: 13 internal.
FAILED: Build did NOT complete successfully
我尝试过把static constexpr size_type bits_per_block = std::numeric_limits<block_type>::digits;修改为
static constexpr size_type bits_per_block = 128;之后编译成功,并且tpre_test可以正常运行
from yacl.
麻烦提供一下 gcc 版本
from yacl.
使用过13.2.0和10.3.0均报错
from yacl.
我们目前用的 11.2~11.4,你试一下
from yacl.
inks@links-virtual-machine:/yacl/yacl-main$ gcc -v/yacl/yacl-main$ bazel build //... -c opt
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/11.4.0/lto-wrapper
目标:x86_64-pc-linux-gnu
配置为:../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
线程模型:posix
Supported LTO compression algorithms: zlib
gcc 版本 11.4.0 (GCC)
links@links-virtual-machine:
INFO: Analyzed 218 targets (0 packages loaded, 0 targets configured).
INFO: Found 218 targets...
ERROR: /home/links/yacl/yacl-main/yacl/crypto/utils/BUILD.bazel:19:16: Compiling yacl/crypto/utils/rand.cc failed: (Exit 1): gcc failed: error executing command (from target //yacl/crypto/utils:rand) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 46 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from ./yacl/crypto/utils/rand.h:27,
from yacl/crypto/utils/rand.cc:15:
./yacl/base/dynamic_bitset.h: In instantiation of 'constexpr yacl::dynamic_bitset<Block, Allocator>::dynamic_bitset(yacl::dynamic_bitset<Block, Allocator>::size_type, uint128_t, const allocator_type&) [with Block = __int128 unsigned; Allocator = std::allocator<__int128 unsigned>; yacl::dynamic_bitset<Block, Allocator>::size_type = long unsigned int; uint128_t = __int128 unsigned; yacl::dynamic_bitset<Block, Allocator>::allocator_type = std::allocator<__int128 unsigned>]':
yacl/crypto/utils/rand.cc:156:1: required from here
./yacl/base/dynamic_bitset.h:2295:20: error: division by zero is not a constant expression
2295 | constexpr size_t init_val_required_blocks = u128_bits_number/bits_per_block;
| ^~~~~~~~~~~~~~~~~~~~~~~~
INFO: Elapsed time: 10.391s, Critical Path: 9.09s
INFO: 13 processes: 13 internal.
FAILED: Build did NOT complete successfully
我更换了gcc11.4以后依然有这个问题😂
from yacl.
Interesting, 请问一下你的 OS 信息还有 gcc 是怎么安装的
from yacl.
我不太明白OS信息是如何安装的,gcc是通过下载gcc的release后通过下述命令安装
./contrib/download_prerequisites
./configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
make
make install
from yacl.
这是我GCC下载来源https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-11.4.0
from yacl.
就是你 linux 用的是哪个发行版?比如 Ubuntu 22.04, Centos 8 这样
from yacl.
ubuntu 20.04
from yacl.
请用包管理器来安装 gcc
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update && sudo apt install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 --slave /usr/bin/cpp cpp /usr/bin/cpp-11;
然后确定一下
gcc -v
返回的是 11
from yacl.
非常感谢您的帮助,现在已经编译成功。
--slave /usr/bin/cpp cpp /usr/bin/cpp-11应该要和其他的命令分开使用,否则会报错
还是gcc的版本的问题,但是不懂为什么release的不行😂
再次感谢您的帮助!
from yacl.
非常感谢您的帮助,现在已经编译成功。 --slave /usr/bin/cpp cpp /usr/bin/cpp-11应该要和其他的命令分开使用,否则会报错 还是gcc的版本的问题,但是不懂为什么release的不行😂 再次感谢您的帮助!
自己编译 gcc 容易缺东西,比如 libstdc++ 之类的
from yacl.
Related Issues (20)
- Feat: Allow saving/reading cuckoo hashing table to/from a csv file
- Problems in ferret_ote HOT 9
- A small problem in gadget HOT 5
- [Bug]: gcc13 编译时,会报一些数据类型未定义 HOT 5
- Problems in kkrt_ote HOT 3
- Problem in softspoken_ote HOT 5
- 在 YACL 中实现 Kyber OT 协议 HOT 2
- WSL-Ubuntu20.04编译Yacl(bazel build //... -c dbg)报错: HOT 2
- A problem in yacl/kernels/svole_kernel.cc HOT 1
- Problem in yacl/crypto/ossl-provider/helper.h HOT 2
- 建议:ContextDescProto的repeated PartyProto parties排序处理 HOT 1
- yacl/crypto/tpre/kdf的问题 HOT 2
- Windows x86_64 platform support HOT 2
- 编译问题 HOT 24
- 编译问题报错 ld.lld: error: undefined symbol: dlopen HOT 7
- [Question]: Pack before comparison HOT 1
- Problem in Sm4Drbg HOT 3
- 关于yacl编译后的安装问题。
- The enforcement in `bristol_fashion` is not precise HOT 3
- Request for Efficient Prime Field $\mathbb{F}_p$ Implementation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yacl.