Pla*_*ean 7 macos fortran gfortran
我正在尝试在我的 MacBook 上安装gadgetviewer,但是当我运行时
./configure prefix=/usr/local/bin
Run Code Online (Sandbox Code Playgroud)
经过大量输出后我得到:
checking for g_key_file_new in -lglib-2.0... no
checking how to get verbose linking output from gfortran... configure:
WARNING: compilation failed
checking for Fortran libraries of gfortran...
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... configure: error: in `/Users/chris/Downloads/gadgetviewer-1.0.7':
configure: error: cannot compile a simple Fortran program
Run Code Online (Sandbox Code Playgroud)
但我已经安装了 gfortran 并正在工作:
$ which gfortran
/usr/local/bin/gfortran
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么它似乎找不到 fortran 编译器?
一如既往地感谢。
电子数据交换1:
我的路径输出是:
$ echo $PATH
Run Code Online (Sandbox Code Playgroud)
/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/opt/ldg/ bin:/opt/ldg/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/chris/.local/bin:/Applications/root_v6.06.06/bin:/usr/bin:/bin :/usr/sbin:/sbin:/usr/local/bin:/Library/TeX/texbin
(不允许我将其放入代码块中)
在自述文件中,我们有:
1.2 Specifying compilers and flags
----------------------------------
The compilers to use can be specified by setting the following
environment variables before running the configure script:
CC - C compiler
CFLAGS - C compiler flags
FC - Fortran 90 compiler
FCFLAGS - Fortran compiler flags
Run Code Online (Sandbox Code Playgroud)
我的 config.log 文件中有:
CC='gcc'
CFLAGS='-g -O2'
...
CPP='gcc -E'
CPPFLAGS=''
...
FC='gfortran'
FCFLAGS=''
FCFLAGS_f90=''
Run Code Online (Sandbox Code Playgroud)
我省略了一些我认为不相关的信息。所以 C 编译器有标志,而 Fortran 编译器没有,也许这是相关的?我对这里发生的事情完全一无所知(对于安装这样的东西来说相当新)。
编辑2:
还刚刚发现这是在 config.log 上:
configure:19184: checking how to get verbose linking output from gfortran
configure:19200: gfortran -c conftest.f >&5
./configure: line 19202: /usr/local/bin/gfortran: Bad CPU type in executable
configure:19207: $? = 126
configure: failed program was:
| program main
|
| end
configure:19291: WARNING: compilation failed
configure:19298: result:
configure:19300: checking for Fortran libraries of gfortran
configure:19323: gfortran -o conftest conftest.f -lz -lm
./configure: line 19327: /usr/local/bin/gfortran: Bad CPU type in executable
configure:19500: result:
configure:19515: checking for dummy main to link with Fortran libraries
configure:19559: gcc -o conftest -g -O2 conftest.c -lz -lm >&5
configure:19566: $? = 0
configure:19654: result: none
configure:19692: checking for Fortran name-mangling scheme
configure:19711: gfortran -c conftest.f >&5
./configure: line 19713: /usr/local/bin/gfortran: Bad CPU type in executable
configure:19718: $? = 126
configure: failed program was:
| subroutine foobar()
| return
| end
| subroutine foo_bar()
| return
| end
configure:19920: error: in `/Users/chris/Downloads/gadgetviewer-1.0.7':
configure:19923: error: cannot compile a simple Fortran program
Run Code Online (Sandbox Code Playgroud)