2017-11-20 19 views
2

High Sierra가 설치된 새 Mac mini에서 gfortran으로 컴파일하는 데 많은 문제가 있습니다.High Sierra의 gfortran 설치/컴파일 문제

오류 메시지없이 gcc를 homebrew와 함께 설치했습니다. 기본 hello world 코드 나 컴파일 된 코드를 다른 컴퓨터에서 gfortran으로 성공적으로 컴파일하려고하면 매번이 오류가 발생합니다 (gfortran helloworld.f90 -o hw 컴파일 오류).

FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'm' flag! 

이 오류를 이해하지 않지만, 내가 코드를 컴파일하고 시에라에서 실행되는 동일한 조각을 얻을 수있는 나는이 gfortran/GCC와 높은 시에라 사이에 작동하지 않는 것을 가정해야합니다.

나는 다른 누군가가 같은 문제를 겪고 있는지 또는 뭔가 다른 것으로 인해 발생하고 그것을 고치는 법을 안다면 정말로 관심이 있습니다.

편집 :

기본 hello world C 코드를 컴파일하면 정상적으로 작동합니다. 오류 없음. gcc -v를 들어

:

Using built-in specs. 
COLLECT_GCC=gfortran 
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/7.2.0/libexec/gcc/x86_64-apple-darwin17.0.0/7.2.0/lto-wrapper 
Target: x86_64-apple-darwin17.0.0 
Configured with: ../configure --build=x86_64-apple-darwin17.0.0 --prefix=/usr/local/Cellar/gcc/7.2.0 --libdir=/usr/local/Cellar/gcc/7.2.0/lib/gcc/7 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-7 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC 7.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls 
Thread model: posix 
gcc version 7.2.0 (Homebrew GCC 7.2.0) 

그리고 as -v에 대한 :

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 9.0.0 (clang-900.0.38) 
Target: x86_64-apple-darwin17.2.0 
Thread model: posix 
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin 

gfortran -v를 들어

Apple Inc version cctools-895, GNU assembler version 1.38 

하지만 그때 끊고가 도착은 Ctrl + C를 취소 할 수 있습니다 .

OSP 10.13.1을 실행하고 homebrew (가정용 웹 페이지의 표준 지침을 사용하여 설치)를 사용하여 gcc v7.2를 설치했습니다. Xcode는 v9.1이며 최신 버전입니다. tcsh 창에서 작업하지만 bash에서 테스트 할 때 같은 오류가 발생합니다.

+1

오류는 gfortran이 아닌 GNU Binutils https://www.gnu.org/software/binutils/의 일부인 'as'에 의해보고됩니다. 매우 besic 한 C 코드도 컴파일하고 정확한 세부 정보를 보여주십시오. compilationa에 대한 명령과 ** complete ** 출력에 대한 오류,'as -v','gcc -v' 및'gfortran -v' 출력의 출력과 생각할 수있는 자세한 내용이 있습니다. 설치 한 소프트웨어의 버전을 정확하게 알려주십시오. –

+0

(댓글에있는 모든 코딩 문제는 ... 죄송합니다. 포럼에 처음 오 셨습니다.) –

+0

아, 고마워. 내가 할게. –

답변

0

언급 된 다른 웹 페이지에 언급 된 내용을 따르면 이전 버전의 gfortran을 사용할 수있었습니다.

내가 gfortran이 High Sierra에서 현재 작동하는 macports를 통해 gcc v6.4을 가져 왔습니다.

gcc v7.2 및 High Sierra 문제는 해결되지 않지만 임시 해결 방법을 제공합니다.