计算化学公社

标题: (问题已解决)abacus 3.10 LTS gnu编译失败 [打印本页]

作者
Author:
qczcb2    时间: 2025-5-3 16:43
标题: (问题已解决)abacus 3.10 LTS gnu编译失败
本帖最后由 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 !
"""


作者
Author:
Stardust0831    时间: 2025-5-3 22:10
参考https://github.com/deepmodeling/abacus-develop/issues/5518
或加入abacus用户群,QQ群:759914681
作者
Author:
qczcb2    时间: 2025-5-4 10:37
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.





欢迎光临 计算化学公社 (http://ccc.keinsci.com/) Powered by Discuz! X3.3