【发布时间】:2012-08-13 02:36:25
【问题描述】:
我有一个关于如何为 Fortran 设置 Eclipse 的简短问题。
我已经下载并安装了“Photran”(Eclipse 的 Fortran 工具)。我遇到的问题是,每次我尝试运行一个程序时,我都会收到一条消息,上面写着"Launch failed. Binary not found." 然后,我发现你必须先“构建”文件,所以当我尝试这样做时,我得到了控制台中的消息如下:
**** Build of configuration Debug for project Fortran2 ****
make all
/bin/sh: gfortran: command not found
Building file: ../Src/helloworld.f90
make: *** [Src/helloworld.o] Error 127
Invoking: GNU Fortran Compiler
gfortran -funderscoring -I/usr/locl/bin -O0 -g -Wall -c -fmessage-length=0 -o "Src/helloworld.o" "../Src/helloworld.f90"
**** Build Finished ****
是否有人对如何使其工作有任何指示?
【问题讨论】:
-
你确认gfortran安装正确了吗?
-
是的,如果我从终端调用 gfortran,它就可以正常工作。然而,奇怪的是这一行:“/bin/sh: gfortran: command not found”。 gfortran 不在我计算机上的那个目录中……它在“/usr/local/bin”中。所以这一定是问题的一部分,我只是不知道如何处理它。
-
/bin/sh 不是目录。调用 gfortran 的是 shell 解释器。也许 sh shell 在其路径中找不到 gfortran - 但我只是在这里猜测。您可以尝试在终端中运行 /bin/sh,然后查看是否可以调用 gfortran。
-
可能是
/usr/local/bin不在传递给子shell 的PATH中,由Eclipse 启动。或者你错误地配置了 Photran --I/usr/locl/bin中的包含路径对我来说似乎不正确。