用gdb调试gfortran:w_powf.c:没有这样的文件或目录 [英] gfortran debugging with gdb: w_powf.c: No such file or directory

查看:737
本文介绍了用gdb调试gfortran:w_powf.c:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在调试的Fortran程序。我有一个可变参数列表,其中一个预期变量几乎是其预期值的两倍。
所以我使用调试标志编译了程序,并开始调试:
程序名是hfock

  $ gdb hfock 
(gdb)break hfock
(gdb)run
启动程序:/ home / e / Desktop / hfock hfock
hfock中的断点1,hfock() f:16
16 ZETA1 = 2.173171
(gdb)s
17 ZETA2 = 1.188530
(gdb)s
18 WRITE(*,'(Zeta1: ,F7.4 /Zeta2:,F7.4)')ZETA1,ZETA2
(gdb)s
Zeta1:2.1732
Zeta2:1.1885
21 PLUS = ZETA1 + ZETA2
(gdb)s
22 PROD = ZETA1 * ZETA2
(gdb)s
23 DIFF = ZETA1-ZETA2
(gdb)s
24在w_powf.c:26
26 * w_powf.c中的* PROD ** 1.5 / PLUS ** 3
(gdb)s
__powf(x = 2.58287883,y = 1.5) : 无此文件或目录。

相应的(24,25,26)行代码为:

  S12 = 8. * PROD ** 1.5 / PLUS ** 3 
T11 = 0.5 * ZETA1 ** 2
T22 = 0.5 * ZETA2 ** 2

我认为这可能是一个数学库或glibc相关的错误,但是我我不确定这个错误的意思,或者如何解决它。这是fortran,为什么它调用一个C库?我需要包含一个库吗?或者安装缺失的依赖项?
完整程序源代码:
http://pastebin.com/waeEFSBZ

解决方案> 在Fortran指数运算符中。指数化在glibc w_powf.c 中实现。 Gdb在你的源代码中找不到这个文件。这不是一个错误,而是诊断。


I have a Fortran program I am debuging. I have a list of varables and one of the expected variables is almost double its expected value. So I compiled the program, with debug flags, and commenced debugging: the program name is hfock

$gdb hfock
(gdb) break hfock
(gdb) run
Starting program: /home/e/Desktop/hfock hfock
Breakpoint 1, hfock () at hfock.f:16
16        ZETA1 = 2.173171
(gdb) s
17        ZETA2 = 1.188530
(gdb) s
18        WRITE (*, '( "Zeta1:", F7.4 / "Zeta2:", F7.4 )' )  ZETA1, ZETA2
(gdb) s
Zeta1: 2.1732
Zeta2: 1.1885
21        PLUS=ZETA1+ZETA2
(gdb) s 
22        PROD=ZETA1*ZETA2
(gdb) s
23        DIFF=ZETA1-ZETA2
(gdb) s
24        S12=8.*PROD**1.5/PLUS**3
(gdb) s
__powf (x=2.58287883, y=1.5) at w_powf.c:26
26  w_powf.c: No such file or directory.

The corresponding (24,25,26) lines of code are:

  S12=8.*PROD**1.5/PLUS**3
  T11=0.5*ZETA1**2
  T22=0.5*ZETA2**2

I think this might be a math library, or glibc related error, but I'm not sure what the error means, or how to fix it.This is fortran, why is it calling a C library? do I need to include a library? or install a missing dependency? full program source here: http://pastebin.com/waeEFSBZ

解决方案

** is in Fortran exponential operator. Exponentiation is implemented in glibc w_powf.c. Gdb can't find this file in your sources. This is not an error, rather diagnostic.

这篇关于用gdb调试gfortran:w_powf.c:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆