问题标签 [g77]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
fortran - 可变内存分配中的 Fortran 分段错误
我是 Fortran 新手,我正在尝试让其他人的代码运行以获取更大的输入。我一直在代码的这个区域遇到分段错误,这(惊喜,惊喜!!)取决于输入的大小。我将调试输出发送到一个文件并在每次写入后刷新,所以我确定它在这里而不是其他地方。
maxstrucs 是 500,maxres 是 150,numcol 是 124750。我知道公共字段有问题,但我正在使用标志 -mcmodel=medium 进行编译
作为参考,编译语句是
我还将堆栈大小设置为无限制
我有一个 94Gbs 可用 RAM 的服务器。所以理论上它应该可以工作,除非有某种我不知道的限制。请帮忙
c - 混合编程:从 C 调用 FORTRAN
我必须对从 C/C++ 调用 FORTRAN 子例程进行概念验证。我不知道我在正确的方向,请指导我....
我所做的是...
我写了以下 FORTRAN 代码
使用 g77 编译它g77.exe -c FORTRANfun.for
我写了以下c代码...
使用 Visual Studio C 编译器将其编译为cl /c new.c
当我尝试链接时,因为LINK new.obj FORTRANfun.o
我收到以下错误...
c++ - FORTRAN 到 C++ 和 C++ 到 FORTRAN 通信
我有一个 C++ 应用程序和 FORTRAN 应用程序,它们通过文件进行通信。(双向)
FORTRAN 应用程序正在将数据写入文件,而 C++ 正在从文件中读取数据。现在出现了一个新的要求,我必须直接使用 FORTRAN 形式的 C++ 代码以及从 FORTRAN 到 C++ 进行通信(因为文件操作很昂贵)。我在 C++ 端实现了套接字,并试图在 FORTRAN 端实现套接字。我没有在互联网上获得有关 FORTRAN 套接字的足够信息。
FORTRAN 遗留代码是用 g77 编写的。C++ 在 MFC 中。
- 除了套接字通信之外,还有更好的方法来实现这一点吗?
- 任何有关使用 g77 的 FORTRAN 上的套接字的链接都会有所帮助。
我知道,我不应该在这个论坛上要求链接。如果这个问题不属于这个论坛,我在哪里可以问这种问题?
segmentation-fault - Confusing stack behavior in G77-compiled program
I've got a mixture of C++ and Fortran 77, all compiled with G77.
It is mostly C++, but it calls the ODE-solver DVERK, which then calls back to a global C function to get the derivative (declared with __stdcall
).
It's all been working fine, until I get a strange SIGSEGV.
I tracked that down, and it was because the esp
was decreasing below its segment boundary.
The reason it did that is that DVERK contains the **
operator, which internally is a function call with two double-precision values passed by value on the stack, for 16 bytes.
The function returns the answer, but then I see this instruction:
which decrements the stack pointer by 16 bytes, as if it were putting the arguments back on the stack (?)
G77 seems to do this after every function call, and usually it does no harm because the stack pointer is unchanged.
However, in the case of **
the stack pointer remains decremented, and if that code is executed enough times, the decrementation adds up until I get the SIGSEGV.
(If there is sufficient stack space, this problem doesn't appear because the return from DVERK cleans it up.)
I tried replacing the code a**b
with dexp(dlog(a)*b)
, but the same thing happens, except it happens in two steps, 8 bytes after dlog
, and 8 bytes after dexp
.
There must be something I'm doing wrong in setting up the calling conventions used by G77 vis-a-vis its run-time-library. Expertise appreciated.
random - g77的随机数生成器
我目前使用的 Fortran 代码使用:
这是一个示例代码,显示了我正在尝试使用的随机数生成器:
但是,在 mac 上使用 g77 或 gfortran 编译时,出现以下错误:
使用 g77 或 gfortran 编译时,我可以使用类似的随机数生成器吗?请注意:我通常不使用 Fortran,我只是想编译别人的 Fortran 77 代码!提前感谢您的任何建议或帮助。
ubuntu - 如何在 Ubuntu 14.04 上安装 GNU Fortran 77 编译器或 g77
我有一个需要 g77 编译器的库。
我在网上找到了一些方法;但每个都失败了。以下是我的两个努力的总结:
1)我下载了软件包,解压它并 $ sudo ./install.sh
2)我按照( http://seanelvidge.com/2012/08/install-g77-on-ubuntu-9-04/#comment-549085 )中的描述更改了sources.list文件,然后在“ sudo apt-get update”运行良好。
$ sudo apt-get install g77
一些帮助将不胜感激。
linux - g77 编译错误(找不到 crt1.o、crti.o、-lgcc_s)
我真的需要一些帮助。我正在尝试为我的论文编译和执行一些程序。
问题是,我以前从未使用过 Fortran,所以我盲目地依赖文档....它说使用一些命令来完成工作,特别是
所以,我安装了 Ubuntu 14.04(我在 Windows 上工作,这是另一个问题,我也是 Linux 新手),并在终端中使用了这些命令。
起初它没有工作,因为它无法识别 g77 命令,我按照教程安装 g77,再次启动“make all”命令,似乎它部分工作。据我所知,编译器在目录中创建了一堆 .o 文件,但是在编译 6 个主程序时
它给了我这些错误(我从意大利语翻译了一些部分)
我有点迷失在这里,正如我告诉你的那样,我对 Fortran 和 Linux 都是新手,所以我真的想不通....感谢您的帮助!
compiler-errors - gfortran 在编译文件上没有 ident 工具的输出
我使用 ident 工具从源文件和编译文件中提取 RCS 关键字字符串。
它当然适用于源代码,也适用于 GCC 的 C 编译输出以及 G77 的 fortran 编译输出。
问题是当我使用 gfortran 编译器编译 fortran 代码时。ident工具在编译后的代码中找不到RCS关键字,什么也不返回!
那么,gfortran 有什么问题呢?是否有任何优化来操纵变量,或者 ident 工具不再能够解析 gfortran 的编译输出?
请问我该如何解决这个问题?
编辑:
Fortran 源代码:
fortran - “无效的声明或引用符号...”错误
我想在 ubuntu 32 位机器上编译一个包含以下命令的 makefile。
但是我有一些我无法解决的问题。
为什么这个声明无效?以及如何解决问题?有人可以解释一下吗?