计算化学公社

 找回密码 Forget password
 注册 Register
Views: 529|回复 Reply: 2
打印 Print 上一主题 Last thread 下一主题 Next thread

[其它程序] (问题已解决)abacus 3.10 LTS gnu编译失败

[复制链接 Copy URL]

39

帖子

0

威望

1014

eV
积分
1053

Level 4 (黑子)

本帖最后由 qczcb2 于 2025-5-4 10:30 编辑

所用系统为debian-wsl2,使用toolchain安装,gcc版本14.2。toolchain通过后,在build阶段出现三次错误,如下所示。请问应该如何解决?
[ 45%] Building CXX object source/module_basis/module_pw/CMakeFiles/planewave.dir/pw_distributeg_method2.cpp.o
In file included from /home/qczcb2/abacus-develop-LTSv3.10.0/source/module_io/json_output/abacusjson.h:12,
                 from /home/qczcb2/abacus-develop-LTSv3.10.0/source/module_io/json_output/abacusjson.cpp:1:
/home/qczcb2/abacus-develop-LTSv3.10.0/toolchain/install/rapidjson-1.1.0/include/rapidjson/document.h: In member function ‘rapidjson::GenericStringRef<CharType>& rapidjson::GenericStringRef<CharType>::operator=(const rapidjson::GenericStringRef<CharType>&)’:
/home/qczcb2/abacus-develop-LTSv3.10.0/toolchain/install/rapidjson-1.1.0/include/rapidjson/document.h:319:82: error: assignment of read-only member ‘rapidjson::GenericStringRef<CharType>::length’
  319 |     GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
      |                                                                           ~~~~~~~^~~~~~~~~~~~
[ 45%] Building CXX object source/module_esolver/CMakeFiles/esolver.dir/esolver_fp.cpp.o
gmake[2]: *** [source/module_io/json_output/CMakeFiles/json_output.dir/build.make:79: source/module_io/json_output/CMakeFiles/json_output.dir/abacusjson.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2363: source/module_io/json_output/CMakeFiles/json_output.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....

[ 78%] Building CXX object source/module_io/CMakeFiles/io_basic.dir/write_proj_band_lcao.cpp.o
In file included from /home/qczcb2/abacus-develop-LTSv3.10.0/source/module_io/json_output/abacusjson.h:12,
                 from /home/qczcb2/abacus-develop-LTSv3.10.0/source/module_io/para_json.cpp:11:
/home/qczcb2/abacus-develop-LTSv3.10.0/toolchain/install/rapidjson-1.1.0/include/rapidjson/document.h: In member function ‘rapidjson::GenericStringRef<CharType>& rapidjson::GenericStringRef<CharType>::operator=(const rapidjson::GenericStringRef<CharType>&)’:
/home/qczcb2/abacus-develop-LTSv3.10.0/toolchain/install/rapidjson-1.1.0/include/rapidjson/document.h:319:82: error: assignment of read-only member ‘rapidjson::GenericStringRef<CharType>::length’
  319 |     GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
      |                                                                           ~~~~~~~^~~~~~~~~~~~
[ 78%] Built target io_advanced
[ 78%] Building CXX object source/module_io/CMakeFiles/io_basic.dir/nscf_fermi_surf.cpp.o
gmake[2]: *** [source/module_io/CMakeFiles/io_basic.dir/build.make:471: source/module_io/CMakeFiles/io_basic.dir/para_json.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....

gmake[1]: *** [CMakeFiles/Makefile2:2301: source/module_io/CMakeFiles/io_basic.dir/all] Error 2
[ 81%] Built target hamilt_lcao
gmake: *** [Makefile:136: all] Error 2
-- Install configuration: ""
========================== usage =========================
Done!
To use the installed ABACUS version
You need to source /home/qczcb2/abacus-develop-LTSv3.10.0/toolchain/abacus_env.sh first !
"""

329

帖子

3

威望

1759

eV
积分
2148

Level 5 (御坂)

2#
发表于 Post on 2025-5-3 22:10:03 | 只看该作者 Only view this author
参考https://github.com/deepmodeling/abacus-develop/issues/5518
或加入abacus用户群,QQ群:759914681

评分 Rate

参与人数
Participants 1
eV +4 收起 理由
Reason
JamesBourbon + 4 好物!

查看全部评分 View all ratings

39

帖子

0

威望

1014

eV
积分
1053

Level 4 (黑子)

3#
 楼主 Author| 发表于 Post on 2025-5-4 10:37:51 | 只看该作者 Only view this author
https://github.com/Tencent/rapidjson.git   git clone之后,修改toolchain/install/setup中的rapidjson路径为新下载的路径,
从 prepend_path CPATH "abacus-develop-LTSv3.10.0/toolchain/install/rapidjson-1.1.0"
      export CPATH="abacus-develop-LTSv3.10.0/toolchain/install/rapidjson-1.1.0":${CPATH}
改为
prepend_path CPATH "abacus-develop-LTSv3.10.0/toolchain/rapidjson/include"
export CPATH="abacus-develop-LTSv3.10.0/toolchain/rapidjson/include":${CPATH},顺利完成了编译:

                                                                                    
                              ABACUS v3.10.0

               Atomic-orbital Based Ab-initio Computation at UStc                    

                     Website: http://abacus.ustc.edu.cn/                             
               Documentation: https://abacus.deepmodeling.com/                       
                  Repository: https://github.com/abacusmodeling/abacus-develop      
                              https://github.com/deepmodeling/abacus-develop         
                      Commit: unknown

Sun May  4 10:36:21 2025
Can't find the INPUT file.

本版积分规则 Credits rule

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2025-8-15 21:54 , Processed in 0.250967 second(s), 21 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list