Closed Zhangdian825 closed 4 months ago
我觉得应该还是nvcc输入的c++标准的问题。我更新了cmakelist.txt设置cmake_cuda_standard 17,你再试试看? 如果你直接从build文件夹make pytroy_raw也会出这个错误吗? 另外你的cmake版本是多少?我这里是3.28.1
我pull了最新的代码,同时又将cmake版本本由Ubuntu:20.04系统默认的3.16版本升级到3.28.6,能正常编译过了,感谢!不过生成的python包名称为pytroy_raw.cpython-311-x86_64-linux-gnu.so,但是在test.py中import的名称为pytroy,需要将二者名称统一,不然后面python test.py执行会报错pytroy找不到的问题。
感谢大佬回复邮件,我看了一下我的环境,我的 g++/gcc 版本如下,我这边的显卡是3090的,和这个有关吗?在编译的过程中,我没有修改任何原有的脚本和代码。
g++ --version
g++.real (GCC) 11.3.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcc --version
gcc.real (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
显卡为:
nvidia-smi
Mon Jun 24 10:13:48 2024
+---------------------------------------------------------------------------------------+ | NVIDIA-SMI 535.171.04 Driver Version: 535.171.04 CUDA Version: 12.2 | |-----------------------------------------+----------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+======================+======================| | 0 NVIDIA GeForce RTX 3090 Off | 00000000:B1:00.0 Off | N/A | | 32% 43C P0 117W / 350W | 0MiB / 24576MiB | 2% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | No running processes found | +---------------------------------------------------------------------------------------+
`在Build python bindings.步骤时,出错了,步骤如下 1、cd troy-nova 2、mkdir -p build 3、cd pybind 4、bash develop.sh 按照上述步骤执行,报错信息如下 /data/mytest/cuda/troy-nova/pybind/../src/utils/box.cuh(55): error: argument list for class template "troy::utils::ConstPointer" is missing
/data/mytest/cuda/troy-nova/pybind/../src/utils/box.cuh(159): error: argument list for class template "troy::utils::ConstPointer" is missing
/data/mytest/cuda/troy-nova/pybind/../src/utils/box.cuh(160): error: argument list for class template "troy::utils::Pointer" is missing
/data/mytest/cuda/troy-nova/pybind/../src/utils/galois.cuh(19): error: namespace "std" has no member "shared_mutex"
/data/mytest/cuda/troy-nova/pybind/../src/utils/galois.cuh(42): error: namespace "std" has no member "shared_mutex"
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(23): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(23): error: this declaration has no storage class or type specifier
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(23): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(29): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(29): error: this declaration has no storage class or type specifier
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(29): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(30): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(30): error: this declaration has no storage class or type specifier
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(30): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(35): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(35): error: this declaration has no storage class or type specifier
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(35): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(39): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(39): error: this declaration has no storage class or type specifier
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(39): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(40): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(40): error: this declaration has no storage class or type specifier
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(40): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(63): error: identifier "base_tgamma" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(69): error: identifier "base_q_to_t_gammaconv" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(70): error: identifier "base_q_to_tconv" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(75): error: identifier "inv_gamma_modt" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(79): error: identifier "neg_inv_q_mod_tgamma" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/utils/rns_tool.cuh(80): error: identifier "prod_t_gamma_modq" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(20): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(20): error: this declaration has no storage class or type specifier
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(20): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(22): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(22): error: this declaration has no storage class or type specifier
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(22): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(23): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(23): error: this declaration has no storage class or type specifier
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(23): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(33): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(33): error: this declaration has no storage class or type specifier
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(33): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(34): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(34): error: this declaration has no storage class or type specifier
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(34): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(101): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(101): warning #3033-D: inline variables are a C++17 feature
Remark: The warnings can be suppressed with "-diag-suppress"
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(101): error: a nonstatic data member cannot be declared as inline
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(101): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(132): warning #12-D: parsing restarts here after previous syntax error
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(54): error: identifier "rnstool" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(62): error: identifier "plain_ntttables" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/context_data.cuh(66): error: identifier "galoistool" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/he_context.cuh(40): error: qualified name is not allowed
/data/mytest/cuda/troy-nova/pybind/../src/he_context.cuh(40): error: a nonstatic data member cannot be declared as inline
/data/mytest/cuda/troy-nova/pybind/../src/he_context.cuh(40): error: expected a ";"
/data/mytest/cuda/troy-nova/pybind/../src/he_context.cuh(81): warning #12-D: parsing restarts here after previous syntax error
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(58): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(58): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(66): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(66): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(75): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(75): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(82): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(82): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(90): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(90): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(97): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(97): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(106): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(106): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(113): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(113): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(122): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(122): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(129): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(129): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(137): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(137): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(144): error: namespace "std" has no member "optional"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(144): error: expected a ")"
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(60): error: identifier "parms_id" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(61): error: identifier "scale" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(61): error: identifier "destination" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(69): error: identifier "parms_id" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(69): error: identifier "scale" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(69): error: too many arguments in function call
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(77): error: identifier "parms_id" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(78): error: identifier "scale" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(78): error: identifier "destination" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(85): error: identifier "parms_id" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(85): error: identifier "scale" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(85): error: too many arguments in function call
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(92): error: identifier "parms_id" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(93): error: identifier "scale" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(93): error: identifier "destination" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(100): error: identifier "parms_id" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(100): error: identifier "scale" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(100): error: too many arguments in function call
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(108): error: identifier "parms_id" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(109): error: identifier "scale" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(109): error: identifier "destination" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(116): error: identifier "parms_id" is undefined
/data/mytest/cuda/troy-nova/pybind/../src/ckks_encoder.cuh(116): error: identifier "scale" is undefined `望解答,谢谢