' configure:错误:无法编译简单的Fortran程序'安装Fortran编译器

时间:2017-08-14 13:03:05

标签: macos fortran gfortran

我试图在我的macbook上安装gadgetviewer,但是当我运行时

./configure prefix=/usr/local/bin

输出加载后我得到:

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 

但我已经安装并工作了gfortran:

$ which gfortran
/usr/local/bin/gfortran

有没有人有任何想法为什么它似乎无法找到fortran编译器?

一如既往地谢谢。

edi1:

我的路径输出是:

$ echo $PATH

/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中:/库/特克斯/ texbin

(不会让我把它放在代码块中)

README我们有:

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

和我的config.log文件包含在其中:

CC='gcc'
CFLAGS='-g -O2'
...
CPP='gcc -E'
CPPFLAGS=''
...
FC='gfortran'
FCFLAGS=''
FCFLAGS_f90=''

我已经省略了一些我认为不相关的信息。所以C编译器有标志而fortran没有,也许这是相关的?我对这里发生的事情一无所知(安装这样的东西很新)。

EDIT2:

还发现这是在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

0 个答案:

没有答案
相关问题