使用gcc13编译netcdf4.1.3中遇到的问题总结

下载链接:netcdf的github链接

相关依赖

除了GCC, netcdf4.1.3还需要zlib,texinfo,hdf5等依赖库。

module purge                                        
module load GCC/13.2.0                              
module load zlib/1.2.13-GCCcore-13.2.0
module load usr/hdf5/1.8.10
module load usr/texinfo/6.3

其中zlib使用系统自带,texinfo和hdf5都是从官网下载编译。

代码修改

目前的texinfo 6.3标准和文档中的texinfo标准不同,因此需要修改

报错信息

netcdf-f90.texi:2085: warning: @item missing argument
netcdf-f90.texi:6982: raising the section level of @unnumberedsubsec which is
too low

修改内容

--- man4/netcdf-f90.texi        (revision 57)
+++ man4/netcdf-f90.texi        (working copy)
@@ -2127,7 +2127,6 @@
 The name of the
 group will be copied to this character array. The name will be less
 than NF90_MAX_NAME in length.
-@item
 
 @end table
 
@@ -7023,7 +7022,7 @@
 @node FORTRAN 77 to Fortran 90 Transition Guide, Combined Index, Summary of 
Fortran 90 Interface, Top
 @appendix Appendix B - FORTRAN 77 to Fortran 90 Transition Guide
 
-@unnumberedsubsec The new Fortran 90 interface 
+@unnumberedsec The new Fortran 90 interface 
 
 The Fortran 90 interface to the netCDF library closely follows the
 FORTRAN 77 interface. In most cases, function and constant names and
@@ -7045,7 +7044,7 @@
 versions may be implemented entirely in Fortran 90, adding additional
 error checking possibilities.
 
-@unnumberedsubsec Changes to Inquiry functions 
+@unnumberedsec Changes to Inquiry functions 
 
 In the Fortran 90 interface there are two inquiry functions each for
 dimensions, variables, and attributes, and a single inquiry function
@@ -7079,7 +7078,7 @@
  INTEGER FUNCTION  NF_INQ_ATTNAME    (NCID, VARID, ATTNUM, name)
 @end example
 
-@unnumberedsubsec Changes to put and get function 
+@unnumberedsec Changes to put and get function 

将man4/netcdf-f90.texi中的@item 去掉,@unumberedsubsec 改成@unumberedsec。

添加FLAGS

报错信息

Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)

解决方法

在configure前配置FLAGS如下:

export CFLAGS="-O2 -Wno-error -std=legacy"
export CXXFLAGS="-O2 -Wno-error -std=legacy"

export FFLAGS="-fallow-argument-mismatch -fallow-invalid-boz -m64 -std=legacy"
export FCFLAGS="-fallow-argument-mismatch -fallow-invalid-boz -m64 -std=legacy"

本质是因为新版gcc放弃了对应比较老的fortran接口,但是使用上述FLAGS能够以兼容模式运行GCC。

文章标题:使用gcc13编译netcdf4.1.3中遇到的问题总结
文章作者:Myron
转载链接:https://sunwaybits.tech/use-gcc13-compile-netcdf4-1-3-legacy-flag.html
暂无评论

发送评论 编辑评论


				
😃
😄
😁
😆
😅
😂
🤣
🥲
😊
😇
🙂
🙃
😉
😌
😍
🥰
😘
😗
😙
😚
😋
😛
😝
😜
🤪
🤨
🧐
🤓
😎
🥸
🤩
🥳
😏
😒
😞
😔
😟
😕
🙁
😣
😖
😫
😩
🥺
😢
😭
😤
😠
😡
🤬
🤯
😳
🥵
🥶
😱
😨
😰
😥
😓
🤗
🤔
🤭
🤫
🤥
😶
😐
😑
😬
🙄
Emoji
上一篇